mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'master' of gitlab.com:aave-tech/protocol-v2 into 183-flash-liquidation-adapter
This commit is contained in:
commit
a72b73d804
|
@ -37,6 +37,6 @@ certora-test:
|
||||||
- mv solc-static-linux /usr/bin/solc
|
- mv solc-static-linux /usr/bin/solc
|
||||||
- export PATH=$PATH:/usr/bin/solc/solc-static-linux
|
- export PATH=$PATH:/usr/bin/solc/solc-static-linux
|
||||||
script:
|
script:
|
||||||
- certoraRun specs/harness/StableDebtTokenHarness.sol:StableDebtTokenHarness --solc_args '--optimize' --verify StableDebtTokenHarness:specs/StableDebtToken.spec --settings -assumeUnwindCond,-b=4 --cache StableDebtToken --cloud
|
- certoraRun specs/harness/StableDebtTokenHarness.sol:StableDebtTokenHarness --solc_args "['--optimize']" --verify StableDebtTokenHarness:specs/StableDebtToken.spec --settings -assumeUnwindCond,-b=4 --cache StableDebtToken --cloud
|
||||||
- certoraRun specs/harness/UserConfigurationHarness.sol --verify UserConfigurationHarness:specs/UserConfiguration.spec --solc_args '--optimize' --settings -useBitVectorTheory --cache UserConfiguration --cloud
|
- certoraRun specs/harness/UserConfigurationHarness.sol --verify UserConfigurationHarness:specs/UserConfiguration.spec --solc_args "['--optimize']" --settings -useBitVectorTheory --cache UserConfiguration --cloud
|
||||||
- certoraRun contracts/protocol/tokenization/VariableDebtToken.sol:VariableDebtToken specs/harness/LendingPoolHarnessForVariableDebtToken.sol --solc_args '--optimize' --link VariableDebtToken:POOL=LendingPoolHarnessForVariableDebtToken --verify VariableDebtToken:specs/VariableDebtToken.spec --settings -assumeUnwindCond,-useNonLinearArithmetic,-b=4 --cache VariableDebtToken --cloud
|
- certoraRun contracts/protocol/tokenization/VariableDebtToken.sol:VariableDebtToken specs/harness/LendingPoolHarnessForVariableDebtToken.sol --solc_args "['--optimize']" --link VariableDebtToken:POOL=LendingPoolHarnessForVariableDebtToken --verify VariableDebtToken:specs/VariableDebtToken.spec --settings -assumeUnwindCond,-useNonLinearArithmetic,-b=4 --cache VariableDebtToken --cloud
|
||||||
|
|
|
@ -89,20 +89,13 @@ library ValidationLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ValidateBorrowLocalVars {
|
struct ValidateBorrowLocalVars {
|
||||||
uint256 principalBorrowBalance;
|
|
||||||
uint256 currentLtv;
|
uint256 currentLtv;
|
||||||
uint256 currentLiquidationThreshold;
|
uint256 currentLiquidationThreshold;
|
||||||
uint256 requestedBorrowAmountETH;
|
|
||||||
uint256 amountOfCollateralNeededETH;
|
uint256 amountOfCollateralNeededETH;
|
||||||
uint256 userCollateralBalanceETH;
|
uint256 userCollateralBalanceETH;
|
||||||
uint256 userBorrowBalanceETH;
|
uint256 userBorrowBalanceETH;
|
||||||
uint256 borrowBalanceIncrease;
|
|
||||||
uint256 currentReserveStableRate;
|
|
||||||
uint256 availableLiquidity;
|
uint256 availableLiquidity;
|
||||||
uint256 finalUserBorrowRate;
|
|
||||||
uint256 healthFactor;
|
uint256 healthFactor;
|
||||||
DataTypes.InterestRateMode rateMode;
|
|
||||||
bool healthFactorBelowThreshold;
|
|
||||||
bool isActive;
|
bool isActive;
|
||||||
bool isFrozen;
|
bool isFrozen;
|
||||||
bool borrowingEnabled;
|
bool borrowingEnabled;
|
||||||
|
@ -197,7 +190,7 @@ library ValidationLogic {
|
||||||
* 3. Users will be able to borrow only a portion of the total available liquidity
|
* 3. Users will be able to borrow only a portion of the total available liquidity
|
||||||
**/
|
**/
|
||||||
|
|
||||||
if (vars.rateMode == DataTypes.InterestRateMode.STABLE) {
|
if (interestRateMode == uint256(DataTypes.InterestRateMode.STABLE)) {
|
||||||
//check if the borrow mode is stable and if stable rate borrowing is enabled on this reserve
|
//check if the borrow mode is stable and if stable rate borrowing is enabled on this reserve
|
||||||
|
|
||||||
require(vars.stableRateBorrowingEnabled, Errors.VL_STABLE_BORROWING_NOT_ENABLED);
|
require(vars.stableRateBorrowingEnabled, Errors.VL_STABLE_BORROWING_NOT_ENABLED);
|
||||||
|
|
|
@ -128,7 +128,9 @@ export const approve = async (reserveSymbol: string, user: SignerWithAddress, te
|
||||||
|
|
||||||
const token = await getMintableERC20(reserve);
|
const token = await getMintableERC20(reserve);
|
||||||
|
|
||||||
await token.connect(user.signer).approve(pool.address, '100000000000000000000000000000');
|
await waitForTx(
|
||||||
|
await token.connect(user.signer).approve(pool.address, '100000000000000000000000000000')
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deposit = async (
|
export const deposit = async (
|
||||||
|
@ -314,7 +316,7 @@ export const delegateBorrowAllowance = async (
|
||||||
await expect(delegateAllowancePromise, revertMessage).to.be.revertedWith(revertMessage);
|
await expect(delegateAllowancePromise, revertMessage).to.be.revertedWith(revertMessage);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
await delegateAllowancePromise;
|
await waitForTx(await delegateAllowancePromise);
|
||||||
const allowance = await debtToken.borrowAllowance(user.address, receiver);
|
const allowance = await debtToken.borrowAllowance(user.address, receiver);
|
||||||
expect(allowance.toString()).to.be.equal(
|
expect(allowance.toString()).to.be.equal(
|
||||||
amountToDelegate,
|
amountToDelegate,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user