Skip to main content
Version: 1.0.0

HypercertMinter

bitbeckers

Contract for managing hypercert claims and whitelists

Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }.

Wrapper contract to expose and chain functions.

Methods​

__SemiFungible1155_init​

function __SemiFungible1155_init() external nonpayable

see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }

balanceOf​

function balanceOf(address account, uint256 id) external view returns (uint256)

See {IERC1155-balanceOf}. Requirements: - account cannot be the zero address.

Parameters​

NameTypeDescription
accountaddressundefined
iduint256undefined

Returns​

NameTypeDescription
_0uint256undefined

balanceOfBatch​

function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])

See {IERC1155-balanceOfBatch}. Requirements: - accounts and ids must have the same length.

Parameters​

NameTypeDescription
accountsaddress[]undefined
idsuint256[]undefined

Returns​

NameTypeDescription
_0uint256[]undefined

batchBurnFraction​

function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable

Burn a claimtoken

see {IHypercertToken}

Parameters​

NameTypeDescription
_accountaddressundefined
_tokenIDsuint256[]undefined

batchMintClaimsFromAllowlists​

function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable

Mint semi-fungible tokens representing a fraction of the claims in claimIDs

Calls AllowlistMinter to verify proofs.Mints the amount of units for the hypercert stored under claimIDs

Parameters​

NameTypeDescription
accountaddressundefined
proofsbytes32[][]undefined
claimIDsuint256[]undefined
unitsuint256[]undefined

burn​

function burn(address account, uint256 id, uint256) external nonpayable

Burn a claimtoken; override is needed to update units/values

see {ERC1155Burnable}

Parameters​

NameTypeDescription
accountaddressundefined
iduint256undefined
_2uint256undefined

burnBatch​

function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable

Batch burn claimtokens; override is needed to update units/values

see {ERC1155Burnable}

Parameters​

NameTypeDescription
accountaddressundefined
idsuint256[]undefined
_2uint256[]undefined

burnFraction​

function burnFraction(address _account, uint256 _tokenID) external nonpayable

Burn a claimtoken

see {IHypercertToken}

Parameters​

NameTypeDescription
_accountaddressundefined
_tokenIDuint256undefined

createAllowlist​

function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable

Register a claim and the whitelist for minting token(s) belonging to that claim

Calls SemiFungible1155 to store the claim referenced in uri with amount of unitsCalls AllowlistMinter to store the merkleRoot as proof to authorize claims

Parameters​

NameTypeDescription
accountaddressundefined
unitsuint256undefined
merkleRootbytes32undefined
_uristringundefined
restrictionsenum IHypercertToken.TransferRestrictionsundefined

hasBeenClaimed​

function hasBeenClaimed(uint256, bytes32) external view returns (bool)

Parameters​

NameTypeDescription
_0uint256undefined
_1bytes32undefined

Returns​

NameTypeDescription
_0boolundefined

initialize​

function initialize() external nonpayable

see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }

isAllowedToClaim​

function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed)

Parameters​

NameTypeDescription
proofbytes32[]undefined
claimIDuint256undefined
leafbytes32undefined

Returns​

NameTypeDescription
isAllowedboolundefined

isApprovedForAll​

function isApprovedForAll(address account, address operator) external view returns (bool)

See {IERC1155-isApprovedForAll}.

Parameters​

NameTypeDescription
accountaddressundefined
operatoraddressundefined

Returns​

NameTypeDescription
_0boolundefined

mergeFractions​

function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable

Merge the value of tokens belonging to the same claim

see {IHypercertToken}

Parameters​

NameTypeDescription
_accountaddressundefined
_fractionIDsuint256[]undefined

mintClaim​

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

Mint a semi-fungible token for the impact claim referenced via uri

see {IHypercertToken}

Parameters​

NameTypeDescription
accountaddressundefined
unitsuint256undefined
_uristringundefined
restrictionsenum IHypercertToken.TransferRestrictionsundefined

mintClaimFromAllowlist​

function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable

Mint a semi-fungible token representing a fraction of the claim

Calls AllowlistMinter to verify proof.Mints the amount of units for the hypercert stored under claimID

Parameters​

NameTypeDescription
accountaddressundefined
proofbytes32[]undefined
claimIDuint256undefined
unitsuint256undefined

mintClaimWithFractions​

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

Mint semi-fungible tokens for the impact claim referenced via uri

see {IHypercertToken}

Parameters​

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

name​

function name() external view returns (string)

Returns​

NameTypeDescription
_0stringundefined

owner​

function owner() external view returns (address)

Returns the address of the current owner.

Returns​

NameTypeDescription
_0addressundefined

ownerOf​

function ownerOf(uint256 tokenID) external view returns (address _owner)

Returns the owner of a given token ID.

Parameters​

NameTypeDescription
tokenIDuint256The ID of the token to query.

Returns​

NameTypeDescription
_owneraddressThe address of the owner of the token.

pause​

function pause() external nonpayable

PAUSABLE

paused​

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns​

NameTypeDescription
_0boolundefined

proxiableUUID​

function proxiableUUID() external view returns (bytes32)

Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the notDelegated modifier.

Returns​

NameTypeDescription
_0bytes32undefined

readTransferRestriction​

function readTransferRestriction(uint256 tokenID) external view returns (string)

TRANSFER RESTRICTIONS

Parameters​

NameTypeDescription
tokenIDuint256undefined

Returns​

NameTypeDescription
_0stringundefined

renounceOwnership​

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

safeBatchTransferFrom​

function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable

See {IERC1155-safeBatchTransferFrom}.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
idsuint256[]undefined
amountsuint256[]undefined
databytesundefined

safeTransferFrom​

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable

See {IERC1155-safeTransferFrom}.

Parameters​

NameTypeDescription
fromaddressundefined
toaddressundefined
iduint256undefined
amountuint256undefined
databytesundefined

setApprovalForAll​

function setApprovalForAll(address operator, bool approved) external nonpayable

See {IERC1155-setApprovalForAll}.

Parameters​

NameTypeDescription
operatoraddressundefined
approvedboolundefined

splitFraction​

function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable

Split a claimtokens value into parts with summed value equal to the original

see {IHypercertToken}

Parameters​

NameTypeDescription
_accountaddressundefined
_tokenIDuint256undefined
_newFractionsuint256[]undefined

supportsInterface​

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters​

NameTypeDescription
interfaceIdbytes4undefined

Returns​

NameTypeDescription
_0boolundefined

transferOwnership​

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters​

NameTypeDescription
newOwneraddressundefined

unitsOf​

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

see {IHypercertToken}

Parameters​

NameTypeDescription
accountaddressundefined
tokenIDuint256undefined

Returns​

NameTypeDescription
unitsuint256undefined

unitsOf​

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

see {IHypercertToken}

Parameters​

NameTypeDescription
tokenIDuint256undefined

Returns​

NameTypeDescription
unitsuint256undefined

unpause​

function unpause() external nonpayable

upgradeTo​

function upgradeTo(address newImplementation) external nonpayable

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters​

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall​

function upgradeToAndCall(address newImplementation, bytes data) external payable

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters​

NameTypeDescription
newImplementationaddressundefined
databytesundefined

uri​

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

see { IHypercertMetadata}

Parameters​

NameTypeDescription
tokenIDuint256undefined

Returns​

NameTypeDescription
_uristringundefined

Events​

AdminChanged​

event AdminChanged(address previousAdmin, address newAdmin)

Parameters​

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

AllowlistCreated​

event AllowlistCreated(uint256 tokenID, bytes32 root)

Parameters​

NameTypeDescription
tokenIDuint256undefined
rootbytes32undefined

ApprovalForAll​

event ApprovalForAll(address indexed account, address indexed operator, bool approved)

Parameters​

NameTypeDescription
account indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

BatchValueTransfer​

event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values)

Parameters​

NameTypeDescription
claimIDsuint256[]undefined
fromTokenIDsuint256[]undefined
toTokenIDsuint256[]undefined
valuesuint256[]undefined

BeaconUpgraded​

event BeaconUpgraded(address indexed beacon)

Parameters​

NameTypeDescription
beacon indexedaddressundefined

ClaimStored​

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

Parameters​

NameTypeDescription
claimID indexeduint256undefined
uristringundefined
totalUnitsuint256undefined

Initialized​

event Initialized(uint8 version)

Parameters​

NameTypeDescription
versionuint8undefined

LeafClaimed​

event LeafClaimed(uint256 tokenID, bytes32 leaf)

Parameters​

NameTypeDescription
tokenIDuint256undefined
leafbytes32undefined

OwnershipTransferred​

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters​

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

Paused​

event Paused(address account)

Parameters​

NameTypeDescription
accountaddressundefined

TransferBatch​

event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)

Parameters​

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
idsuint256[]undefined
valuesuint256[]undefined

TransferSingle​

event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)

Parameters​

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
iduint256undefined
valueuint256undefined

URI​

event URI(string value, uint256 indexed id)

Parameters​

NameTypeDescription
valuestringundefined
id indexeduint256undefined

Unpaused​

event Unpaused(address account)

Parameters​

NameTypeDescription
accountaddressundefined

Upgraded​

event Upgraded(address indexed implementation)

Parameters​

NameTypeDescription
implementation indexedaddressundefined

ValueTransfer​

event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value)

Parameters​

NameTypeDescription
claimIDuint256undefined
fromTokenIDuint256undefined
toTokenIDuint256undefined
valueuint256undefined

Errors​

AlreadyClaimed​

error AlreadyClaimed()

ArraySize​

error ArraySize()

DoesNotExist​

error DoesNotExist()

DuplicateEntry​

error DuplicateEntry()

Invalid​

error Invalid()

NotAllowed​

error NotAllowed()

NotApprovedOrOwner​

error NotApprovedOrOwner()

TransfersNotAllowed​

error TransfersNotAllowed()

TypeMismatch​

error TypeMismatch()