Skip to main content

Offers V1.0

Make an offer on any NFT#

The Offers Module allows a user to create an offer on any ERC-721 token in either ETH or an ERC-20 token. You can view all of the Offers V1.0 Module contract code in this GitHub Repo.

Contract Addresses#

Mainnet Deployments#


NetworkAddress
Ethereum - 10x76744367ae5a056381868f716bdf0b13ae1aeaa3

Testnet Deployments#


NetworkAddress
Rinkeby - 40x1240ef9f9c56ee981d10cffc6ba5807b6c7fecaa

Offer Structure#

  • maker: The address that created the offer
  • currency: The address of the ERC-20 offered, or address(0) for ETH
  • findersFeeBps: The fee to the referrer of the offer in basis points
  • amount: The amount of ETH/ERC-20 tokens offered
struct Offer {    address maker;    address currency;    uint16 findersFeeBps;    uint256 amount;}

Finders Fee#

The Finders Fee is the amount offered to the party that helped match the buyer to the NFT. For example, a user fills an offer for an NFT they would like to purchase. If a finders fee was specified, then the interface that helped match the NFT to the buyer could be entitled to that amount. Note that the Finders Fee is only charged if a buyer fills the offer on an NFT.


Storage#

offers#

Returns the metadata for an offer.
ERC-721 Token Address => ERC-721 tokenID => offerID => Offer

mapping(address => mapping(uint256 => mapping(uint256 => Offer))) public offers

offersForNFT#

Returns an array of offerIds for a specific ERC-721 token.
ERC-721 tokenAddress => ERC-721 tokenID => Offer IDs

mapping(address => mapping(uint256 => uint256[])) public offersForNFT

Functions#

createOffer#

Creates an offer for a specific NFT which can be made in either ETH or an ERC-20 token and returns the offerId of the newly created offer.

  • ZORA takes custody of the amount until either the offer is filled or canceled
  • The user must first approve the ERC-20 Transfer Helper if the offer currency is an ERC-20 token
  • No approvals are needed if the offer currency is ETH
function createOffer(    address _tokenContract,    uint256 _tokenId,    address _currency, //ERC-20 token address or address(0) for ETH    uint256 _amount,    uint16 _findersFeeBps) returns (uint256)

fillOffer#

Fills a given offer for an owned NFT, in exchange for ETH/ERC-20 tokens.

  • finder: The address of the party that helped match the offer to the buyer
  • The finder can be set to address(0) if no address is known
function fillOffer(    address _tokenContract,    uint256 _tokenId,    uint256 _offerId,    address _currency,    uint256 _amount,    address _finder)

setOfferAmount#

Updates either the price, currency, or both for a given offer.

  • Increasing the amount requires that the user provide more collateral
  • Decreasing the amount will refund the difference back to the offer maker address
  • Updating the currency to an ERC-20 will require that the user approve the ERC-20 Transfer Helper if they haven't already approved that token.
function setOfferAmount(    address _tokenContract,    uint256 _tokenId,    uint256 _offerId,    address _currency,    uint256 _amount)

cancelOffer#

Cancels and refunds the given offer.

function cancelOffer(    address _tokenContract,    uint256 _tokenId,    uint256 _offerId)

All the source code for the Offers V1.0 contract can be found here.