RemoteMintable
Inherits: IRemoteMintable, IObjectMinterAdmin
State Variables
_objectMinter
address internal _objectMinter;
Functions
onlyObjectMinter
modifier onlyObjectMinter();
constructor
constructor(address minter);
addMintPolicy
Adds a new mint policy for the set represented by the calling contract
function addMintPolicy(MintPolicy memory policy) external override returns (uint32 index);
Parameters
Name | Type | Description |
---|---|---|
policy | MintPolicy | The policy configuration to add |
Returns
Name | Type | Description |
---|---|---|
index | uint32 | Assigned policy index |
disableMintPolicy
Disables a mint policy for the set represented by the calling contract
function disableMintPolicy(uint32 index) external override;
Parameters
Name | Type | Description |
---|---|---|
index | uint32 | Index of the policy to disable |
enableMintPolicy
Enables a mint policy for the set represented by the calling contract
function enableMintPolicy(uint32 index) external override;
Parameters
Name | Type | Description |
---|---|---|
index | uint32 | Index of the policy to enable |
onObjectMint
Called by ObjectMinter after payment is collected but before finalizing the mint
If id0
is 0, the contract must assign and return a new object ID.
If id0
is non-zero, the contract must validate and return the same ID.
function onObjectMint(address operator, address to, uint64 id0, uint256 context, bytes memory data)
external
override
onlyObjectMinter
returns (bytes4 supported, uint64 id);
Parameters
Name | Type | Description |
---|---|---|
operator | address | Address that initiated the mint (typically msg.sender) |
to | address | Recipient of the newly minted object |
id0 | uint64 | Requested object ID (0 = assign automatically) |
context | uint256 | Packed 256-bit context data (see MintingContext) |
data | bytes | Optional arbitrary payload passed for custom logic |
Returns
Name | Type | Description |
---|---|---|
supported | bytes4 | selector Must return onObjectMint.selector to confirm success |
id | uint64 | Finalized object ID to be minted |
objectMinter
Returns the address of the ObjectMinter contract
function objectMinter() external view override returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | minter The ObjectMinter address |
supportsInterface
Query if a contract implements an interface
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
function supportsInterface(bytes4 interfaceId) external pure virtual override returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the contract implements interfaceID and interfaceID is not 0xffffffff, false otherwise |
_mint
function _mint(address operator, address to, uint64 id0, uint256 context, bytes memory data)
internal
virtual
returns (uint64 id);
Errors
InvalidObjectMinterAddress
error InvalidObjectMinterAddress();
ObjectIdNotSpecified
error ObjectIdNotSpecified();
CallerNotObjectMinter
error CallerNotObjectMinter();