RemoteMintable

Git Source

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

NameTypeDescription
policyMintPolicyThe policy configuration to add

Returns

NameTypeDescription
indexuint32Assigned policy index

disableMintPolicy

Disables a mint policy for the set represented by the calling contract

function disableMintPolicy(uint32 index) external override;

Parameters

NameTypeDescription
indexuint32Index 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

NameTypeDescription
indexuint32Index 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

NameTypeDescription
operatoraddressAddress that initiated the mint (typically msg.sender)
toaddressRecipient of the newly minted object
id0uint64Requested object ID (0 = assign automatically)
contextuint256Packed 256-bit context data (see MintingContext)
databytesOptional arbitrary payload passed for custom logic

Returns

NameTypeDescription
supportedbytes4selector Must return onObjectMint.selector to confirm success
iduint64Finalized object ID to be minted

objectMinter

Returns the address of the ObjectMinter contract

function objectMinter() external view override returns (address);

Returns

NameTypeDescription
<none>addressminter 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

NameTypeDescription
interfaceIdbytes4

Returns

NameTypeDescription
<none>booltrue 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();