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
Name | Type | Description |
---|
account | address | undefined |
id | uint256 | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
balanceOfBatch
function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])
See {IERC1155-balanceOfBatch}. Requirements: - accounts
and ids
must have the same length.
Parameters
Name | Type | Description |
---|
accounts | address[] | undefined |
ids | uint256[] | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256[] | undefined |
batchBurnFraction
function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable
Burn a claimtoken
see {IHypercertToken}
Parameters
Name | Type | Description |
---|
_account | address | undefined |
_tokenIDs | uint256[] | 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
Name | Type | Description |
---|
account | address | undefined |
proofs | bytes32[][] | undefined |
claimIDs | uint256[] | undefined |
units | uint256[] | undefined |
burn
function burn(address account, uint256 id, uint256) external nonpayable
Burn a claimtoken; override is needed to update units/values
see {ERC1155Burnable}
Parameters
Name | Type | Description |
---|
account | address | undefined |
id | uint256 | undefined |
_2 | uint256 | undefined |
burnBatch
function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable
Batch burn claimtokens; override is needed to update units/values
see {ERC1155Burnable}
Parameters
Name | Type | Description |
---|
account | address | undefined |
ids | uint256[] | undefined |
_2 | uint256[] | undefined |
burnFraction
function burnFraction(address _account, uint256 _tokenID) external nonpayable
Burn a claimtoken
see {IHypercertToken}
Parameters
Name | Type | Description |
---|
_account | address | undefined |
_tokenID | uint256 | undefined |
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 units
Calls AllowlistMinter to store the merkleRoot
as proof to authorize claims
Parameters
Name | Type | Description |
---|
account | address | undefined |
units | uint256 | undefined |
merkleRoot | bytes32 | undefined |
_uri | string | undefined |
restrictions | enum IHypercertToken.TransferRestrictions | undefined |
getMinted
function getMinted(uint256 claimID) external view returns (uint256 mintedUnits)
Parameters
Name | Type | Description |
---|
claimID | uint256 | undefined |
Returns
Name | Type | Description |
---|
mintedUnits | uint256 | undefined |
hasBeenClaimed
function hasBeenClaimed(uint256, bytes32) external view returns (bool)
Parameters
Name | Type | Description |
---|
_0 | uint256 | undefined |
_1 | bytes32 | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
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
Name | Type | Description |
---|
proof | bytes32[] | undefined |
claimID | uint256 | undefined |
leaf | bytes32 | undefined |
Returns
Name | Type | Description |
---|
isAllowed | bool | undefined |
isApprovedForAll
function isApprovedForAll(address account, address operator) external view returns (bool)
See {IERC1155-isApprovedForAll}.
Parameters
Name | Type | Description |
---|
account | address | undefined |
operator | address | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
mergeFractions
function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable
Merge the value of tokens belonging to the same claim
see {IHypercertToken}
Parameters
Name | Type | Description |
---|
_account | address | undefined |
_fractionIDs | uint256[] | 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
Name | Type | Description |
---|
account | address | undefined |
units | uint256 | undefined |
_uri | string | undefined |
restrictions | enum IHypercertToken.TransferRestrictions | undefined |
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
Name | Type | Description |
---|
account | address | undefined |
proof | bytes32[] | undefined |
claimID | uint256 | undefined |
units | uint256 | undefined |
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
Name | Type | Description |
---|
account | address | undefined |
units | uint256 | undefined |
fractions | uint256[] | undefined |
_uri | string | undefined |
restrictions | enum IHypercertToken.TransferRestrictions | undefined |
name
function name() external view returns (string)
Returns
Name | Type | Description |
---|
_0 | string | undefined |
owner
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|
_0 | address | undefined |
ownerOf
function ownerOf(uint256 tokenID) external view returns (address _owner)
Returns the owner of a given token ID.
Parameters
Name | Type | Description |
---|
tokenID | uint256 | The ID of the token to query. |
Returns
Name | Type | Description |
---|
_owner | address | The 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
Name | Type | Description |
---|
_0 | bool | undefined |
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
Name | Type | Description |
---|
_0 | bytes32 | undefined |
readTransferRestriction
function readTransferRestriction(uint256 tokenID) external view returns (string)
TRANSFER RESTRICTIONS
Parameters
Name | Type | Description |
---|
tokenID | uint256 | undefined |
Returns
Name | Type | Description |
---|
_0 | string | undefined |
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
Name | Type | Description |
---|
from | address | undefined |
to | address | undefined |
ids | uint256[] | undefined |
amounts | uint256[] | undefined |
data | bytes | undefined |
safeTransferFrom
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable
See {IERC1155-safeTransferFrom}.
Parameters
Name | Type | Description |
---|
from | address | undefined |
to | address | undefined |
id | uint256 | undefined |
amount | uint256 | undefined |
data | bytes | undefined |
setApprovalForAll
function setApprovalForAll(address operator, bool approved) external nonpayable
See {IERC1155-setApprovalForAll}.
Parameters
Name | Type | Description |
---|
operator | address | undefined |
approved | bool | undefined |
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
Name | Type | Description |
---|
_account | address | undefined |
_tokenID | uint256 | undefined |
_newFractions | uint256[] | undefined |
supportsInterface
function supportsInterface(bytes4 interfaceId) external view returns (bool)
See {IERC165-supportsInterface}.
Parameters
Name | Type | Description |
---|
interfaceId | bytes4 | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
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
Name | Type | Description |
---|
newOwner | address | undefined |
unitsOf
function unitsOf(address account, uint256 tokenID) external view returns (uint256 units)
see {IHypercertToken}
Parameters
Name | Type | Description |
---|
account | address | undefined |
tokenID | uint256 | undefined |
Returns
Name | Type | Description |
---|
units | uint256 | undefined |
unitsOf
function unitsOf(uint256 tokenID) external view returns (uint256 units)
see {IHypercertToken}
Parameters
Name | Type | Description |
---|
tokenID | uint256 | undefined |
Returns
Name | Type | Description |
---|
units | uint256 | undefined |
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
Name | Type | Description |
---|
newImplementation | address | undefined |
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
Name | Type | Description |
---|
newImplementation | address | undefined |
data | bytes | undefined |
uri
function uri(uint256 tokenID) external view returns (string _uri)
see { IHypercertMetadata}
Parameters
Name | Type | Description |
---|
tokenID | uint256 | undefined |
Returns
Name | Type | Description |
---|
_uri | string | undefined |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
Name | Type | Description |
---|
previousAdmin | address | undefined |
newAdmin | address | undefined |
AllowlistCreated
event AllowlistCreated(uint256 tokenID, bytes32 root)
Parameters
Name | Type | Description |
---|
tokenID | uint256 | undefined |
root | bytes32 | undefined |
ApprovalForAll
event ApprovalForAll(address indexed account, address indexed operator, bool approved)
Parameters
Name | Type | Description |
---|
account indexed | address | undefined |
operator indexed | address | undefined |
approved | bool | undefined |
BatchValueTransfer
event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values)
Parameters
Name | Type | Description |
---|
claimIDs | uint256[] | undefined |
fromTokenIDs | uint256[] | undefined |
toTokenIDs | uint256[] | undefined |
values | uint256[] | undefined |
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
Name | Type | Description |
---|
beacon indexed | address | undefined |
ClaimStored
event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits)
Parameters
Name | Type | Description |
---|
claimID indexed | uint256 | undefined |
uri | string | undefined |
totalUnits | uint256 | undefined |
Initialized
event Initialized(uint8 version)
Parameters
Name | Type | Description |
---|
version | uint8 | undefined |
LeafClaimed
event LeafClaimed(uint256 tokenID, bytes32 leaf)
Parameters
Name | Type | Description |
---|
tokenID | uint256 | undefined |
leaf | bytes32 | undefined |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
Name | Type | Description |
---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
Paused
event Paused(address account)
Parameters
Name | Type | Description |
---|
account | address | undefined |
TransferBatch
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)
Parameters
Name | Type | Description |
---|
operator indexed | address | undefined |
from indexed | address | undefined |
to indexed | address | undefined |
ids | uint256[] | undefined |
values | uint256[] | undefined |
TransferSingle
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)
Parameters
Name | Type | Description |
---|
operator indexed | address | undefined |
from indexed | address | undefined |
to indexed | address | undefined |
id | uint256 | undefined |
value | uint256 | undefined |
URI
event URI(string value, uint256 indexed id)
Parameters
Name | Type | Description |
---|
value | string | undefined |
id indexed | uint256 | undefined |
Unpaused
event Unpaused(address account)
Parameters
Name | Type | Description |
---|
account | address | undefined |
Upgraded
event Upgraded(address indexed implementation)
Parameters
Name | Type | Description |
---|
implementation indexed | address | undefined |
ValueTransfer
event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value)
Parameters
Name | Type | Description |
---|
claimID | uint256 | undefined |
fromTokenID | uint256 | undefined |
toTokenID | uint256 | undefined |
value | uint256 | undefined |
Errors
AlreadyClaimed
ArraySize
DoesNotExist
DuplicateEntry
Invalid
NotAllowed
NotApprovedOrOwner
error NotApprovedOrOwner()
TransfersNotAllowed
error TransfersNotAllowed()
TypeMismatch