Fix: Use return values _podShare and _tokenAmount from depositTo and withdraw in setUint()

This commit is contained in:
eccheung4 2021-09-02 23:05:34 -07:00
parent 0518a123fe
commit a8a7dd48d0
2 changed files with 10 additions and 10 deletions

View File

@ -7,6 +7,6 @@ contract Events {
event LogWithdrawInstantlyFrom(address prizePool, address from, uint256 amount, address controlledToken, uint256 maximumExitFee, uint256 getId, uint256 setId);
event LogClaim(address tokenFaucet, address user, uint256 claimed, uint256 setId);
event LogClaimAll(address tokenFaucetProxyFactory, address user, TokenFaucetInterface[] tokenFaucets);
event LogDepositToPod(address prizePoolToken, address pod, address to, uint256 amount, uint256 getId, uint256 setId);
event LogWithdrawFromPod(address pod, uint256 shareAmount, uint256 maxFee, uint256 getId, uint256 setId);
event LogDepositToPod(address prizePoolToken, address pod, address to, uint256 amount, uint256 podShare, uint256 getId, uint256 setId);
event LogWithdrawFromPod(address pod, uint256 shareAmount, uint256 tokenAmount, uint256 maxFee, uint256 getId, uint256 setId);
}

View File

@ -149,12 +149,12 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
_tokenAmount = _tokenAmount == uint256(-1) ? tokenContract.balanceOf(address(this)) : _tokenAmount;
tokenContract.approve(pod, _tokenAmount);
podContract.depositTo(address(this), _tokenAmount);
uint256 _podShare = podContract.depositTo(address(this), _tokenAmount);
setUint(setId, _tokenAmount);
setUint(setId, _podShare);
_eventName = "LogDepositToPod(address,address,address,uint256,uint256, uint256)";
_eventParam = abi.encode(address(prizePoolToken), address(pod), address(this), _tokenAmount, getId, setId);
_eventName = "LogDepositToPod(address,address,address,uint256,uint256,uint256,uint256)";
_eventParam = abi.encode(address(prizePoolToken), address(pod), address(this), _tokenAmount, _podShare, getId, setId);
}
/**
@ -180,12 +180,12 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
PodInterface podContract = PodInterface(pod);
_shareAmount = _shareAmount == uint256(-1) ? podContract.balanceOf(address(this)) : _shareAmount;
podContract.withdraw(_shareAmount, maxFee);
uint256 _tokenAmount = podContract.withdraw(_shareAmount, maxFee);
setUint(setId, _shareAmount);
setUint(setId, _tokenAmount);
_eventName = "LogWithdrawFromPod(address,uint256,uint256,uint256,uint256)";
_eventParam = abi.encode(address(pod), _shareAmount, maxFee, getId, setId);
_eventName = "LogWithdrawFromPod(address,uint256,uint256,uint256,uint256,uint256)";
_eventParam = abi.encode(address(pod), _shareAmount, _tokenAmount, maxFee, getId, setId);
}
}