Fix: use token address instead of prizePool address in depositToPod()

This commit is contained in:
eccheung4 2021-09-02 22:57:08 -07:00
parent ac504364d9
commit 0518a123fe
3 changed files with 6 additions and 9 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 prizePool, address pod, address to, uint256 amount, uint256 getId, uint256 setId);
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);
}

View File

@ -127,14 +127,14 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
/**
* @dev Deposit into Pod
* @notice Deposit assets into the Pod in exchange for share tokens
* @param prizePool PrizePool address to deposit to
* @param prizePoolToken Prize Pool Token Address
* @param pod Pod address to deposit to
* @param tokenAmount The amount of tokens to deposit. These are the same tokens used to deposit into the underlying prize pool.
* @param getId Get token amount at this ID from `InstaMemory` Contract.
* @param setId Set token amount at this ID in `InstaMemory` Contract.
*/
function depositToPod(
address prizePool,
address prizePoolToken,
address pod,
uint256 tokenAmount,
uint256 getId,
@ -142,9 +142,6 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
) external payable returns ( string memory _eventName, bytes memory _eventParam) {
uint _tokenAmount= getUint(getId, tokenAmount);
PrizePoolInterface prizePoolContract = PrizePoolInterface(prizePool);
address prizePoolToken = prizePoolContract.token();
PodInterface podContract = PodInterface(pod);
// Approve pod
@ -157,7 +154,7 @@ abstract contract PoolTogetherResolver is Events, DSMath, Basic {
setUint(setId, _tokenAmount);
_eventName = "LogDepositToPod(address,address,address,uint256,uint256, uint256)";
_eventParam = abi.encode(address(prizePool), address(pod), address(this), _tokenAmount, getId, setId);
_eventParam = abi.encode(address(prizePoolToken), address(pod), address(this), _tokenAmount, getId, setId);
}
/**

View File

@ -344,7 +344,7 @@ describe("PoolTogether", function () {
{
connector: ptConnectorName,
method: "depositToPod",
args: [DAI_PRIZE_POOL_ADDR, DAI_POD_ADDR, amount, 0, 0]
args: [DAI_TOKEN_ADDR, DAI_POD_ADDR, amount, 0, 0]
}
]
@ -433,7 +433,7 @@ describe("PoolTogether", function () {
{
connector: ptConnectorName,
method: "depositToPod",
args: [DAI_PRIZE_POOL_ADDR, DAI_POD_ADDR, amount, 0, 0]
args: [DAI_TOKEN_ADDR, DAI_POD_ADDR, amount, 0, 0]
},
{
connector: ptConnectorName,