NFT transferring won’t work because of the external call to removeDelegation .
The NFT transfer function calls an external function that changes the sender to the contract address, causing an ownership check to fail and the transfer to revert. This means users cannot transfer their delegation NFTs.
Originally disclosed on Code4rena
Submitted by CertoraInc, also found by 0xA5DF, 0xsanson, Bahurum, carlitox477, cryptphi, GalloDaSballo, kenzo, MEP, and TrungOre
The VoteEscrowDelegation._transferFrom function won’t work because it calls this.removeDelegation(_tokenId). The removeDelegation function is external, so when the call is done by this.removeDelegation(_tokenId) msg.sender changes to the contract address.
This causes the check in the `` function to (most likely) fail because the contract is not the owner of the NFT, and that will make the function revert.
require(ownerOf(tokenId) == msg.sender, 'VEDelegation: Not allowed');
Recommended Mitigation Steps
Make the removeDelegation function public and call it without changing the context (i.e. without changing msg.sender to the contract’s address).
Fixed.
Ref: https://github.com/golom-protocol/contracts/commit/10ec920765a5ee2afc2fe269d32ea9138d1156b6
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the use of an external self-call (`this.removeDelegation`) changes msg.sender to the contract address, breaking an ownership check.
Impact
Users cannot transfer their delegation NFTs because the transfer function reverts.
What the attacker needed
None
The fix
The removeDelegation function should be made public and called without changing the context, so msg.sender remains the original caller.
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 report has not been written yet. The Original tab links to the source.
When a smart contract calls one of its own functions using 'this', the call is treated as coming from the contract itself, not the original user. Here, a check that the caller owns the NFT then fails, so the transfer always fails. This is a bug that blocks a basic feature.
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.