Skip to content

Smart contract

Gian Luca Rivera edited this page Nov 6, 2022 · 1 revision

Vesta

Provides the necessary functions to generate an NFT with metadata

Inherits ERC721, ERC721Enumerable from OpenZeppelin and VestaDNA.sol

_tokenIdCounter

struct Counters.Counter _tokenIdCounter

constructor

constructor() public

mint

function mint() public returns (uint256)

Function in charge of creating a new token, new tokenId

Return Values

Name Type Description
[0] uint256 unique token identification

boolToString

function boolToString(bool _b) public pure returns (string)

Convierte un bool a string

Inherits ERC721, ERC721Enumerable from OpenZeppelin and VestaDNA.sol

Parameters

Name Type Description
_b bool booleano

Return Values

Name Type Description
[0] string Yes or No

tokenURI

function tokenURI(uint256 tokenId) public view returns (string)

Returns a url in standard Data URL with the metadata that makes up the NFT encoded in base64

Parameters

Name Type Description
tokenId uint256 unique token identification

Return Values

Name Type Description
[0] string Data URL (data:application/json;base64,...)

_beforeTokenTransfer

function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal

Enumerable methods to list the tokens a user owns (Overrides required by solidity), transfer a token

Parameters

Name Type Description
from address origin
to address destination
tokenId uint256 unique token identification

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

States that in addition to being 721 it is enumerable

Parameters

Name Type Description
interfaceId bytes4 unique interface identification

Return Values

Name Type Description
[0] bool override support interface