30694 - [SC - Low] Users approved for a single token id cannot wit...
Last updated
Was this helpful?
Last updated
Was this helpful?
Submitted on May 5th 2024 at 00:02:52 UTC by @imsrybr0 for
Report ID: #30694
Report type: Smart Contract
Report severity: Low
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol
Impacts:
Contract fails to deliver promised returns, but doesn't lose value
Users approved for a single token id cannot withdraw
or merge
for that token id.
Both withdraw
and merge
check if the msg.sender
is owner of the given token id or is approved to use it (either for all tokens from the same owner of specifically the one being used).
They will also burn
the token after carrying on their logic and clear its approvals.
Approvals are cleared using approve(address(0), _tokenId)
which will fail if a msg.sender
is only approved for that token id specifically.
User approved for a single token cannot withdraw
or merge
.
Users need to give permission for all their tokens to another user when they want that user to carry withdraw
or merge
operations for them.
Use the _clearApproval(owner, _tokenId)
to clear the approvals in the _burn
function.
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L741-L775
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L618-L651
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L826-L832
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L501-L514
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L1558-L1574