LibMaterial
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
Name | Type | Description |
---|---|---|
_materialId | MaterialId | material id to mint |
_to | address | address to mint to |
_value | uint256 | amount to mint |
burn
Burn token from address
function burn(MaterialId _materialId, address _to, uint256 _value) internal;
Parameters
Name | Type | Description |
---|---|---|
_materialId | MaterialId | material id to burn |
_to | address | address to burn from |
_value | uint256 | amount to burn |
transferToken
Transfer tokens
function transferToken(MaterialId _materialId, address _to, uint256 _value) internal;
Parameters
Name | Type | Description |
---|---|---|
_materialId | MaterialId | |
_to | address | address to transfer to |
_value | uint256 | amount to transfer |
getTokenBalance
Get token balance for an account
function getTokenBalance(MaterialId _materialId, address _account) internal view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_materialId | MaterialId | |
_account | address | address to get balance for |
getMaterialCombinationId
Get id for a combination of 1 material
function getMaterialCombinationId(MaterialId _a) internal pure returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
_a | MaterialId | Material id |
getMaterialCombinationId
Get id for a combination of 2 materials
function getMaterialCombinationId(MaterialId _a, MaterialId _b) internal pure returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
_a | MaterialId | Material id |
_b | MaterialId | Material 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);