withdraw token interface repeating fixed

This commit is contained in:
Samyak Jain 2020-05-23 23:48:01 +10:00
parent eb62198a10
commit 4feda4a6cb

View File

@ -128,10 +128,11 @@ contract BasicResolver is AaveHelpers {
uint _amt = getUint(getId, amt);
AaveCoreInterface aaveCore = AaveCoreInterface(getAaveCoreAddress());
ATokenInterface atoken = ATokenInterface(aaveCore.getReserveATokenAddress(token));
TokenInterface tokenContract = TokenInterface(token);
uint initialBal = token == getEthAddr() ? address(this).balance : TokenInterface(token).balanceOf(address(this));
uint initialBal = token == getEthAddr() ? address(this).balance : tokenContract.balanceOf(address(this));
atoken.redeem(_amt);
uint finalBal = token == getEthAddr() ? address(this).balance : TokenInterface(token).balanceOf(address(this));
uint finalBal = token == getEthAddr() ? address(this).balance : tokenContract.balanceOf(address(this));
_amt = sub(finalBal, initialBal);
setUint(setId, _amt);