-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AaveV3LeverageStrategyExtension audit feedback (#142)
* Test showing that settting Emode does not affect getReserveConfigurationData * Start adjusting StrategyExtension test to switcht to wsteth/eth pair * Fixing tests * Fix test * First test case for rebalancing in e-mode * Fix handling of emode ltv / liquidationThreshold * Add test case for wrong repay threshold * Fix tests * Remove subtraction of unutilizedLeveragePercentage when delevering * Add test for targetLeverageRatio verification * Add verification step for targetLeverageRatio >= 1 * Switch div / mul order in _calculateMinRepayUnits * Switch div / mul order in calculateChunkRebalanceNotional * Switch to latestRoundData on chainlink call * Add check for maximum oracle price age * Add tests for outdated price response from oracle * Fix tests * Add method to override noRebalanceInProgress modifier * Fix tests * Use AaveOracle instead of configured chainlink oracles * Get AaveOracle address from AddressProvider instead of deploy argument * Change to get aaveOracle address on the fly from addressProvider * Clean up and additional code comments * fix(dependencies): Add post audit Aave V3 dependencies (#145) update post audit contracts for integration tests Co-authored-by: Pranav Bhardwaj <[email protected]> * Updates to test (#146) * remove test filter on FlashMintLeveraged. * chore: update current block * test: updates to deployment of leverage module. * Fix failing tests for AaveV3LeverageStrategyExtension (#147) * Fix failing tests * Adjust test message for ripcord test --------- Co-authored-by: christn <[email protected]> * remove .only from test * test: fix issues with updating block. Made deadline on uniswap router swaps less brittle. --------- Co-authored-by: pblivin0x <[email protected]> Co-authored-by: Pranav Bhardwaj <[email protected]> Co-authored-by: SnakePoison <[email protected]>
- Loading branch information
1 parent
8727853
commit 83e500f
Showing
18 changed files
with
1,073 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,67 @@ | ||
// SPDX-License-Identifier: agpl-3.0 | ||
pragma solidity 0.6.10; | ||
|
||
|
||
interface IAToken { | ||
/** | ||
* @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH) | ||
**/ | ||
function UNDERLYING_ASSET_ADDRESS() external view returns (address); | ||
event Approval(address indexed owner, address indexed spender, uint256 value); | ||
event BalanceTransfer(address indexed from, address indexed to, uint256 value, uint256 index); | ||
event Burn(address indexed from, address indexed target, uint256 value, uint256 balanceIncrease, uint256 index); | ||
event Initialized( | ||
address indexed underlyingAsset, | ||
address indexed pool, | ||
address treasury, | ||
address incentivesController, | ||
uint8 aTokenDecimals, | ||
string aTokenName, | ||
string aTokenSymbol, | ||
bytes params | ||
); | ||
event Mint( | ||
address indexed caller, address indexed onBehalfOf, uint256 value, uint256 balanceIncrease, uint256 index | ||
); | ||
event Transfer(address indexed from, address indexed to, uint256 value); | ||
|
||
function ATOKEN_REVISION() external view returns (uint256); | ||
function DOMAIN_SEPARATOR() external view returns (bytes32); | ||
function EIP712_REVISION() external view returns (bytes memory); | ||
function PERMIT_TYPEHASH() external view returns (bytes32); | ||
function POOL() external view returns (address); | ||
function RESERVE_TREASURY_ADDRESS() external view returns (address); | ||
function UNDERLYING_ASSET_ADDRESS() external view returns (address); | ||
function allowance(address owner, address spender) external view returns (uint256); | ||
function approve(address spender, uint256 amount) external returns (bool); | ||
function balanceOf(address user) external view returns (uint256); | ||
function burn(address from, address receiverOfUnderlying, uint256 amount, uint256 index) external; | ||
function decimals() external view returns (uint8); | ||
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); | ||
function getIncentivesController() external view returns (address); | ||
function getPreviousIndex(address user) external view returns (uint256); | ||
function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256); | ||
function handleRepayment(address user, address onBehalfOf, uint256 amount) external; | ||
function increaseAllowance(address spender, uint256 addedValue) external returns (bool); | ||
function initialize( | ||
address initializingPool, | ||
address treasury, | ||
address underlyingAsset, | ||
address incentivesController, | ||
uint8 aTokenDecimals, | ||
string memory aTokenName, | ||
string memory aTokenSymbol, | ||
bytes memory params | ||
) external; | ||
function mint(address caller, address onBehalfOf, uint256 amount, uint256 index) external returns (bool); | ||
function mintToTreasury(uint256 amount, uint256 index) external; | ||
function name() external view returns (string memory); | ||
function nonces(address owner) external view returns (uint256); | ||
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) | ||
external; | ||
function rescueTokens(address token, address to, uint256 amount) external; | ||
function scaledBalanceOf(address user) external view returns (uint256); | ||
function scaledTotalSupply() external view returns (uint256); | ||
function setIncentivesController(address controller) external; | ||
function symbol() external view returns (string memory); | ||
function totalSupply() external view returns (uint256); | ||
function transfer(address recipient, uint256 amount) external returns (bool); | ||
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); | ||
function transferOnLiquidation(address from, address to, uint256 value) external; | ||
function transferUnderlyingTo(address target, uint256 amount) external; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.