[web3] The Bug that CodeArena Missed , Twice - zzykxx's blog
The claim function in the rewards distributor tries to lock newly calculated rewards back into the same veNFT, but the deposit function rejects any veNFT whose lock has already expired. As a result, holders of expired veNFTs cannot claim their earned rewards, leaving them frozen.
zzykxx.com
Published on zzykxx.com
Right after joining trust90 mentorship I was asked to do some research on Thena, an AMM exchange that combines Uniswap, Curve and OlympusDAO wizardry.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the claim path unconditionally calls deposit_for on the same veNFT, but deposit_for requires the lock to be unexpired, so expired veNFTs can never claim.
What the attacker needed
A veNFT whose lock period has expired; earned rewards to claim
How it was found
- A user locks tokens for a chosen period and receives a veNFT.
- The user waits until the lock period has passed, so the veNFT is expired.
- The user calls claim on the rewards distributor for that veNFT.
- The claim calculates the reward and calls deposit_for on the same veNFT.
- The deposit_for check rejects the expired lock, so the claim reverts and the reward is not paid.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A veNFT is a token that records how many tokens someone locked up and until when. When the lock period ends, the reward-claiming code still tries to add the reward back into that same expired lock, and a safety check refuses to touch expired locks, so the claim fails and the reward stays stuck.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.