LinkLib

Git Source

Functions

linkCharacter

Links any characterId.

function linkCharacter(
    uint256 fromCharacterId,
    uint256 toCharacterId,
    bytes32 linkType,
    bytes memory data,
    address linklist
) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor a link action.
toCharacterIduint256The character ID to be linked.
linkTypebytes32linkType, like “follow”.
databytesThe data to pass to the link module, if any.
linklistaddressThe linklist contract address.

unlinkCharacter

Unlinks a given character.

function unlinkCharacter(uint256 fromCharacterId, uint256 toCharacterId, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor a unlink action.
toCharacterIduint256The character ID to be unlinked.
linkTypebytes32linkType, like “follow”.
linklistaddressThe linklist contract address.

linkNote

Links a given note.

function linkNote(
    uint256 fromCharacterId,
    uint256 toCharacterId,
    uint256 toNoteId,
    bytes32 linkType,
    bytes calldata data,
    address linklist
) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor a link action.
toCharacterIduint256The owner characterId of the note to link.
toNoteIduint256The id of the note to link.
linkTypebytes32The linkType, like “follow”.
databytesThe data to pass to the link module, if any.
linklistaddressThe linklist contract address.

unlinkNote

Unlinks a given note.

function unlinkNote(
    uint256 fromCharacterId,
    uint256 toCharacterId,
    uint256 toNoteId,
    bytes32 linkType,
    address linklist
) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an unlink action.
toCharacterIduint256The character ID of note to unlink.
toNoteIduint256The id of note to unlink.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

Links a linklist.

function linkLinklist(uint256 fromCharacterId, uint256 toLinkListId, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an link action.
toLinkListIduint256The linklist if to link.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

Unlinks a linklist.

function unlinkLinklist(uint256 fromCharacterId, uint256 toLinkListId, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an unlink action.
toLinkListIduint256The linklist if to unlink.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

linkERC721

Links an ERC721 token.

function linkERC721(uint256 fromCharacterId, address tokenAddress, uint256 tokenId, bytes32 linkType, address linklist)
    external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an link action.
tokenAddressaddressThe token address of ERC721 to link.
tokenIduint256The token ID of ERC721 to link.
linkTypebytes32linkType, like “follow”.
linklistaddressThe linklist contract address.

unlinkERC721

Unlinks an ERC721 token.

function unlinkERC721(
    uint256 fromCharacterId,
    address tokenAddress,
    uint256 tokenId,
    bytes32 linkType,
    address linklist
) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an unlink action.
tokenAddressaddressThe token address of ERC721 to unlink.
tokenIduint256The token ID of ERC721 to unlink.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

linkAddress

Creates a link to a given address.

function linkAddress(uint256 fromCharacterId, address ethAddress, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to init the link.
ethAddressaddressThe address to link.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

unlinkAddress

Unlinks a given address.

function unlinkAddress(uint256 fromCharacterId, address ethAddress, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to init the unlink.
ethAddressaddressThe address to unlink.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

linkAnyUri

Links any uri.

function linkAnyUri(uint256 fromCharacterId, string calldata toUri, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an link action.
toUristringThe uri to link.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

unlinkAnyUri

Unlinks any uri.

function unlinkAnyUri(uint256 fromCharacterId, string calldata toUri, bytes32 linkType, address linklist) external;

Parameters

NameTypeDescription
fromCharacterIduint256The character ID to sponsor an unlink action.
toUristringThe uri to unlink.
linkTypebytes32LinkType, like “follow”.
linklistaddressThe linklist contract address.

Returns the linklistId if the linklist already exists, Otherwise, creates a new linklist and return its ID.

function _mintLinklist(uint256 fromCharacterId, bytes32 linkType, address linklist)
    internal
    returns (uint256 linklistId);

_ownerOf

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