mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
fix: convert isEth and Weth to isMatic and Wmatic
This commit is contained in:
parent
220e826e01
commit
b8aab9db5a
|
@ -40,12 +40,12 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
|
|||
PrizePoolInterface prizePoolContract = PrizePoolInterface(prizePool);
|
||||
address prizePoolToken = prizePoolContract.token();
|
||||
|
||||
bool isEth = prizePoolToken == wethAddr;
|
||||
bool isMatic = prizePoolToken == wmaticAddr;
|
||||
TokenInterface tokenContract = TokenInterface(prizePoolToken);
|
||||
|
||||
if (isEth) {
|
||||
if (isMatic) {
|
||||
_amount = _amount == uint256(-1) ? address(this).balance : _amount;
|
||||
convertEthToWeth(isEth, tokenContract, _amount);
|
||||
convertMaticToWmatic(isMatic, tokenContract, _amount);
|
||||
} else {
|
||||
_amount = _amount == uint256(-1) ? tokenContract.balanceOf(address(this)) : _amount;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
|
|||
|
||||
_amount = _amount - exitFee;
|
||||
|
||||
convertWethToEth(prizePoolToken == wethAddr, tokenContract, _amount);
|
||||
convertWmaticToMatic(prizePoolToken == wmaticAddr, tokenContract, _amount);
|
||||
|
||||
setUint(setId, _amount);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user