IShatter

Git Source

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

NameTypeDescription
recipientaddressThe address to mint to token to
uristringThe base uri to be used for the shatter folder WITHOUT trailing "/"
minuint128The minimum number of shatters
maxuint128The maximum number of shatters
timeuint256Time 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

NameTypeDescription
numShattersuint128is 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);