updated reentracy attack chances

This commit is contained in:
Samyak Jain 2021-04-09 00:27:47 +05:30
parent 91b23303fc
commit d25a048fbd
3 changed files with 6 additions and 5 deletions

View File

@ -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
);
}
}

View File

@ -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();

View File

@ -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();