mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
feat: update
This commit is contained in:
parent
6438aa18d7
commit
03d18acf03
|
@ -10,7 +10,7 @@ abstract contract Helpers is Stores, Basic {
|
|||
IMorphoCore public constant MORPHO_AAVE_V3 =
|
||||
IMorphoCore(0x33333aea097c193e66081E930c33020272b33333);
|
||||
|
||||
uint256 public constant max_iteration = 4;
|
||||
uint256 public constant MAX_ITERATIONS = 4;
|
||||
|
||||
function _performEthToWethConversion(
|
||||
address _tokenAddress,
|
||||
|
|
|
@ -30,7 +30,7 @@ abstract contract MorphoAaveV3 is Helpers, Events {
|
|||
|
||||
approve(_tokenContract, address(MORPHO_AAVE_V3), _amt);
|
||||
|
||||
MORPHO_AAVE_V3.supply(address(_tokenContract), _amt, address(this), max_iteration);
|
||||
MORPHO_AAVE_V3.supply(address(_tokenContract), _amt, address(this), MAX_ITERATIONS);
|
||||
|
||||
setUint(_setId, _amt);
|
||||
|
||||
|
@ -229,7 +229,7 @@ abstract contract MorphoAaveV3 is Helpers, Events {
|
|||
bool _isETH = _tokenAddress == ethAddr;
|
||||
address _token = _isETH ? wethAddr : _tokenAddress;
|
||||
|
||||
uint256 _borrowed = MORPHO_AAVE_V3.borrow(_token, _amt, address(this), address(this), max_iteration);
|
||||
uint256 _borrowed = MORPHO_AAVE_V3.borrow(_token, _amt, address(this), address(this), MAX_ITERATIONS);
|
||||
|
||||
convertWethToEth(_isETH, TokenInterface(_token), _borrowed);
|
||||
|
||||
|
@ -360,7 +360,7 @@ abstract contract MorphoAaveV3 is Helpers, Events {
|
|||
address _token = _isEth? wethAddr : _tokenAddress;
|
||||
|
||||
// Morpho will internally handle max amount conversion by taking the minimum of amount or supplied collateral.
|
||||
uint256 _withdrawn = MORPHO_AAVE_V3.withdraw(_token, _amt, address(this), address(this), max_iteration);
|
||||
uint256 _withdrawn = MORPHO_AAVE_V3.withdraw(_token, _amt, address(this), address(this), MAX_ITERATIONS);
|
||||
|
||||
convertWethToEth(_isEth, TokenInterface(_token), _withdrawn);
|
||||
|
||||
|
@ -655,13 +655,13 @@ abstract contract MorphoAaveV3 is Helpers, Events {
|
|||
external
|
||||
returns (string memory _eventName, bytes memory _eventParam)
|
||||
{
|
||||
uint256 _oldIterations = max_iteration;
|
||||
max_iteration = _iterations;
|
||||
uint256 _oldIterations = MAX_ITERATIONS;
|
||||
MAX_ITERATIONS = _iterations;
|
||||
|
||||
_eventName = "LogUpdateMaxIterations(uint256,uint256)";
|
||||
_eventParam = abi.encode(
|
||||
_oldIterations,
|
||||
max_iteration
|
||||
MAX_ITERATIONS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user