Skip to content

IETSToken

Overview

License: MIT

interface IETSToken is IERC721Upgradeable

Structs info

Tag

struct Tag {
	address relayer;
	address creator;
	string display;
	bool premium;
	bool reserved;
}

Events info

TagMaxStringLengthSet

event TagMaxStringLengthSet(uint256 maxStringLength)

emitted when the maximum character length of CTAG display string is set.

Parameters:

NameTypeDescription
maxStringLengthuint256maximum character length of string.

TagMinStringLengthSet

event TagMinStringLengthSet(uint256 minStringLength)

emitted when the minimum character length of CTAG display string is set.

Parameters:

NameTypeDescription
minStringLengthuint256minimum character length of string.

OwnershipTermLengthSet

event OwnershipTermLengthSet(uint256 termLength)

emitted when the ownership term length of a CTAG is set.

Parameters:

NameTypeDescription
termLengthuint256Ownership term length in days.

ETSCoreSet

event ETSCoreSet(address ets)

emitted when the ETS core contract is set.

Parameters:

NameTypeDescription
etsaddressets core contract address.

AccessControlsSet

event AccessControlsSet(address etsAccessControls)

emitted when the ETS Access Controls is set.

Parameters:

NameTypeDescription
etsAccessControlsaddresscontract address access controls is set to.

PremiumTagPreSet

event PremiumTagPreSet(string tag, bool isPremium)

emitted when a tag string is flagged/unflagged as premium prior to minting.

Parameters:

NameTypeDescription
tagstringtag string being flagged.
isPremiumboolboolean true for premium/false not premium.

PremiumFlagSet

event PremiumFlagSet(uint256 tagId, bool isPremium)

emitted when a CTAG is flagged/unflagged as premium subsequent to minting.

Parameters:

NameTypeDescription
tagIduint256Id of CTAG token.
isPremiumboolboolean true for premium/false not premium.

ReservedFlagSet

event ReservedFlagSet(uint256 tagId, bool isReserved)

emitted when a CTAG is flagged/unflagged as reserved subsequent to minting.

Parameters:

NameTypeDescription
tagIduint256Id of CTAG token.
isReservedboolboolean true for reserved/false for not reserved.

TagRenewed

event TagRenewed(uint256 indexed tokenId, address indexed caller)

emitted when CTAG token is renewed.

Parameters:

NameTypeDescription
tokenIduint256Id of CTAG token.
calleraddressaddress of renewer.

TagRecycled

event TagRecycled(uint256 indexed tokenId, address indexed caller)

emitted when CTAG token is recycled back to ETS.

Parameters:

NameTypeDescription
tokenIduint256Id of CTAG token.
calleraddressaddress of recycler.

Functions info

setTagMaxStringLength (0x060defec)

function setTagMaxStringLength(uint256 _tagMaxStringLength) external

admin function to set maximum character length of CTAG display string.

Parameters:

NameTypeDescription
_tagMaxStringLengthuint256maximum character length of string.

setTagMinStringLength (0x86f57171)

function setTagMinStringLength(uint256 _tagMinStringLength) external

Admin function to set minimum character length of CTAG display string.

Parameters:

NameTypeDescription
_tagMinStringLengthuint256minimum character length of string.

setOwnershipTermLength (0xf66e7623)

function setOwnershipTermLength(uint256 _ownershipTermLength) external

Admin function to set the ownership term length of a CTAG is set.

Parameters:

NameTypeDescription
_ownershipTermLengthuint256Ownership term length in days.

preSetPremiumTags (0xa1de95e5)

function preSetPremiumTags(string[] calldata _tags, bool _isPremium) external

Admin function to flag/unflag tag string(s) as premium prior to minting.

Parameters:

NameTypeDescription
_tagsstring[]Array of tag strings.
_isPremiumboolBoolean true for premium, false for not premium.

setPremiumFlag (0x27a2e473)

function setPremiumFlag(uint256[] calldata _tokenIds, bool _isPremium) external

Admin function to flag/unflag CTAG(s) as premium.

Parameters:

NameTypeDescription
_tokenIdsuint256[]Array of CTAG Ids.
_isPremiumboolBoolean true for premium, false for not premium.

setReservedFlag (0xaf46adb8)

function setReservedFlag(uint256[] calldata _tokenIds, bool _reserved) external

Admin function to flag/unflag CTAG(s) as reserved.

Tags flagged as reserved cannot be auctioned.

Parameters:

NameTypeDescription
_tokenIdsuint256[]Array of CTAG Ids.
_reservedboolBoolean true for reserved, false for not reserved.

getOrCreateTagId (0xfed6c2e9)

function getOrCreateTagId(
    string calldata _tag,
    address payable _relayer,
    address payable _creator
) external payable returns (uint256 tokenId)

Get CTAG token Id from tag string.

Combo function that accepts a tag string and returns it's CTAG token Id if it exists, or creates a new CTAG and returns corresponding Id.

Only ETS Core can call this function.

Parameters:

NameTypeDescription
_tagstringTag string.
_relayeraddress payableAddress of Relayer contract calling ETS Core.
_creatoraddress payableAddress credited with creating CTAG.

Return values:

NameTypeDescription
tokenIduint256Id of CTAG token.

createTag (0xa675f1e3)

function createTag(
    string calldata _tag,
    address payable _relayer,
    address payable _creator
) external payable returns (uint256 tokenId)

Create CTAG token from tag string.

Reverts if tag exists or is invalid.

Only ETS Core can call this function.

Parameters:

NameTypeDescription
_tagstringTag string.
_creatoraddress payableAddress credited with creating CTAG.

Return values:

NameTypeDescription
tokenIduint256Id of CTAG token.

renewTag (0xc157daea)

function renewTag(uint256 _tokenId) external

Renews ownership term of a CTAG.

A "CTAG ownership term" is utilized to prevent CTAGs from being abandoned or inaccessable due to lost private keys.

Any wallet address may renew the term of a CTAG for an owner. When renewed, the term is extended from the current block timestamp plus the ownershipTermLength public variable.

Parameters:

NameTypeDescription
_tokenIduint256Id of CTAG token.

recycleTag (0xe8d3e4b6)

function recycleTag(uint256 _tokenId) external

Recycles a CTAG back to ETS.

When ownership term of a CTAG has expired, any wallet or contract may call this function to recycle the tag back to ETS. Once recycled, a tag may be auctioned again.

Parameters:

NameTypeDescription
_tokenIduint256Id of CTAG token.

computeTagId (0xf143fc61)

function computeTagId(string memory _tag) external pure returns (uint256)

Function to deterministically compute & return a CTAG token Id.

Every CTAG token and it's associated data struct is mapped to by it's token Id. This Id is computed from the "display" tag string lowercased, hashed and cast as an unsigned integer.

Note: Function does not verify if CTAG record exists.

Parameters:

NameTypeDescription
_tagstringTag string.

Return values:

NameTypeDescription
[0]uint256Id of potential CTAG token id.

tagExistsByString (0xf6ba042a)

function tagExistsByString(string calldata _tag) external view returns (bool)

Check that a CTAG token exists for a given tag string.

Parameters:

NameTypeDescription
_tagstringTag string.

Return values:

NameTypeDescription
[0]booltrue if CTAG token exists; false if not.

tagExistsById (0xb7bd44ed)

function tagExistsById(uint256 _tokenId) external view returns (bool)

Check that CTAG token exists for a given computed token Id.

Parameters:

NameTypeDescription
_tokenIduint256Token Id uint computed from tag string via computeTargetId().

Return values:

NameTypeDescription
[0]booltrue if CTAG token exists; false if not.

tagOwnershipTermExpired (0xe9bd8126)

function tagOwnershipTermExpired(uint256 _tokenId) external view returns (bool)

Check if CTAG token ownership term has expired.

Parameters:

NameTypeDescription
_tokenIduint256Token Id uint computed from tag string via computeTargetId().

Return values:

NameTypeDescription
[0]booltrue if CTAG ownership term has expired; false if not.

getTagByString (0x6c1244b6)

function getTagByString(
    string calldata _tag
) external view returns (IETSToken.Tag memory)

Retrieve a CTAG record for a given tag string.

Note: returns a struct with empty members when no CTAG exists.

Parameters:

NameTypeDescription
_tagstringTag string.

Return values:

NameTypeDescription
[0]struct IETSToken.TagCTAG record as Tag struct.

getTagById (0x4b3d267f)

function getTagById(
    uint256 _tokenId
) external view returns (IETSToken.Tag memory)

Retrieve a CTAG record for a given token Id.

Note: returns a struct with empty members when no CTAG exists.

Parameters:

NameTypeDescription
_tokenIduint256CTAG token Id.

Return values:

NameTypeDescription
[0]struct IETSToken.TagCTAG record as Tag struct.

getPlatformAddress (0x3c0c4566)

function getPlatformAddress() external view returns (address payable)

Retrieve wallet address for ETS Platform.

Return values:

NameTypeDescription
[0]address payablewallet address for ETS Platform.

getCreatorAddress (0xa30b4db9)

function getCreatorAddress(uint256 _tokenId) external view returns (address)

Retrieve Creator address for a CTAG token.

Parameters:

NameTypeDescription
_tokenIduint256CTAG token Id.

Return values:

NameTypeDescription
[0]address_creator Creator address of the CTAG.

getLastRenewed (0xb06a89a7)

function getLastRenewed(uint256 _tokenId) external view returns (uint256)

Retrieve last renewal block timestamp for a CTAG.

Parameters:

NameTypeDescription
_tokenIduint256CTAG token Id.

Return values:

NameTypeDescription
[0]uint256Block timestamp.

getOwnershipTermLength (0x500aac87)

function getOwnershipTermLength() external view returns (uint256)

Retrieve CTAG ownership term length global setting.

Return values:

NameTypeDescription
[0]uint256Term length in days.