You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the features needed for protocol 2.5 is the implementation of a borrow cap functionality. The borrow cap will allow to set a maximum amount (expressed in unit of the underlying asset) that can be borrowed out of a specific reserve. If the cap is reached, it will not be possible to borrow the asset anymore.
One of the features needed for protocol 2.5 is the implementation of a borrow cap functionality. The borrow cap will allow to set a maximum amount (expressed in unit of the underlying asset) that can be borrowed out of a specific reserve. If the cap is reached, it will not be possible to borrow the asset anymore.
Implementation details
Add a new field
borrowCap
to the reserve configuration bitmap, https://github.com/aave/protocol-v2/blob/master/contracts/protocol/libraries/configuration/ReserveConfiguration.solIn
validateBorrow()
https://github.com/aave/protocol-v2/blob/master/contracts/protocol/libraries/logic/ValidationLogic.sol#L136 add a check that ensures that the borrowCap is either zero or not crossed by comparing it with the total supply of the corresponding debt token. if the borrow cap is crossed, revertGas considerations
See if it's possible to find a way to avoid calling the DebtToken.totalSupply() as it can be gas expensive
The text was updated successfully, but these errors were encountered: