Closed sherlock-admin closed 1 year ago
It's not only financial value that the winning agent carries, but also clout value. So even after the prize is claimed, it should still be tradeable as some people like to collect NFTs that has specific "historical" significance, e.g. an NFT that won a game such as this one.
Agree with sponsor. In my opinion, it is users discretion for trusting a seller to buy a agent that has not claimed the grand prize yet, so it has nothing to do with protocol logic.
Like sponsor mentioned, transfers should still be allowed since NFTs still carry monetary value, so if you prevent transferring or burn users agent just because they won the grand prize, you are essentially causing a potential loss of funds for them.
@0xhiroshi @nevillehuang
Thanks for your consideration!
I totally agree with the feedback raised here, although I'm still inclined to concede that requiring users to have the discretion to trust the seller is ripe for exploitation. Escalations aside, may I recommend that the victorious agent holder be awarded a separate transferrable token on recognition of their achievement i.e. a trophy?
This way you can eliminate the possibility of frontrunning and still ensure the user's clout is retained.
cawfree
medium
The winning agent continues to be transferrable even after the grand prize has been claimed.
Summary
The winning agent carries substantial financial value, which would be attractive on secondary marketplaces.
However, even after claiming the grand prize, the winner continues to be transferrable, meaning sales could be frontrun by a malicious victor in order to procure both the grand prize and the sale value.
Vulnerability Detail
The
transferFrom
function inherited fromERC721A
was specifically overrided to prevent transfers of agents whose status is not one ofActive
orWounded
.From the sponsor in the Sherlock Discord:
All secondary prizes are awarded to dead agents which have no risk of being traded, which is consistent with this logic. However, the winning agent may still continue to be traded even after withdrawing the prize, meaning transactions wishing to purchase the winning agent on a secondary marketplace could be frontrun by a malicious victor:
Yields the following console output:
This sequence of operations indeed proves that
Infiltration
's protections against sales frontrunning do not apply to the victorious agent, which is inconsistent with the remainder of the protection logic.This issue arises from the fact that the victor is the last agent remaining
Active
(and therefore transferrable), though other positions carrying financial value are not transferrable because they have beenKilled
.Impact
Trade safety of the winning agent on secondary marketplaces is not offered the necessary protections that are applied to secondary prizewinners or agents-in-play.
Code Snippet
Tool used
Manual Review, Visual Studio Code, Discord
Recommendation
Once the grand prize has been claimed, the winning agent should be
Killed
in order to prevent future transfers.Please note, this issue also applies (though in slightly lesser extent) to the winning agent's ability to withdraw a secondary prize - ideally the outstanding prizes should be settled atomically for the winning agent. This would also improve user experience by reducing the required number of transactions.