CharacterLib

Git Source

Functions

createCharacter

Creates a character.

function createCharacter(
    address to,
    string memory handle,
    string memory uri,
    address linkModule,
    bytes memory linkModuleInitData,
    uint256 characterId,
    bool validateHandle
) external;

Parameters

NameTypeDescription
toaddressThe address to mint the character to.
handlestringThe handle to set for the new character.
uristringThe URI to set for the new character’s metadata.
linkModuleaddressThe link module to set for the new character or the zero address.
linkModuleInitDatabytesArbitrary data to be decoded in the link module for initialization.
characterIduint256The ID of the new character.
validateHandleboolWhether to validate the handle or not.

setSocialToken

Sets a social token for a given character.

function setSocialToken(uint256 characterId, address tokenAddress) external;

Parameters

NameTypeDescription
characterIduint256The character ID to set social token for.
tokenAddressaddressToken address to be set.

setCharacterLinkModule

Sets link module for a given character.

function setCharacterLinkModule(uint256 characterId, address linkModule, bytes calldata linkModuleInitData) external;

Parameters

NameTypeDescription
characterIduint256The character ID to set link module for.
linkModuleaddressThe link module to set.
linkModuleInitDatabytesThe data to pass to the link module for initialization, if any.

setHandle

Sets new handle for a given character.

function setHandle(uint256 characterId, string calldata newHandle) external;

Parameters

NameTypeDescription
characterIduint256The character ID to set new handle for.
newHandlestringNew handle to set.

_handleHash

function _handleHash(string memory handle) internal pure returns (bytes32);