func Approve
crossing ActionApprove grants permission to transfer a specific token ID to another address.
Parameters:
- approved: address to approve
- tid: token ID to approve for transfer
Returns error if approval fails.
Package gnft implements GRC721-compliant NFTs for GnoSwap LP positions.
Package gnft implements GRC721-compliant NFTs for GnoSwap LP positions.
Each LP position in GnoSwap is represented as a unique NFT with dynamically generated SVG artwork. The contract manages ownership, transfers, and visual representation of positions while minimizing storage costs.
Approve grants permission to transfer a specific token ID to another address.
Parameters:
Returns error if approval fails.
BalanceOf returns the number of NFTs owned by the specified address.
Burn removes a specific token ID.
Parameters:
Only callable by position.
Exists checks if token ID exists.
IsApprovedForAll checks if operator can manage all owner's tokens.
Parameters:
Returns true if operator is approved for all owner's tokens.
Mint creates new NFT and transfers to address.
Parameters:
Returns minted token ID. Only callable by position contract.
Name returns the NFT collection name.
Render returns the HTML representation of the NFT.
SafeTransferFrom transfers token ownership with receiver validation.
Parameters:
Returns error if transfer fails.
Permission model:
SetApprovalForAll enables/disables operator approval for all tokens.
Parameters:
Returns error if operation fails.
SetTokenURI sets the metadata URI for the specified token.
Parameters:
Only callable by position contract.
Symbol returns the NFT symbol.
TokenURI returns the metadata URI for the specified token ID. If stored value is in parameter format (x1,y1,x2,y2,color1,color2), it converts to full base64-encoded SVG image URI on read.
TotalSupply returns the total number of NFTs minted.
TransferFrom transfers a token from one address to another.
Parameters:
Returns error if transfer fails.
Permission model: