Linklist

Git Source

Inherits: ILinklist, LinklistBase, LinklistStorage, Initializable, LinklistExtendStorage

Functions

onlyWeb3Entry

modifier onlyWeb3Entry();

onlyExistingToken

modifier onlyExistingToken(uint256 tokenId);

initialize

Initializes the contract.

function initialize(string calldata name_, string calldata symbol_, address web3Entry_)
    external
    override
    reinitializer(2);

Parameters

NameTypeDescription
name_stringThe name of the token.
symbol_stringThe symbol of the token.
web3Entry_addressThe address of the Web3Entry contract.

mint

Mints a Linklist NFT to the specified character with linkType. This can only be called by web3Entry.

function mint(uint256 characterId, bytes32 linkType) external override onlyWeb3Entry returns (uint256 tokenId);

Parameters

NameTypeDescription
characterIduint256The character ID to mint to.
linkTypebytes32The type of link.

Returns

NameTypeDescription
tokenIduint256The minted token ID.

burn

Burns a Linklist NFT.

Only web3Entry can burn the Linklist NFT.

function burn(uint256 tokenId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID to burn.

setUri

Sets URI for a linklist.

You can set any URI for your linklist, and the functionality of this URI is undetermined and expandable. One scenario that comes to mind is setting a cover for your liked notes or following list in your bookmarks.

function setUri(uint256 tokenId, string memory uri) external override onlyExistingToken(tokenId);

Parameters

NameTypeDescription
tokenIduint256The token ID to set URI.
uristringThe new URI to set.

setLinkType

Sets the link type of the linklist NFT.

function setLinkType(uint256 tokenId, bytes32 linkType) external override onlyWeb3Entry onlyExistingToken(tokenId);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to set.
linkTypebytes32The link type to set.

addLinkingCharacterId

Adds a linked character to a linklist.

function addLinkingCharacterId(uint256 tokenId, uint256 toCharacterId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toCharacterIduint256The character ID to link.

removeLinkingCharacterId

Removes a linked character from a linklist.

function removeLinkingCharacterId(uint256 tokenId, uint256 toCharacterId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toCharacterIduint256The character ID to remove.

addLinkingNote

Adds a linked note to a linklist.

function addLinkingNote(uint256 tokenId, uint256 toCharacterId, uint256 toNoteId)
    external
    override
    onlyWeb3Entry
    returns (bytes32);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toCharacterIduint256The character ID to link.
toNoteIduint256The note ID to link.

Returns

NameTypeDescription
<none>bytes32linkKey The link key.

removeLinkingNote

Removes a linked note from a linklist.

function removeLinkingNote(uint256 tokenId, uint256 toCharacterId, uint256 toNoteId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toCharacterIduint256The character ID to remove.
toNoteIduint256The note ID to remove.

addLinkingERC721

Adds a linked ERC721 to a linklist.

function addLinkingERC721(uint256 tokenId, address tokenAddress, uint256 erc721TokenId)
    external
    override
    onlyWeb3Entry
    returns (bytes32);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
tokenAddressaddressThe address of ERC721 contract.
erc721TokenIduint256The token ID of ERC721.

Returns

NameTypeDescription
<none>bytes32linkKey The link key of ERC721.

removeLinkingERC721

Removes a linked ERC721 from a linklist.

function removeLinkingERC721(uint256 tokenId, address tokenAddress, uint256 erc721TokenId)
    external
    override
    onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
tokenAddressaddressThe address of ERC721 contract.
erc721TokenIduint256The token ID of ERC721.

addLinkingAddress

Adds a linked address to a linklist.

function addLinkingAddress(uint256 tokenId, address ethAddress) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
ethAddressaddressThe address to link.

removeLinkingAddress

Removes a linked address from a linklist.

function removeLinkingAddress(uint256 tokenId, address ethAddress) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
ethAddressaddressThe address to remove.

addLinkingAnyUri

Adds a linked anyURI to a linklist.

function addLinkingAnyUri(uint256 tokenId, string memory toUri) external override onlyWeb3Entry returns (bytes32);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toUristringThe anyURI to link.

Returns

NameTypeDescription
<none>bytes32linkKey The link key of anyURI.

removeLinkingAnyUri

Removes a linked anyURI from a linklist.

function removeLinkingAnyUri(uint256 tokenId, string memory toUri) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
toUristringThe anyURI to remove.

addLinkingLinklistId

Adds a linked linklist to a linklist.

function addLinkingLinklistId(uint256 tokenId, uint256 linklistId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
linklistIduint256The linklist ID to link.

removeLinkingLinklistId

Removes a linked linklist from a linklist.

function removeLinkingLinklistId(uint256 tokenId, uint256 linklistId) external override onlyWeb3Entry;

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist.
linklistIduint256The linklist ID to remove.

getLinkingCharacterIds

Returns the linked character IDs of the linklist NFT.

function getLinkingCharacterIds(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256[] memory);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256[]The linked character IDs.

getLinkingCharacterListLength

Returns the length of linked character IDs of the linklist NFT.

function getLinkingCharacterListLength(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked character IDs .

getOwnerCharacterId

Returns the character ID who owns the linklist NFT.

function getOwnerCharacterId(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The character ID who owns the linklist NFT.

getLinkingNotes

Returns the linked notes of the linklist NFT.

function getLinkingNotes(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (DataTypes.NoteStruct[] memory results);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
resultsDataTypes.NoteStruct[]The linked notes.

getLinkingNote

Return the linked note of the linklist NFT by linkKey.

function getLinkingNote(bytes32 linkKey) external view override returns (DataTypes.NoteStruct memory);

Parameters

NameTypeDescription
linkKeybytes32The link key of the note.

Returns

NameTypeDescription
<none>DataTypes.NoteStructThe linked note.

getLinkingNoteListLength

Returns the length of linked notes of the linklist NFT.

function getLinkingNoteListLength(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked notes.

getLinkingERC721s

Returns the linked ERC721s of the linklist NFT.

function getLinkingERC721s(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (DataTypes.ERC721Struct[] memory results);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
resultsDataTypes.ERC721Struct[]The linked ERC721s.

getLinkingERC721

Return the linked ERC721 of the linklist NFT by linkKey.

function getLinkingERC721(bytes32 linkKey) external view override returns (DataTypes.ERC721Struct memory);

Parameters

NameTypeDescription
linkKeybytes32The link key of the ERC721.

Returns

NameTypeDescription
<none>DataTypes.ERC721StructThe linked ERC721.

getLinkingERC721ListLength

Returns the length of linked ERC721s of the linklist NFT.

function getLinkingERC721ListLength(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked ERC721s.

getLinkingAddresses

Returns the linked addresses of the linklist NFT.

function getLinkingAddresses(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (address[] memory);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>address[]The linked addresses.

getLinkingAddressListLength

Returns the linked address of the linklist NFT by linkKey.

function getLinkingAddressListLength(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked address.

getLinkingAnyUris

Returns the linked anyURIs of the linklist NFT.

function getLinkingAnyUris(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (string[] memory results);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
resultsstring[]The linked anyURIs.

getLinkingAnyUri

Return the linked anyURI of the linklist NFT by linkKey.

function getLinkingAnyUri(bytes32 linkKey) external view override returns (string memory);

Parameters

NameTypeDescription
linkKeybytes32The link key of the anyURI.

Returns

NameTypeDescription
<none>stringThe linked anyURI.

getLinkingAnyUriKeys

Returns the length of linked anyURIs of the linklist NFT.

function getLinkingAnyUriKeys(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (bytes32[] memory);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>bytes32[]The length of linked anyURIs.

getLinkingAnyListLength

Returns the length of linked Uris of the linklist NFT.

function getLinkingAnyListLength(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked Uris.

getLinkingLinklistIds

Returns the linked linklists of the linklist NFT.

function getLinkingLinklistIds(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256[] memory);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256[]The linked linklists.

getLinkingLinklistLength

Return the length of linked linklist of the linklist NFT.

function getLinkingLinklistLength(uint256 tokenId)
    external
    view
    override
    onlyExistingToken(tokenId)
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>uint256The length of linked linklist.

getCurrentTakeOver

function getCurrentTakeOver(uint256 tokenId) external view override returns (uint256);

getLinkType

Returns the link type of the linklist NFT.

function getLinkType(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (bytes32);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>bytes32The link type.

Uri

Returns the URI of the linklist NFT.

function Uri(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (string memory);

Parameters

NameTypeDescription
tokenIduint256The token ID of linklist to check.

Returns

NameTypeDescription
<none>stringThe URI of the linklist NFT.

characterOwnerOf

Returns the character ID who owns the Linklist NFT.

function characterOwnerOf(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (uint256);

Parameters

NameTypeDescription
tokenIduint256The token ID to check.

Returns

NameTypeDescription
<none>uint256The character ID.

totalSupply

Returns the total supply of the Linklist NFTs.

function totalSupply() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The total supply of the Linklist NFTs.

balanceOf

Returns the balance of the character.

function balanceOf(uint256 characterId) external view override returns (uint256);

Parameters

NameTypeDescription
characterIduint256The character ID to check.

Returns

NameTypeDescription
<none>uint256uint256 The balance of the character.

balanceOf

Returns the balance of the character.

function balanceOf(address account) external view override returns (uint256 balance);

Parameters

NameTypeDescription
accountaddress

Returns

NameTypeDescription
balanceuint256uint256 The balance of the character.

ownerOf

Returns the owner of the tokenId token.

function ownerOf(uint256 tokenId) external view override onlyExistingToken(tokenId) returns (address);

Parameters

NameTypeDescription
tokenIduint256The token ID to check.

Returns

NameTypeDescription
<none>addressThe owner of the tokenId token.

_ownerOf

function _ownerOf(uint256 tokenId) internal view returns (address);

Events

Transfer

event Transfer(address indexed from, uint256 indexed characterId, uint256 indexed tokenId);

Burn

event Burn(uint256 indexed from, uint256 indexed tokenId);

UriSet

event UriSet(uint256 indexed tokenId, string uri);

LinkTypeSet

event LinkTypeSet(uint256 indexed tokenId, bytes32 indexed newlinkType);