fix: convert isEth and Weth to isMatic and Wmatic

This commit is contained in:
eccheung4 2021-09-29 08:22:42 -07:00
parent 220e826e01
commit b8aab9db5a

View File

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