Skip to content

Conversation

mykcryptodev
Copy link
Contributor

Currently, only the auction creator can execute the payout of an auction. Since there is no logic in the contract that would send the funds anywhere other than the auction creator, we should allow anyone to execute this function.

This is useful for when the buyer wants to receive the NFT upon the end of an auction, the buyer has the option for the seller to be paid out in the same transaction.

It is especially useful because there doesn't seem to be a straight-forward way for a front-end dapp to know if the buyer has only closed the auction for themselves in which case the sdk's function for ("executeSale")[https://portal.thirdweb.com/typescript/sdk.englishauctions#executesale] will fail. By allowing anyone to close out the entire auction, dapps can show the "executeSale" button to all users and they will all be able to execute it.

mykcryptodev and others added 2 commits March 19, 2023 01:15
Currently, only the auction creator can execute the payout of an auction. Since there is no logic in the contract that would send the funds anywhere other than the auction creator, we should allow anyone to execute this function.

This is useful for when the buyer wants to receive the NFT upon the end of an auction, the buyer has the option for the seller to be paid out in the same transaction.

It is especially useful because there doesn't seem to be a straight-forward way for a front-end dapp to know if the buyer has only closed the auction for themselves in which case the sdk's function for ("executeSale")[https://portal.thirdweb.com/typescript/sdk.englishauctions#executesale] will fail. By allowing anyone to close out the entire auction, dapps can show the "executeSale" button to all users and they will all be able to execute it.
@nkrishang
Copy link
Contributor

Thanks @mykcryptodev, we'll be merging the PR shortly.

@nkrishang
Copy link
Contributor

@mykcryptodev Could you make the following change:

Right now, you've edited nonReentrant onlyAuctionCreator(_auctionId) to nonReentrant(_auctionId). This is incorrect, since the (_auctionId) argument is meant for the onlyAuctionCreator modifier, and nonReentrant doesn't take any arguments.

The right edit would be nonReentrant onlyAuctionCreator(_auctionId) to just nonReentrant

@mykcryptodev
Copy link
Contributor Author

@nkrishang good catch! Thank you for considering the change ❤️

@nkrishang nkrishang merged commit 0d44311 into thirdweb-dev:main Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants