Zero Knowledge
Search…
Buy Now
A user which owns an NFT can set a "buy now" price for their NFT using zAuction. This will allow buyers to immediately purchase the NFT at the set price. Upon purchase of the NFT using this method, the ERC-20 tokens are transferred to the seller and the NFT is transferred to the buyer.
The seller of the NFT can change the "buy now" price at any time. Setting the price to 0 will make it so that the NFT can no longer be purchased via "buy now."
If the seller changes the price of the NFT while a buyer is attempting to buy an NFT, whichever transaction gets processed last will fail.

Buy Now Flow

  • Seller must approve the zAuction contract to transfer NFT's on their behalf
  • Seller calls setBuyPrice with the price and token which they want to sell
  • Buyer calls buyNow to purchase the token

Contract Interactions

Set Buy Now Price

setBuyPrice(uint256 amount, uint256 tokenId)
Setting amount to zero will disable "buy now"
Arguments
Descriptions
uint256 amount
The price to sell the token for
uint256 tokenId
Token ID of the NFT

Buy Now

buyNow(uint256 amount, uint256 tokenId)
If the amount is different than the "buy price" set by the seller, the transaction will fail.
Arguments
Descriptions
uint256 amount
The price to sell the token for
uint256 tokenId
Token ID of the NFT