31272 - [SC - Low] Approved user cant merge tokens not approved fo...
Last updated
Was this helpful?
Last updated
Was this helpful?
Submitted on May 16th 2024 at 01:14:43 UTC by @OxAlix2 for
Report ID: #31272
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
To merge 2 tokens into 2, a user must be either approved or owner of both tokens. This is obvious in the following checks in VotingEscrow::merge
:
It also calls _burn
which clears the approval of the "from" token, however, it's clearing it wrong as it calls approve(address(0), _tokenId);
, which checks if the caller is the owner or approved for all, it doesn't allow "regular" approved users (which makes sense).
This blocks approved users (not for all) from merging 2 tokens, as the TX will revert in approve
, which is not intended. The protocol should use _clearApproval(owner, _tokenId);
instead.
Approved users (not for all) aren't able to merge tokens.
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L1567