This contract is a media value system. it interacts with ZapMarket and the AuctionHouse contracts to provide a perpetual equity to its creators. This contract allows for the minting, burning, and transferral of ERC721 tokens utilizing a market owned by the creator.
Require that the token has not been burned and has been minted
Arguments | Type | Description |
---|---|---|
tokenId |
uint256 |
The Identifier for a specific ERC721 |
Require that the token has had a content hash set
Arguments | Type | Description |
---|---|---|
tokenId |
uint256 |
The Identifier for a specific ERC721 |
Require that the token has had a metadata hash set
Arguments | Type | Description |
---|---|---|
tokenId |
uint256 |
The Identifier for a specific ERC721 |
Ensure that the provided spendder is approved or the owner of the media for the specified tokenID
Arguments | Type | Description |
---|---|---|
spender |
address |
Usually the msg.sender address; whoever is spending for the specific transaction |
tokenId |
uint256 |
The Identifier for a specific ERC721 |
Ensure that the ttoken has been created, even if it had been burned
Arguments | Type | Description |
---|---|---|
tokenId |
uint256 |
The Identifier for a specific ERC721 |
Ensure that the provided URI is not empty
Arguments | Type | Description |
---|---|---|
uri |
string memory |
Uniform Resource Identifier to be validated |
Creates the initial ERC721, establishes the ZapMarket, and registers an interface based on the generated interface ID.
Arguments | Type | Description |
---|---|---|
name |
string calldata |
Name of the proposed media |
symbol |
string calldata |
Symbol for the proposed media |
marketContractAddr |
address |
Address of the relevant ZapMarket |
permissive |
bool |
Allows the creator to mint more media tokens |
_collectionMetadata |
string calldata |
Sets the public collection metadata |
Returns a boolean showing whether or not the given interfaceID is supported
Arguments | Type | Description |
---|---|---|
interfaceID |
bytes4 |
a bytes4 formatted representation of a contract interface. Id to be validated |
Returns the URI for a particular piece of media with the specified tokenID
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
Token whose URI is to be fetched |
Sets an interface ID to be supported
Arguments | Type | Description |
---|---|---|
interfaceID |
bytes4 |
Interface ID to be registered |
TokenTransfer hook function
Arguments | Type | Description |
---|---|---|
to |
address |
Current token owner. If this is the zero address, the token will be minted for to |
from |
address |
Destination Address. If this is the zero address, the token will be burned |
tokenID |
uint256 |
Token ID to be transferred |
Return the metadata URI for a piece of media given the token URI
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
the token whose metadata will be attached |
Mint new media for msg.sender.
Arguments | Type | Description |
---|---|---|
data |
MediaData memory |
The media's metadata and content data, includes content and metadata hash, and token's URI |
bidShares |
IMarket.BidShares memory |
The share percentages of the owners and creators of the media as determined by ZapMarket |
EIP-712 mintWithSig method. Mints new media for a creator given a valid signature.
Arguments | Type | Description |
---|---|---|
creator |
address |
Address of media creator |
data |
MediaData memory |
The media's metadata and content data, includes content and metadata hash, and token's URI |
bidShares |
IMarket.BidShares memory |
The share percentages of the owners and creators of the media as determined by ZapMarket |
sig |
EIP712Signature memory |
Creator's signature to be confirmed |
Transfer the token with the given ID to a given address.
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
Token to be transferred |
recipient |
address |
Address of token destination |
Set the ask on a piece of media
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token being offered an ask |
ask |
IMarket.Ask memory |
Value of ask to be set |
Remove the ask on a piece of media
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token determine which ask to remove |
Set the bid on a piece of media
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token whose metadata will be attached |
bid |
IMarket.Ask memory |
Value of bid to be set |
Remove the bid on a piece of media
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token whose bid is to be removed |
Accept the bid on a piece of media
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token whose bid is to be accepted |
bid |
IMarket.Ask memory |
Value of bid to be accepted |
Burn a token
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token to burn |
Revoke the approvals for a token. The provided approve
function is not sufficient for this protocol, as it does not allow an approved address to revoke it's own approval. In instances where a 3rd party is interacting on a user's behalf via permit
, they should revoke their approval once their task is complete as a best practice.
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token whose approval is to be revoked |
Update the token URI
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
The token whose URI is to be updated |
tokenURIlocal |
string calldata |
The URI to be updated |
Update the token metadata uri
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
the token whose metadata is to be updated |
metadataURI |
string calldata |
The metadata to be updated |
EIP-712 permit method. Sets an approved spender given a valid signature.
Arguments | Type | Description |
---|---|---|
spender |
address |
Spender address to be approved |
tokenID |
uint256 |
The token to be given an approved spender |
sig |
EIP712Signature |
Signature to confirm access |
Returns a bool depicting whether or not the i'th collaborator has shares
Arguments | Type | Description |
---|---|---|
index |
uint256 |
the i'th collaborator |
bidShares |
IMarket.BidShares memory |
The bidshares defined for the Collection's NFTs |
Creates a new token for creator
. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction.
Arguments | Type | Description |
---|---|---|
creator |
address |
Creator of media token |
data |
MediaData | The media's metadata and content data |
bidShares |
Imarket.BidShares |
The bidshares defined for the Collection's NFTs |
Setter for tokenContentHash
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
Token ID to set Content |
contentHash |
bytes32 | Content Hash to be assigned to token |
Setter for tokenMetadataHash
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
Token ID to set metadata |
metadataHash |
bytes32 |
Metadata to be assigned to token |
Setter for tokenMetadataURI
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
Token ID to set metadata URI |
metaDataURI |
bytes32 |
URI to be assigned to token |
Destroys tokenId
.
Arguments | Type | Description |
---|---|---|
tokenID |
uint256 |
ID of token to be burned |
transfer a token and remove the ask for it.
|Arguments| Type | Description|
|to
|address
| Current token owner.|
|from
|address
| Destination Address.|
|tokenID
|uint256
| Token ID to be transferred|
Calculates EIP712 DOMAIN_SEPARATOR based on the current contract and chain ID.
Arguments | Type | Description |
---|---|---|
No arguments |