Submitted by cccz
In the depositBribeERC20() function of the TokemakBribe contract, the briber can specify a proposal, and then call the depositBribeERC20 function of the bribeVault contract to deposit the reward.
But in the depositBribeERC20 function of the bribeVault contract, the address with DEPOSITOR_ROLE can transfer the bribers approved ERC20 tokens to bribeVault by specifying any bribeIdentifier and rewardIdentifier via safeTransferFrom.
DEPOSITOR_ROLE can be granted by the deployer of BribeVault.
BribeVault.sol#L164-L205
The depositBribeERC20 function of the TokemakBribe contract needs to first transfer the bribers tokens to the TokemakBribe contract, and then transfer the tokens to the bribeVault contract in the depositBribeERC20 function of the bribeVault contract. Make sure the first parameter of safeTransferFrom is msg.sender.
TokemakBribe.depositBribeERC20()
bribeVault.depositBribeERC20()
kphed (Redacted Cartel) disputed and commented:
Alex the Entreprenerd (judge) commented:
