FxIssuerFactory

Git Source

Inherits: IFxIssuerFactory, Ownable, Pausable

Author: fx(hash)

See the documentation in {IFxIssuerFactory}

State Variables

roleRegistry

Returns the address of the FxRoleRegistry contract

address public immutable roleRegistry;

implementation

Returns address of current FxGenArt721 implementation contract

address public implementation;

projectId

Returns counter of latest project ID

uint96 public projectId;

nonces

Mapping of deployer address to nonce value for precomputing token address

mapping(address => uint256) public nonces;

projects

Mapping of project ID to address of FxGenArt721 token contract

mapping(uint96 => address) public projects;

Functions

constructor

Initializes factory owner, FxRoleRegistry and FxGenArt721 implementation

constructor(address _admin, address _roleRegistry, address _implementation);

createProjectWithTicket

Creates new generative art project with new mint ticket in single transaction

function createProjectWithTicket(
    bytes calldata _projectCreationInfo,
    bytes calldata _ticketCreationInfo,
    address _ticketFactory
) external whenNotPaused returns (address genArtToken, address mintTicket);

Parameters

NameTypeDescription
_projectCreationInfobytesBytes-encoded data for project creation
_ticketCreationInfobytesBytes-encoded data for ticket creation
_ticketFactoryaddress

Returns

NameTypeDescription
genArtTokenaddressAddress of newly created FxGenArt721 proxy
mintTicketaddressAddress of newly created FxMintTicket721 proxy

unpause

Enables new FxGenArt721 tokens from being created

function unpause() external onlyOwner;

pause

Stops new FxGenArt721 tokens from being created

function pause() external onlyOwner;

setImplementation

Sets new FxGenArt721 implementation contract

function setImplementation(address _implementation) external onlyOwner;

Parameters

NameTypeDescription
_implementationaddressAddress of the implementation contract

createProject

Creates new generative art project with single parameter

function createProject(bytes memory _creationInfo) public returns (address genArt721);

Parameters

NameTypeDescription
_creationInfobytesBytes-encoded data for project creation

Returns

NameTypeDescription
genArt721addressgenArtToken Address of newly created FxGenArt721 proxy

createProjectWithParams

Creates new generative art project

function createProjectWithParams(
    address _owner,
    InitInfo memory _initInfo,
    ProjectInfo memory _projectInfo,
    MetadataInfo memory _metadataInfo,
    MintInfo[] memory _mintInfo,
    address[] memory _royaltyReceivers,
    uint32[] memory _allocations,
    uint96 _basisPoints
) public whenNotPaused returns (address genArtToken);

Parameters

NameTypeDescription
_owneraddressAddress of project owner
_initInfoInitInfoInitialization information
_projectInfoProjectInfoProject information
_metadataInfoMetadataInfoMetadata information
_mintInfoMintInfo[]Array of authorized minter contracts and their reserves
_royaltyReceiversaddress[]Array of addresses receiving royalties
_allocationsuint32[]Array of allocation amounts for calculating royalty shares
_basisPointsuint96Total allocation scalar for calculating royalty shares

Returns

NameTypeDescription
genArtTokenaddressAddress of newly created FxGenArt721 proxy

getTokenAddress

Calculates the CREATE2 address of a new FxGenArt721 proxy

function getTokenAddress(address _sender) external view returns (address);

_setImplementation

Sets the FxGenArt721 implementation contract

function _setImplementation(address _implementation) internal;