diff --git a/contracts/implementation/aave-v2-migrator/main.sol b/contracts/implementation/aave-v2-migrator/main.sol index 6a5ec0a..8713344 100644 --- a/contracts/implementation/aave-v2-migrator/main.sol +++ b/contracts/implementation/aave-v2-migrator/main.sol @@ -78,7 +78,7 @@ contract InstaImplementationM1 is Constants { * @param _targetNames Array of Connector address. * @param _datas Array of Calldata. */ - function cast( + function castMigrate( string[] calldata _targetNames, bytes[] calldata _datas, address _origin @@ -115,4 +115,5 @@ contract InstaImplementationM1 is Constants { eventParams ); } + } \ No newline at end of file diff --git a/contracts/receivers/aave-v2-receiver/main.sol b/contracts/receivers/aave-v2-receiver/main.sol index f333a1c..b8e7e77 100644 --- a/contracts/receivers/aave-v2-receiver/main.sol +++ b/contracts/receivers/aave-v2-receiver/main.sol @@ -79,6 +79,8 @@ contract MigrateResolver is Helpers, Events { _amt = maxAmt; } + deposits[msg.sender][_token] = sub(maxAmt, _amt); + if (_token == maticAddr) { TokenInterface _tokenContract = TokenInterface(wmaticAddr); uint _maticBal = address(this).balance; @@ -98,8 +100,6 @@ contract MigrateResolver is Helpers, Events { } _amts[i] = _amt; - - deposits[msg.sender][_token] = sub(maxAmt, _amt); } isPositionSafe(); diff --git a/contracts/senders/aave-v2-migrator/main.sol b/contracts/senders/aave-v2-migrator/main.sol index db9ef65..2330e8b 100644 --- a/contracts/senders/aave-v2-migrator/main.sol +++ b/contracts/senders/aave-v2-migrator/main.sol @@ -95,6 +95,8 @@ contract LiquidityResolver is Helpers, Events { _amt = maxAmt; } + deposits[msg.sender][_token] = sub(maxAmt, _amt); + // TODO: @everyone check this throughly. Saving 1000 WEI for flashloan WETH. Also, should we make a different contract to handle 2 WEI dydx gas, I think this would be better. if (_token == ethAddr) { TokenInterface _tokenContract = TokenInterface(wethAddr); @@ -115,8 +117,6 @@ contract LiquidityResolver is Helpers, Events { } _amts[i] = _amt; - - deposits[msg.sender][_token] = sub(maxAmt, _amt); } isPositionSafe();