Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Invalid

No royaltyFee slippage check in Swan::list and Swan::reList

Summary

The List and reLIst functions are vulnerable to frontrunning

Vulnerability Details

The owner of the buyer contract could frontrun the call to list and increase the royaltyFee of the contract
if the Swan contract has enough allowance, it could transfer the tokens to itself and the buyer
https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/Swan.sol#L188

https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/Swan.sol#L258-L272

The royalty fee is a percent of the price, so the seller could end up paying a higher percentage fee, assuming they have already given the swan contract allowance

Impact

Sellers could end up paying more than expected in royalty fees

Tools Used

manual analysis

Recommendations

the sender should submit a maxRoyaltyFee with the cal

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.