CharacterLib
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
Name | Type | Description |
---|---|---|
to | address | The address to mint the character to. |
handle | string | The handle to set for the new character. |
uri | string | The URI to set for the new character’s metadata. |
linkModule | address | The link module to set for the new character or the zero address. |
linkModuleInitData | bytes | Arbitrary data to be decoded in the link module for initialization. |
characterId | uint256 | The ID of the new character. |
validateHandle | bool | Whether to validate the handle or not. |
setSocialToken
Sets a social token for a given character.
function setSocialToken(uint256 characterId, address tokenAddress) external;
Parameters
Name | Type | Description |
---|---|---|
characterId | uint256 | The character ID to set social token for. |
tokenAddress | address | Token address to be set. |
setCharacterLinkModule
Sets link module for a given character.
function setCharacterLinkModule(uint256 characterId, address linkModule, bytes calldata linkModuleInitData) external;
Parameters
Name | Type | Description |
---|---|---|
characterId | uint256 | The character ID to set link module for. |
linkModule | address | The link module to set. |
linkModuleInitData | bytes | The 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
Name | Type | Description |
---|---|---|
characterId | uint256 | The character ID to set new handle for. |
newHandle | string | New handle to set. |
_handleHash
function _handleHash(string memory handle) internal pure returns (bytes32);