From 73f99750b94ca25596feb7ed33301bea64203537 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Wed, 28 Feb 2024 10:37:38 +0100 Subject: [PATCH] docs: natspec in interface --- src/fixed-rate-irm/FixedRateIrm.sol | 11 ++--------- src/fixed-rate-irm/interfaces/IFixedRateIrm.sol | 12 ++++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/fixed-rate-irm/FixedRateIrm.sol b/src/fixed-rate-irm/FixedRateIrm.sol index 1832bd7..b33a59c 100644 --- a/src/fixed-rate-irm/FixedRateIrm.sol +++ b/src/fixed-rate-irm/FixedRateIrm.sol @@ -22,21 +22,14 @@ string constant RATE_ZERO = "rate zero"; contract FixedRateIrm is IFixedRateIrm { using MarketParamsLib for MarketParams; - /* EVENTS */ - - /// @notice Emitted when a borrow rate is set. - event SetBorrowRate(Id indexed id, uint256 newBorrowRate); - /* STORAGE */ - /// @notice Borrow rates. + /// @inheritdoc IFixedRateIrm mapping(Id => uint256) public borrowRateStored; /* SETTER */ - /// @notice Sets the borrow rate for a market. - /// @dev A rate can be set by anybody, but only once. - /// @dev `borrowRate` reverts on rate not set, so the rate needs to be set before the market creation. + /// @inheritdoc IFixedRateIrm function setBorrowRate(Id id, uint256 newBorrowRate) external { require(borrowRateStored[id] == 0, RATE_SET); require(newBorrowRate != 0, RATE_ZERO); diff --git a/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol b/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol index dacbdfc..78202db 100644 --- a/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol +++ b/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol @@ -8,6 +8,18 @@ import {Id} from "../../../lib/morpho-blue/src/interfaces/IMorpho.sol"; /// @author Morpho Labs /// @custom:contact security@morpho.org interface IFixedRateIrm is IIrm { + /* EVENTS */ + + /// @notice Emitted when a borrow rate is set. + event SetBorrowRate(Id indexed id, uint256 newBorrowRate); + + /* EXTERNAL */ + + /// @notice Borrow rates. function borrowRateStored(Id id) external returns (uint256); + + /// @notice Sets the borrow rate for a market. + /// @dev A rate can be set by anybody, but only once. + /// @dev `borrowRate` reverts on rate not set, so the rate needs to be set before the market creation. function setBorrowRate(Id id, uint256 newBorrowRate) external; }