Skip to content

Commit

Permalink
Merge pull request #206 from aave/fix/complete-gho-facilitator-interface
Browse files Browse the repository at this point in the history
fix: Complete IGhoFacilitator with treasury functions
  • Loading branch information
Steven Valeri authored Dec 15, 2022
2 parents 4f6dcb3 + 98a521c commit 17ffc03
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 43 deletions.
4 changes: 2 additions & 2 deletions src/contracts/facilitators/aave/tokens/GhoAToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ contract GhoAToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base
return address(_ghoVariableDebtToken);
}

/// @inheritdoc IGhoAToken
/// @inheritdoc IGhoFacilitator
function updateGhoTreasury(address newGhoTreasury) external override onlyPoolAdmin {
address oldGhoTreasury = _ghoTreasury;
_ghoTreasury = newGhoTreasury;
emit GhoTreasuryUpdated(oldGhoTreasury, newGhoTreasury);
}

/// @inheritdoc IGhoAToken
/// @inheritdoc IGhoFacilitator
function getGhoTreasury() external view override returns (address) {
return _ghoTreasury;
}
Expand Down
19 changes: 0 additions & 19 deletions src/contracts/facilitators/aave/tokens/interfaces/IGhoAToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ interface IGhoAToken is IAToken, IGhoFacilitator {
*/
event VariableDebtTokenSet(address indexed variableDebtToken);

/**
* @dev Emitted when GHO treasury address is updated
* @param oldGhoTreasury The address of the old GhoTreasury
* @param newGhoTreasury The address of the new GhoTreasury
*/
event GhoTreasuryUpdated(address indexed oldGhoTreasury, address indexed newGhoTreasury);

/**
* @notice Sets a reference to the GHO variable debt token
* @param ghoVariableDebtToken The address of the GhoVariableDebtToken contract
Expand All @@ -34,16 +27,4 @@ interface IGhoAToken is IAToken, IGhoFacilitator {
* @return The address of the GhoVariableDebtToken contract
*/
function getVariableDebtToken() external view returns (address);

/**
* @notice Updates the address of the GHO treasury, where interest earned by the protocol is sent
* @param newGhoTreasury The address of the GhoTreasury
*/
function updateGhoTreasury(address newGhoTreasury) external;

/**
* @notice Returns the address of the GHO treasury
* @return The address of the GhoTreasury contract
*/
function getGhoTreasury() external view returns (address);
}
4 changes: 2 additions & 2 deletions src/contracts/facilitators/flashMinter/GhoFlashMinter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ contract GhoFlashMinter is IGhoFlashMinter {
return _fee;
}

/// @inheritdoc IGhoFlashMinter
/// @inheritdoc IGhoFacilitator
function updateGhoTreasury(address newGhoTreasury) external override onlyPoolAdmin {
address oldGhoTreasury = _ghoTreasury;
_ghoTreasury = newGhoTreasury;
emit GhoTreasuryUpdated(oldGhoTreasury, newGhoTreasury);
}

/// @inheritdoc IGhoFlashMinter
/// @inheritdoc IGhoFacilitator
function getGhoTreasury() external view returns (address) {
return _ghoTreasury;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ interface IGhoFlashMinter is IERC3156FlashLender, IGhoFacilitator {
uint256 fee
);

/**
* @dev Emitted when GHO treasury address is updated
* @param oldGhoTreasury The address of the old GhoTreasury
* @param newGhoTreasury The address of the new GhoTreasury
*/
event GhoTreasuryUpdated(address indexed oldGhoTreasury, address indexed newGhoTreasury);

/**
* @notice Returns the address of the Aave Pool Addresses Provider contract
* @return The address of the PoolAddressesProvider
Expand All @@ -64,16 +57,4 @@ interface IGhoFlashMinter is IERC3156FlashLender, IGhoFacilitator {
* @return The percentage fee of the flash-minted amount that needs to be repaid, on top of the principal (in bps).
*/
function getFee() external view returns (uint256);

/**
* @notice Updates the address of the GHO treasury, where interest earned by the protocol is sent
* @param newGhoTreasury The address of the GhoTreasury
*/
function updateGhoTreasury(address newGhoTreasury) external;

/**
* @notice Returns the address of the GHO treasury
* @return The address of the GhoTreasury contract
*/
function getGhoTreasury() external view returns (address);
}
22 changes: 21 additions & 1 deletion src/contracts/gho/interfaces/IGhoFacilitator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@ interface IGhoFacilitator {
);

/**
* @notice Distribute accumulated fees to the GhoTreasury
* @dev Emitted when Gho Treasury address is updated
* @param oldGhoTreasury The address of the old GhoTreasury contract
* @param newGhoTreasury The address of the new GhoTreasury contract
*/
event GhoTreasuryUpdated(address indexed oldGhoTreasury, address indexed newGhoTreasury);

/**
* @notice Distribute fees to the GhoTreasury
*/
function distributeFeesToTreasury() external;

/**
* @notice Updates the address of the Gho Treasury
* @dev WARNING: The GhoTreasury is where revenue fees are sent to. Update carefully
* @param newGhoTreasury The address of the GhoTreasury
*/
function updateGhoTreasury(address newGhoTreasury) external;

/**
* @notice Returns the address of the Gho Treasury
* @return The address of the GhoTreasury contract
*/
function getGhoTreasury() external view returns (address);
}

0 comments on commit 17ffc03

Please sign in to comment.