ObjectMinter
Inherits: IObjectMinter, ObjectMinterErrors, ReentrancyGuard, OwnableUpgradeable, UUPSUpgradeable
State Variables
OBJECTMINTER_STORAGE_LOCATION
keccak256(abi.encode(uint256(keccak256("every.storage.ObjectMinter")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OBJECTMINTER_STORAGE_LOCATION =
0x9579d02970471cd8d5ac819714a969ec86c15010903f2a1dfec179aa98f14b00;
Functions
_getObjectMinterStorage
function _getObjectMinterStorage() private pure returns (ObjectMinterStorage storage $);
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal virtual override onlyOwner;
semver
function semver() external pure returns (uint32 version);
initialize
function initialize(address owner, address feeRecipient, uint16 feeBps) public initializer;
setFeeConfig
function setFeeConfig(address set, address feeRecipient, uint16 feeBps) external onlyOwner;
mint
Mint an object (public permission)
function mint(address to, address set, uint64 id) external payable override nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
to | address | The recipient address |
set | address | The set address |
id | uint64 | The object ID to mint |
mint
Mint an object (public permission)
function mint(address to, address set, uint64 id, bytes memory data) external payable override nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
to | address | The recipient address |
set | address | The set address |
id | uint64 | The object ID to mint |
data | bytes |
mint
Mint an object (public permission)
function mint(address to, address set, uint64 id, bytes memory auth, uint32 policy)
external
payable
override
nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
to | address | The recipient address |
set | address | The set address |
id | uint64 | The object ID to mint |
auth | bytes | |
policy | uint32 |
mint
Mint an object (public permission)
function mint(address to, address set, uint64 id, bytes memory data, bytes memory auth, uint32 policy)
external
payable
override
nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
to | address | The recipient address |
set | address | The set address |
id | uint64 | The object ID to mint |
data | bytes | |
auth | bytes | |
policy | uint32 |
mintPolicyAdd
Add a new mint policy (callable only by set contracts)
function mintPolicyAdd(MintPolicy memory policy) external override returns (uint32 index);
Parameters
Name | Type | Description |
---|---|---|
policy | MintPolicy | The policy details to add |
Returns
Name | Type | Description |
---|---|---|
index | uint32 | The assigned policy index |
mintPolicyEnable
Enable a mint policy (callable only by set contracts)
function mintPolicyEnable(uint32 index) external override;
Parameters
Name | Type | Description |
---|---|---|
index | uint32 | The policy index to enable |
mintPolicyDisable
Disable a mint policy (callable only by set contracts)
function mintPolicyDisable(uint32 index) external override;
Parameters
Name | Type | Description |
---|---|---|
index | uint32 | The policy index to disable |
mintPolicyCount
Get number of mint policies for a set
function mintPolicyCount(address set) external view override returns (uint256 count);
Parameters
Name | Type | Description |
---|---|---|
set | address | The set address to query |
Returns
Name | Type | Description |
---|---|---|
count | uint256 | Number of policies |
mintPolicyGet
Get mint policy by index
function mintPolicyGet(address set, uint32 index) external view override returns (MintPolicy memory policy);
Parameters
Name | Type | Description |
---|---|---|
set | address | The set address |
index | uint32 | Policy index |
Returns
Name | Type | Description |
---|---|---|
policy | MintPolicy | The mint policy details |
mintPolicySearch
Search for applicable mint policy with permission mask
function mintPolicySearch(address set, uint64 id, uint8 mask)
external
view
override
returns (MintPolicy memory policy);
Parameters
Name | Type | Description |
---|---|---|
set | address | The set address |
id | uint64 | The object ID to check |
mask | uint8 | Bitmask indicating which MintPermissionType values are included. Each bit corresponds to a permission type (e.g., bit 0 = Public, bit 1 = Allowlist, etc.). |
Returns
Name | Type | Description |
---|---|---|
policy | MintPolicy | The first matching mint policy |
mintPolicySearch
Search for applicable mint policy with permission mask
function mintPolicySearch(address set, uint64 id, uint8 mask, uint32 offset)
external
view
override
returns (MintPolicy memory policy);
Parameters
Name | Type | Description |
---|---|---|
set | address | The set address |
id | uint64 | The object ID to check |
mask | uint8 | Bitmask indicating which MintPermissionType values are included. Each bit corresponds to a permission type (e.g., bit 0 = Public, bit 1 = Allowlist, etc.). |
offset | uint32 |
Returns
Name | Type | Description |
---|---|---|
policy | MintPolicy | The first matching mint policy |
_validateMintableContract
function _validateMintableContract(address contractAddr) private view;
_validatePolicy
function _validatePolicy(MintPolicy memory p) private pure;
_searchMintPolicy
function _searchMintPolicy(address set, uint64 id, uint32 offset, uint8 mask)
private
view
returns (MintPolicy memory);
_mint
function _mint(address to, address set, uint64 id, bytes memory data, bytes memory auth, uint32 policy) private;
_checkPolicy
function _checkPolicy(address set, uint64 id, uint32 index) private view returns (MintPolicy memory policy);
_authorize
function _authorize(MintPolicy memory policy, address user, bytes memory auth)
private
pure
returns (MintPolicy memory);
_preMint
function _preMint(MintPolicy memory policy, address user, address set) private;
_callMint
function _callMint(MintPolicy memory policy, address operator, address to, address set, uint64 id, bytes memory data)
private
returns (uint64);
_postMint
function _postMint(MintPolicy memory policy, address operator, address to, address set, uint64 id) private;
_computeSplit
function _computeSplit(address set, uint96 totalAmount)
private
view
returns (uint96 creatorAmount, uint96 protocolAmount, address protocolRecipient);
_collectPayment
function _collectPayment(address currency, address from, uint96 amount) private;
_disbursePayment
function _disbursePayment(address currency, address to, uint96 amount) private;
Structs
FeeConfig
Protocol fee configuration for a specific set or the default fallback
struct FeeConfig {
uint16 status;
uint16 bps;
address recipient;
}
ObjectMinterStorage
Note: storage-location: erc7201:every.storage.ObjectMinter
struct ObjectMinterStorage {
FeeConfig defaultFeeConfig;
mapping(address => FeeConfig) feeConfigs;
mapping(address => MintPolicy[]) policies;
mapping(address => mapping(address => uint256)) minted;
}