AthenaCoverToken
Last updated
Was this helpful?
Last updated
Was this helpful?
The AthenaCoverToken contract is a slightly modified ERC-721 token representing a cover in the Athena protocol. The contract includes the ERC721Enumerable extension, which adds enumerability of all the token IDs in the contract as well as all token IDs owned by each account. An additional Athena-specific method, , is also included to easily retrieve all the token IDs owned by an account.
The base URI for the token metadata. The metadata does NOT include the cover's parameters. To retrieve the cover's parameters, use the LiquidityManager contract's function.
The ID of the next cover to be minted.
Returns the token collection name.
Returns the token collection symbol.
Returns the Uniform Resource Identifier (URI) for tokenId
token.
Returns the number of tokens in owner
's account.
Returns the owner of the tokenId
token.
Requirements:
tokenId
must exist.
Returns the account approved for tokenId
token.
Requirements:
tokenId
must exist.
Returns if the operator
is allowed to manage all of the assets of owner
.
See {setApprovalForAll}
Returns the total amount of tokens stored by the contract.
Returns a token ID owned by owner
at a given index
of its token list. Use along with {balanceOf} to enumerate all of owner
's tokens.
Returns a token ID at a given index
of all the tokens stored by the contract. Use along with {totalSupply} to enumerate all tokens.
Returns the token IDs owned by an account
Parameters:
account_
address
The account to query
Return values:
tokens
uint256[]
The token IDs owned by the account
Safely transfers tokenId
token from from
to to
.
Requirements:
from
cannot be the zero address.
to
cannot be the zero address.
tokenId
token must exist and be owned by from
.
If the caller is not from
, it must be approved to move this token by either {approve} or {setApprovalForAll}.
If to
refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
Emits a {Transfer} event.
Transfers tokenId
token from from
to to
.
WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must understand this adds an external call which potentially creates a re-entrancy vulnerability.
Requirements:
from
cannot be the zero address.
to
cannot be the zero address.
tokenId
token must be owned by from
.
If the caller is not from
, it must be approved to move this token by either {approve} or {setApprovalForAll}.
Emits a {Transfer} event.
Gives permission to to
to transfer tokenId
token to another account. The approval is cleared when the token is transferred.
Only a single account can be approved at a time, so approving the zero address clears previous approvals.
Requirements:
The caller must own the token or be an approved operator.
tokenId
must exist.
Emits an {Approval} event.
Approve or remove operator
as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
Requirements:
The operator
cannot be the address zero.
Emits an {ApprovalForAll} event.
Emitted when tokenId
token is transferred from from
to to
.
Emitted when owner
enables approved
to manage the tokenId
token.
Emitted when owner
enables or disables (approved
) operator
to manage all of its assets.