Skip to content

fxhash/fxhash-evm-core

Repository files navigation

fx(hash)

Docs

Core Contracts

  1. FxContractRegistry: Registry contract that manages all deployed smart contracts registered by fxhash

  2. FxGenArt721: ERC-721 implementation contract that allows for minting of new tokens, burning of existing tokens and managing of token royalties

  3. FxIssuerFactory: Factory contract that clones the FxGenArt721 implementation to create new Generative Art Projects

  4. FxMintTicket721: ERC-721 implementation contract that allows for minting of new tickets, burning of exisiting tickets, and enforcing of harberger taxes over ticket ownership

  5. FxRoleRegistry: Registry contract that implements AccessControl to manage different roles within the system, such as admin, creator, minter, and moderator

  6. FxTicketFactory: Factory contract that clones the FxMintTicket721 implementation to create new Mint Tickets for an existing FxGenArt721 project

Periphery Contracts

  1. DutchAuction: Minter contract that distributes new FxGenArt721 and FxMintTicket721 tokens at a linear price over a fixed interval of time

  2. FixedPrice: Minter contract that distributes new FxGenArt721 and FxMintTicket721 tokens at a fixed price

  3. IPFSRenderer: Renderer contract that constructs offchain metadata of FxGenArt721 and FxMintTicket721 tokens pinned to IPFS

  4. PseudoRandomizer: Randomizer contract that provides a pseudo-randomness keccak256 hash using the token ID, sender's address, current block number, and hash of the previous block

  5. ONCHFSRenderer: Renderer contract that constructs onchain metadata of FxGenArt721 and FxMintTicket721 tokens stored through ONCHFS

  6. TicketRedeemer: Minter contract that burns an existing FxMintTicket721 token and mints a new FxGenArt721 token

Setup

  1. Clone repository
git clone https://github.com/fxhash/fxhash-evm-contracts.git
  1. Create .env file in root directory
DEPLOYER_PRIVATE_KEY=
ETHERSCAN_API_KEY=
GOERLI_RPC_URL=
MAINNET_RPC_URL=
SEPOLIA_RPC_URL=
  1. Install dependencies
forge install
npm ci
  1. Activate husky and commitlint
npx husky install
npx husky add .husky/commit-msg  'npx --no -- commitlint --edit ${1}'
  1. Run tests
npm run test
  1. Run prettier
npm run prettier
  1. Deploy contracts
forge script script/Deploy.s.sol --rpc-url $SEPOLIA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_API_KEY --broadcast
  1. View documentation locally
forge doc --serve --port 3000