In VE3DRewardPool it's not possible to remove rewardTokens and if there were one bad rewardToken (by mistake or token related contract chaning) then no one can withdraw any rewards from VE3DRewardPool #179
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VE3DRewardPool.sol#L102-L112
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VE3DRewardPool.sol#L275-L321
Vulnerability details
Impact
contract
VE3DRewardPool
distributes reward tokens to stakers but ifowner
by mistake add wrong info for one of reward tokens or some of related contract to one of reward tokens changes or became broken then no one an callgetReward()
and get withdraw any rewards from contract and contracts will become useless because there is no mechanism to change one reward token info or delete it and it's not possible to get one or subset of reward tokens rewards.Proof of Concept
This is
addReward()
function code which add multiple related contract address for one token:This is
getReward()
function code:As you can see it loops through all reward tokens and make some external contract calls for reward token related contract address. so if
owner
setveAssetDeposits
orrewardToken
orve3Token
address by mistake or their contract was broken or in shutdown state then the contract calls will fails for that reward token and whole transaction will fail and no one can withdraw rewards and rewards will be lost forever because there is no mechanism to change one reward token info or just callgetReward()
for subset of reward tokens.Tools Used
VIM
Recommended Mitigation Steps
add some mechanism to change one reward token info or delete it or call
getReward()
for subset of reward tokens.The text was updated successfully, but these errors were encountered: