mVeNFT can't trigger the vote function for one epoch #9
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-21
🤖_09_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2024-09-fenix-finance/blob/main/contracts/core/VoterUpgradeableV2.sol#L553-L565
Vulnerability details
Description
The protocol has the Attach feature that lets the users delegate their voting power to mVeNFT (Managed Voting NFT) which will manage voting and reward collection without requiring the user’s active participation.
Note the mVeNFT is owned by a managed (strategy) contract e.g,
CompoundVeFNXManagedNFTStrategyUpgradeable
Users can attach a veNFT to a mVeNFT using
VoterUpgradeableV2.sol#attachToManagedNFT()
and to detache callsVoterUpgradeableV2.sol#dettachFromManagedNFT()
In case the last owner veNFT in mVeNFT triggers
dettachFromManagedNFT()
.It will enter this IF block
So, the reset function will delete all the voting weight values of the mVeNFT and its
lastVotedTimestamps[]
Now, after time a new user calls
attachToManagedNFT()
which sub-call to
_poke()
. even if the voting weight of mVeNFT is still empty.the poke will sub-call to update the value of
lastVotedTimestamps[]
to the current time.This will leave the mVeNFT with zero votes in the current epoch (it is not able to call the vote function due to
_checkVoteDelay()
)Impact
The mVeNFT can't trigger the vote function for one epoch, the user(s) end up with zero rewards in this epoch
Tools Used
Manual Review
Recommended Mitigation Steps
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: