A malicous user can create a high value asset and list to r a buyer and then revoke the swan contract approval to transfer the token Id to the buyer in turn denying every other lister a chance to earn from the purchase in that round.
This could also be a malicous owner who could create a high value asset and list it to himself with another address. Then revoke approval for the token Id. In order to gain all the listing fees from listers without eventually having to make a purchase from the round due to the lack of approval during the transfer of the asset.
This could be another user but I'm using a malicious buyer as an example because he stands to gain all the lsiting fees without actually making a purchase.
When a malicious buyer list a high value created asset to himself. Other sellers list to the buyer as well, the buyer earns royalties from these listers. Now the buyers asset being a high value asset is picked as one of the assets returned to be purchased when the oraclePurchaseRequest
function is called, task is completed and output returned.
Before or as soon as the oraclePurchaseRequest is in progress, the malicous buyer then revokes the approval of the Swan
for the tokenId that was set on the asset creation, the buyer does this using the setApprovalForAll
function in the asset, being an ERC721.
Here is where the approval was set for the SwanAsset
for all the tokens. The owner can eventually revoke this approval with the setApprovalForAll
with a false value at any time after the assets creation.
Once this approval has been revoked and the high value asset the malicious owner listed to himself makes it to the encoded addresses array output. The purchase
function would always revert in the buyerAgent. This is because the purchase function loops through all the assets that are to be bought and the Swan contract performs a transferFrom on those assets to the buyer agent. See code below in the buyerAgent
The transferFrom would revert when it gets to the high value asset because it no longer has the approval it requires to make the transfer due to the malicous owners high value asset that was revoked being a part of the asset. See code below in the Swan contract
The malicous owner get all the royalties paid by all the listers to him but does not make a single purchase of any listed items whether its called by the oracle or the owner themselves, the purchase function would simply revert.
Instead of using approvals that can be revoked at any time, transfer and store the assets in the contract on listing and attach them to owner providing a way for the owner to be able to withdraw the asset if its not sold. That way the contract has full control of the listed asset
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.