FxGenArt721
Inherits: IFxGenArt721, IERC4906, ERC721, EIP712, Initializable, Ownable, Pausable, RoyaltyManager
Author: fx(hash)
See the documentation in {IFxGenArt721}
State Variables
contractRegistry
Returns address of the FxContractRegistry contract
address public immutable contractRegistry;
roleRegistry
Returns the address of the FxRoleRegistry contract
address public immutable roleRegistry;
nameAndSymbol_
Packed value of name and symbol where combined length is 30 bytes or less
bytes32 internal nameAndSymbol_;
name_
Project name
string internal name_;
symbol_
Project symbol
string internal symbol_;
totalSupply
Returns the current circulating supply of tokens
uint96 public totalSupply;
randomizer
Returns the address of the randomizer contract
address public randomizer;
renderer
Returns the address of the Renderer contract
address public renderer;
nonce
Current nonce for admin signatures
uint96 public nonce;
issuerInfo
Returns the issuer information of the project (primaryReceiver, ProjectInfo)
IssuerInfo public issuerInfo;
metadataInfo
Returns the metadata information of the project (baseURI, onchainPointer)
MetadataInfo public metadataInfo;
genArtInfo
Mapping of token ID to GenArtInfo struct (minter, seed, fxParams)
mapping(uint256 => GenArtInfo) public genArtInfo;
Functions
onlyMinter
Modifier for restricting calls to only registered minters
modifier onlyMinter();
onlyRole
Modifier for restricting calls to only authorized accounts with given role
modifier onlyRole(bytes32 _role);
constructor
Initializes FxContractRegistry and FxRoleRegistry
constructor(address _contractRegistry, address _roleRegistry)
ERC721("FxGenArt721", "FXHASH")
EIP712("FxGenArt721", "1");
initialize
Initializes new generative art project
function initialize(
address _owner,
InitInfo calldata _initInfo,
ProjectInfo memory _projectInfo,
MetadataInfo calldata _metadataInfo,
MintInfo[] calldata _mintInfo,
address[] calldata _royaltyReceivers,
uint32[] calldata _allocations,
uint96 _basisPoints
) external initializer;
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address of token proxy owner |
_initInfo | InitInfo | Initialization information set on project creation |
_projectInfo | ProjectInfo | Project information |
_metadataInfo | MetadataInfo | Metadata information |
_mintInfo | MintInfo[] | Array of authorized minter contracts and their reserves |
_royaltyReceivers | address[] | Array of addresses receiving royalties |
_allocations | uint32[] | Array of allocation amounts for calculating royalty shares |
_basisPoints | uint96 | Total allocation scalar for calculating royalty shares |
burn
Burns token ID from the circulating supply
function burn(uint256 _tokenId) external whenNotPaused;
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | ID of the token |
fulfillSeedRequest
function fulfillSeedRequest(uint256 _tokenId, bytes32 _seed) external;
mint
function mint(address _to, uint256 _amount, uint256) external onlyMinter whenNotPaused;
mintParams
Mints single fxParams token
Only callable by registered minter contracts
function mintParams(address _to, bytes calldata _fxParams) external onlyMinter whenNotPaused;
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving minted token |
_fxParams | bytes | Random sequence of fixed-length bytes used as input |
ownerMint
Mints single token with randomly generated seed
Only callable by contract owner
function ownerMint(address _to) external onlyOwner whenNotPaused;
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving token |
ownerMintParams
Mints single fxParams token
Only callable by contract owner
function ownerMintParams(address _to, bytes calldata _fxParams) external onlyOwner whenNotPaused;
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving minted token |
_fxParams | bytes | Random sequence of fixed-length bytes used as input |
reduceSupply
Reduces maximum supply of collection
function reduceSupply(uint120 _supply) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_supply | uint120 | Maximum supply amount |
registerMinters
Registers minter contracts with resereve info
function registerMinters(MintInfo[] memory _mintInfo) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_mintInfo | MintInfo[] | Mint information of token reserves |
setBaseRoyalties
Sets the base royalties for all secondary token sales
function setBaseRoyalties(address[] calldata _receivers, uint32[] calldata _allocations, uint96 _basisPoints)
external
onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_receivers | address[] | Array of addresses receiving royalties |
_allocations | uint32[] | Array of allocations used to calculate royalty payments |
_basisPoints | uint96 | basis points used to calculate royalty payments |
setBurnEnabled
Sets flag status of public burn to enabled or disabled
function setBurnEnabled(bool _flag) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_flag | bool | Status of burn |
setMintEnabled
Sets flag status of public mint to enabled or disabled
function setMintEnabled(bool _flag) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_flag | bool | Status of mint |
setOnchainPointer
Sets the onchain pointer for reconstructing project metadata onchain
function setOnchainPointer(bytes calldata _onchainData, bytes calldata _signature) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_onchainData | bytes | Bytes-encoded metadata |
_signature | bytes | Signature of creator used to verify metadata update |
setPrimaryReceivers
Sets the primary receiver address for primary sale proceeds
function setPrimaryReceivers(address[] calldata _receivers, uint32[] calldata _allocations) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_receivers | address[] | Array of addresses receiving shares from primary sales |
_allocations | uint32[] | Array of allocation amounts for calculating primary sales shares |
setRenderer
Sets the new renderer contract
function setRenderer(address _renderer, bytes calldata _signature) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_renderer | address | Address of the renderer contract |
_signature | bytes | Signature of creator used to verify renderer update |
setRandomizer
Sets the new randomizer contract
function setRandomizer(address _randomizer) external onlyRole(ADMIN_ROLE);
Parameters
Name | Type | Description |
---|---|---|
_randomizer | address | Address of the randomizer contract |
setBaseURI
Sets the new URI of the token metadata
function setBaseURI(bytes calldata _uri) external onlyRole(METADATA_ROLE);
Parameters
Name | Type | Description |
---|---|---|
_uri | bytes | Decoded content identifier of metadata pointer |
pause
Pauses all function executions where modifier is applied
function pause() external onlyRole(MODERATOR_ROLE);
setTags
Emits an event for setting tag descriptions for the project
function setTags(uint256[] calldata _tagIds) external onlyRole(MODERATOR_ROLE);
Parameters
Name | Type | Description |
---|---|---|
_tagIds | uint256[] | Array of tag IDs describing the project |
unpause
Unpauses all function executions where modifier is applied
function unpause() external onlyRole(MODERATOR_ROLE);
activeMinters
function activeMinters() external view returns (address[] memory);
contractURI
Returns contract-level metadata for storefront marketplaces
function contractURI() external view returns (string memory);
primaryReceiver
function primaryReceiver() external view returns (address);
generateOnchainPointerHash
Generates typed data hash for setting project metadata onchain
function generateOnchainPointerHash(bytes calldata _data) public view returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
_data | bytes | Bytes-encoded onchain data |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | Typed data hash |
generateRendererHash
Generates typed data hash for setting the primary receiver address
function generateRendererHash(address _renderer) public view returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
_renderer | address | Address of the new renderer contract |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | Typed data hash |
isMinter
Gets the authorization status for the given minter contract
function isMinter(address _minter) public view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_minter | address | Address of the minter contract |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Authorization status |
remainingSupply
Returns the remaining supply of tokens left to mint
function remainingSupply() public view returns (uint256);
name
function name() public view override returns (string memory);
symbol
function symbol() public view override returns (string memory);
tokenURI
function tokenURI(uint256 _tokenId) public view override returns (string memory);
_mintParams
Mints single token to given account using fxParams as input
function _mintParams(address _to, uint256 _tokenId, bytes calldata _fxParams) internal;
_mintRandom
Mints single token to given account using randomly generated seed as input
function _mintRandom(address _to, uint256 _tokenId) internal;
_registerMinters
Registers arbitrary number of minter contracts and sets their reserves
function _registerMinters(MintInfo[] memory _mintInfo) internal;
_setBaseRoyalties
Sets receivers and allocations for base royalties of token sales
function _setBaseRoyalties(address[] calldata _receivers, uint32[] calldata _allocations, uint96 _basisPoints)
internal
override;
_setPrimaryReceiver
Sets primary receiver address for token sales
function _setPrimaryReceiver(address[] calldata _receivers, uint32[] calldata _allocations) internal;
_setNameAndSymbol
Packs name and symbol into single slot if combined length is 30 bytes or less
function _setNameAndSymbol(string calldata _name, string calldata _symbol) internal;
_setOnchainPointer
Sets the onchain pointer for reconstructing metadata onchain
function _setOnchainPointer(bytes calldata _onchainData) internal;
_setTags
Emits event for setting the project tag descriptions
function _setTags(uint256[] calldata _tagIds) internal;
_verifySignature
Verifies that a signature was generated for the computed digest
function _verifySignature(bytes32 _digest, bytes calldata _signature) internal;
_isVerified
Checks if creator is verified by the system
function _isVerified(address _creator) internal view returns (bool);
_checkFeeReceiver
Checks if fee receiver and allocation amount are included in their respective arrays
function _checkFeeReceiver(
address[] calldata _receivers,
uint32[] calldata _allocations,
address _feeReceiver,
uint32 _feeAllocation
) internal pure;
_exists
Returns if token id
exists.
function _exists(uint256 _tokenId) internal view override(ERC721, RoyaltyManager) returns (bool);