Skip to main content
Version: Next

IHypercertToken

bitbeckers

Interface for hypercert token interactions

This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155)

Methods

batchBurnFraction

function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable

Operator must be allowed by creator and the tokens must represent the total amount of available units.

Function to burn the tokens at tokenIDs for account

Parameters

NameTypeDescription
accountaddressundefined
tokenIDsuint256[]undefined

burnFraction

function burnFraction(address account, uint256 tokenID) external nonpayable

Operator must be allowed by creator and the token must represent the total amount of available units.

Function to burn the token at tokenID for account

Parameters

NameTypeDescription
accountaddressundefined
tokenIDuint256undefined

mergeFractions

function mergeFractions(address account, uint256[] tokenIDs) external nonpayable

Tokens that have been merged are burned.

Function called to merge tokens within tokenIDs.

Parameters

NameTypeDescription
accountaddressundefined
tokenIDsuint256[]undefined

mintClaim

function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable

Function called to store a claim referenced via uri with a maximum number of fractions units.

Parameters

NameTypeDescription
accountaddressundefined
unitsuint256undefined
uristringundefined
restrictionsenum IHypercertToken.TransferRestrictionsundefined

mintClaimWithFractions

function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable

Function called to store a claim referenced via uri with a set of fractions.Fractions are internally summed to total units.

Parameters

NameTypeDescription
accountaddressundefined
unitsuint256undefined
fractionsuint256[]undefined
uristringundefined
restrictionsenum IHypercertToken.TransferRestrictionsundefined

splitFraction

function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable

The sum of values must equal the current value of _tokenID.

Function called to split tokenID owned by account into units declared in values.

Parameters

NameTypeDescription
accountaddressundefined
tokenIDuint256undefined
_valuesuint256[]undefined

unitsOf

function unitsOf(address account, uint256 tokenID) external view returns (uint256 units)

Returns the units held by account of a (fractional) token at claimIDIf tokenID is a base type, the total amount of units held by account for the claim is returned.If tokenID is a fractional token, the units held by account the token is returned

Parameters

NameTypeDescription
accountaddressundefined
tokenIDuint256undefined

Returns

NameTypeDescription
unitsuint256undefined

unitsOf

function unitsOf(uint256 tokenID) external view returns (uint256 units)

Returns the units held by a (fractional) token at claimIDIf tokenID is a base type, the total amount of units for the claim is returned.If tokenID is a fractional token, the units held by the token is returned

Parameters

NameTypeDescription
tokenIDuint256undefined

Returns

NameTypeDescription
unitsuint256undefined

uri

function uri(uint256 tokenID) external view returns (string metadata)

Returns the uri for metadata of the claim represented by tokenIDMetadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)

Parameters

NameTypeDescription
tokenIDuint256undefined

Returns

NameTypeDescription
metadatastringundefined

Events

ClaimStored

event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits)

Emitted when token with tokenID claimID is stored, with external data reference via uri.

Parameters

NameTypeDescription
claimID indexeduint256undefined
uristringundefined
totalUnitsuint256undefined