LibMaterial

Git Source

State Variables

NONE

MaterialId constant NONE = MaterialId.wrap(bytes14(0));

Functions

registerMaterial

function registerMaterial(
    MaterialId _materialId,
    string memory _name,
    string memory _symbol,
    MATERIAL_DIFFICULTY _difficulty
) internal;

mint

Mint token to address

function mint(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialIdmaterial id to mint
_toaddressaddress to mint to
_valueuint256amount to mint

burn

Burn token from address

function burn(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialIdmaterial id to burn
_toaddressaddress to burn from
_valueuint256amount to burn

transferToken

Transfer tokens

function transferToken(MaterialId _materialId, address _to, uint256 _value) internal;

Parameters

NameTypeDescription
_materialIdMaterialId
_toaddressaddress to transfer to
_valueuint256amount to transfer

getTokenBalance

Get token balance for an account

function getTokenBalance(MaterialId _materialId, address _account) internal view returns (uint256);

Parameters

NameTypeDescription
_materialIdMaterialId
_accountaddressaddress to get balance for

getMaterialCombinationId

Get id for a combination of 1 material

function getMaterialCombinationId(MaterialId _a) internal pure returns (bytes32);

Parameters

NameTypeDescription
_aMaterialIdMaterial id

getMaterialCombinationId

Get id for a combination of 2 materials

function getMaterialCombinationId(MaterialId _a, MaterialId _b) internal pure returns (bytes32);

Parameters

NameTypeDescription
_aMaterialIdMaterial id
_bMaterialIdMaterial id

isRegistered

Whether the material has been registered

function isRegistered(MaterialId _materialId) internal view returns (bool);

unwrap

function unwrap(MaterialId _materialId) internal pure returns (bytes14);