mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
withdraw token interface repeating fixed
This commit is contained in:
parent
eb62198a10
commit
4feda4a6cb
|
@ -128,10 +128,11 @@ contract BasicResolver is AaveHelpers {
|
||||||
uint _amt = getUint(getId, amt);
|
uint _amt = getUint(getId, amt);
|
||||||
AaveCoreInterface aaveCore = AaveCoreInterface(getAaveCoreAddress());
|
AaveCoreInterface aaveCore = AaveCoreInterface(getAaveCoreAddress());
|
||||||
ATokenInterface atoken = ATokenInterface(aaveCore.getReserveATokenAddress(token));
|
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);
|
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);
|
_amt = sub(finalBal, initialBal);
|
||||||
setUint(setId, _amt);
|
setUint(setId, _amt);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user