From 58dc680884f8f8c55afcbe1dac5247f87f664b33 Mon Sep 17 00:00:00 2001 From: lucas-manuel Date: Thu, 9 Nov 2023 09:57:27 -0500 Subject: [PATCH] feat: add natspec and overrides --- src/SparkLendFreezerMom.sol | 8 +-- src/interfaces/ISparkLendFreezerMom.sol | 70 +++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/src/SparkLendFreezerMom.sol b/src/SparkLendFreezerMom.sol index 22eb846..edf49d1 100644 --- a/src/SparkLendFreezerMom.sol +++ b/src/SparkLendFreezerMom.sol @@ -54,13 +54,13 @@ contract SparkLendFreezerMom is ISparkLendFreezerMom { /*** Wards Functions ***/ /**********************************************************************************************/ - function setAuthority(address authority_) external onlyOwner { + function setAuthority(address authority_) external override onlyOwner { emit SetAuthority(authority, authority_); authority = authority_; } - function setOwner(address owner_) external onlyOwner { + function setOwner(address owner_) external override onlyOwner { emit SetOwner(owner, owner_); owner = owner_; } @@ -69,7 +69,7 @@ contract SparkLendFreezerMom is ISparkLendFreezerMom { /*** Auth Functions ***/ /**********************************************************************************************/ - function freezeAllMarkets() external auth { + function freezeAllMarkets() external override auth { address[] memory reserves = PoolLike(pool).getReservesList(); for (uint256 i = 0; i < reserves.length; i++) { @@ -78,7 +78,7 @@ contract SparkLendFreezerMom is ISparkLendFreezerMom { } } - function freezeMarket(address reserve) external auth { + function freezeMarket(address reserve) external override auth { PoolConfiguratorLike(poolConfigurator).setReserveFreeze(reserve, true); } diff --git a/src/interfaces/ISparkLendFreezerMom.sol b/src/interfaces/ISparkLendFreezerMom.sol index 0d43a53..ebed816 100644 --- a/src/interfaces/ISparkLendFreezerMom.sol +++ b/src/interfaces/ISparkLendFreezerMom.sol @@ -7,7 +7,77 @@ interface ISparkLendFreezerMom { /*** Events ***/ /**********************************************************************************************/ + /** + * @dev Event to log the setting of a new owner. + * @param oldOwner The address of the previous owner. + * @param newOwner The address of the new owner. + */ event SetOwner(address indexed oldOwner, address indexed newOwner); + + /** + * @dev Event to log the setting of a new authority. + * @param oldAuthority The address of the previous authority. + * @param newAuthority The address of the new authority. + */ event SetAuthority(address indexed oldAuthority, address indexed newAuthority); + /**********************************************************************************************/ + /*** Storage Variables ***/ + /**********************************************************************************************/ + + /** + * @dev Returns the address of the pool configurator. + * @return The address of the pool configurator. + */ + function poolConfigurator() external view returns (address); + + /** + * @dev Returns the address of the pool. + * @return The address of the pool. + */ + function pool() external view returns (address); + + /** + * @dev Returns the address of the authority. + * @return The address of the authority. + */ + function authority() external view returns (address); + + /** + * @dev Returns the address of the owner. + * @return The address of the owner. + */ + function owner() external view returns (address); + + /**********************************************************************************************/ + /*** Owner Functions ***/ + /**********************************************************************************************/ + + /** + * @dev Function to set a new authority, permissioned to owner. + * @param authority The address of the new authority. + */ + function setAuthority(address authority) external; + + /** + * @dev Function to set a new owner, permissioned to owner. + * @param owner The address of the new owner. + */ + function setOwner(address owner) external; + + /**********************************************************************************************/ + /*** Auth Functions ***/ + /**********************************************************************************************/ + + /** + * @dev Function to freeze a specified market. Permissioned to the `hat` in the Chief. + * @param reserve The address of the market to freeze. + */ + function freezeMarket(address reserve) external; + + /** + * @dev Function to freeze all markets. Permissioned to the `hat` in the Chief. + */ + function freezeAllMarkets() external; + }