ICharacter

Git Source

Inherits: IERC721, IVotes

Functions

equipItems

function equipItems(uint256 charId_, uint256[] calldata itemIds_) external;

carryGold

function carryGold(uint256 charId_, uint256 goldAmount_) external;

dropGold

function dropGold(uint256 charId_, uint256 goldAmount_) external;

sendFrom

send token _tokenId to (_dstChainId, _toAddress) from _from _toAddress can be any size depending on the dstChainId. _zroPaymentAddress set to address(0x0) if not paying in ZRO (LayerZero Token) _adapterParams is a flexible bytes array to indicate messaging adapter services

function sendFrom(address from_, uint16 dstChainId_, address toAddress_, uint256 charId_, bytes memory adapterParams_)
    external
    payable;

sendBatchFrom

send tokens _tokenIds[] to (_dstChainId, _toAddress) from _from _toAddress can be any size depending on the dstChainId. _zroPaymentAddress set to address(0x0) if not paying in ZRO (LayerZero Token) _adapterParams is a flexible bytes array to indicate messaging adapter services

function sendBatchFrom(
    address _from,
    uint16 _dstChainId,
    address _toAddress,
    uint256[] calldata charIds_,
    bytes memory adapterParams_
) external payable;

creditTo

function creditTo(address toAddress_, uint256 tokenId_, bytes memory data_) external;

levelUp

function levelUp(uint256 charId_) external;

getCharInfo

function getCharInfo(uint256 charId_) external view returns (CharInfo memory, address);

Events

ItemsEquipped

event ItemsEquipped(uint256 indexed charId, uint256[] itemIds);

GoldCarried

event GoldCarried(uint256 indexed charId, uint256 goldAmount);

GoldDropped

event GoldDropped(uint256 indexed charId, uint256 goldAmount);

CharacterSent

event CharacterSent(CharInfo indexed charInfo, uint16 dstChainId, address toAddress);

CharacterReceived

event CharacterReceived(CharInfo indexed charInfo, address fromAddress);

CharacterLevelUp

event CharacterLevelUp(uint256 indexed charId, uint32 level);

Errors

InvalidCharInfoError

error InvalidCharInfoError(CharInfo charInfo);

NotOwnerError

error NotOwnerError(address owner);

OnlyPortalError

error OnlyPortalError(address portal);

OnlyBossError

error OnlyBossError(address boss);

Structs

CharInfo

struct CharInfo {
    uint32 charId;
    uint32 level;
    uint32 power;
    uint160 equippedGold;
}