Offers V1.0
#
Make an offer on any NFTThe 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 DeploymentsNetwork | Address |
---|---|
Ethereum - 1 | 0x76744367ae5a056381868f716bdf0b13ae1aeaa3 |
#
Testnet DeploymentsNetwork | Address |
---|---|
Goerli - 5 | 0x3a98377E8e67D01a3D21E30eCE6A4703eeB4d25a |
#
Offer Structuremaker
: The address that created theoffer
currency
: The address of the ERC-20 offered, oraddress(0)
for ETHfindersFeeBps
: The fee to the referrer of the offer in basis pointsamount
: The amount of ETH/ERC-20 tokens offered
struct Offer { address maker; address currency; uint16 findersFeeBps; uint256 amount;}
#
Finders FeeThe 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#
offersReturns the metadata for an offer
.
ERC-721 Token Address => ERC-721 tokenID => offerID => Offer
mapping(address => mapping(uint256 => mapping(uint256 => Offer))) public offers
#
offersForNFTReturns 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#
createOfferCreates 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)
#
fillOfferFills 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 toaddress(0)
if no address is known
function fillOffer( address _tokenContract, uint256 _tokenId, uint256 _offerId, address _currency, uint256 _amount, address _finder)
#
setOfferAmountUpdates 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)
#
cancelOfferCancels 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.