mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: implemented supply cap
This commit is contained in:
parent
be859bd270
commit
1de5a303f4
|
@ -46,6 +46,13 @@ library ValidationLogic {
|
||||||
require(amount != 0, Errors.VL_INVALID_AMOUNT);
|
require(amount != 0, Errors.VL_INVALID_AMOUNT);
|
||||||
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
|
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
|
||||||
require(!isFrozen, Errors.VL_RESERVE_FROZEN);
|
require(!isFrozen, Errors.VL_RESERVE_FROZEN);
|
||||||
|
require(
|
||||||
|
IERC20(reserve.aTokenAddress)
|
||||||
|
.totalSupply()
|
||||||
|
.add(amount)
|
||||||
|
.div(10 ** reserve.configuration.getDecimals()) < reserve.configuration.getSupplyCap(),
|
||||||
|
Errors.VL_SUPPLY_CAP_EXCEEDED
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user