IShatter
Author: transientlabs.xyz
interface defining the Shatter standard Interface id = 0xf2528cbb
Functions
mint
Function for minting the 1/1
Requires contract owner or admin
Requires that shatters is equal to 0 -> meaning no piece has been minted
function mint(address recipient, string memory uri, uint128 min, uint128 max, uint256 time) external;
Parameters
Name | Type | Description |
---|---|---|
recipient | address | The address to mint to token to |
uri | string | The base uri to be used for the shatter folder WITHOUT trailing "/" |
min | uint128 | The minimum number of shatters |
max | uint128 | The maximum number of shatters |
time | uint256 | Time after which shatter can occur |
shatter
function to shatter the 1/1 token
*care should be taken to ensure that the following conditions are met
- this function can only be called once
- msg.sender actually owns the 1/1 token
- the token has not been shattered yet
- block.timestamp is past the shatter time (if applicable)
- numShatters is an allowed value as set by the creator*
function shatter(uint128 numShatters) external;
Parameters
Name | Type | Description |
---|---|---|
numShatters | uint128 | is the total number of shatters to make |
fuse
function to fuse shatters back into a 1/1
*care should be taken to ensure that the following conditions are met
- this function can only be called once
- the 1/1 is actually shattered
- msg.sender actually owns all of the shatters*
function fuse() external;
Events
Shattered
event Shattered(address indexed user, uint256 indexed numShatters, uint256 indexed shatteredTime);
Fused
event Fused(address indexed user, uint256 indexed fuseTime);