|
1 |
| -# fireblocks-smart-contracts |
| 1 | +# Fireblocks Smart Contracts |
| 2 | + |
| 3 | +Welcome to the Fireblocks Smart Contracts repository. This repository is built using [Hardhat](https://hardhat.org/) and contains the smart contracts that power the **Fireblocks Tokenization** product. These contracts are designed to streamline token creation, management, and utility, integrating seamlessly with the Fireblocks workspace. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Overview](#overview) |
| 10 | +- [Smart Contracts](#smart-contracts) |
| 11 | + - [ERC20F](#erc20f) |
| 12 | + - [ERC721F](#erc721f) |
| 13 | + - [ERC1155F](#erc1155f) |
| 14 | + - [Allowlist](#allowlist) |
| 15 | + - [Denylist](#denylist) |
| 16 | + - [UUPS Proxy](#uups-proxy) |
| 17 | + - [Trusted Forwarder](#trusted-forwarder) |
| 18 | +- [Gasless Variants](#gasless-variants) |
| 19 | +- [Gasless Upgrades](#gasless-upgrades) |
| 20 | +- [Getting Started](#getting-started) |
| 21 | + - [Prerequisites](#prerequisites) |
| 22 | + - [Setup](#setup) |
| 23 | + - [Compile](#compile) |
| 24 | + - [Verify](#verify) |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Overview |
| 29 | + |
| 30 | +The Fireblocks Smart Contracts repository includes upgradeable templates for issuing and managing fungible, non-fungible, and semi-fungible tokens. These contracts are designed for: |
| 31 | + |
| 32 | +- Tokenizing assets |
| 33 | +- Managing access controls |
| 34 | +- Reducing gas costs |
| 35 | +- Ensuring compatibility with Fireblocks workflows |
| 36 | + |
| 37 | +Each contract uses the [UUPS proxy pattern](https://eips.ethereum.org/EIPS/eip-1822) for upgrades, maintaining state and functionality while enabling improvements over time. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Smart Contracts |
| 42 | + |
| 43 | +### [ERC20F](./contracts/ERC20F.sol) |
| 44 | + |
| 45 | +An upgradeable ERC-20 token template for: |
| 46 | + |
| 47 | +- Serving as a unit of account |
| 48 | +- Issuing stablecoins or CBDCs |
| 49 | +- Supporting tokenized fundraising |
| 50 | +- Recovering funds from blacklisted accounts |
| 51 | + |
| 52 | +### [ERC721F](./contracts/ERC721F.sol) |
| 53 | + |
| 54 | +An upgradeable ERC-721 token template for: |
| 55 | + |
| 56 | +- Creating unique NFTs (e.g., collectibles, artwork, in-game items) |
| 57 | +- Tracking token ownership and metadata |
| 58 | +- Reflecting rarity, age, or other attributes |
| 59 | + |
| 60 | +### [ERC1155F](./contracts/ERC1155F.sol) |
| 61 | + |
| 62 | +An upgradeable ERC-1155 token template for: |
| 63 | + |
| 64 | +- Representing semi-fungible tokens (SFTs) |
| 65 | +- Bundling multiple token types in one contract |
| 66 | +- Reducing deployment costs |
| 67 | + |
| 68 | +### [AllowList](./contracts/library/AccessRegistry/AllowList.sol) |
| 69 | + |
| 70 | +A utility contract for managing access control via an allowlist of approved addresses. Supports: |
| 71 | + |
| 72 | +- Integration with Fireblocks ERC-20F, ERC-721F, and ERC-1155F contracts |
| 73 | +- Shared usage across multiple token contracts |
| 74 | +- Upgradeability via the UUPS proxy pattern |
| 75 | + |
| 76 | +### [DenyList](./contracts/library/AccessRegistry/DenyList.sol) |
| 77 | + |
| 78 | +A utility contract for managing access control via a denylist of restricted addresses. Supports: |
| 79 | + |
| 80 | +- Integration with Fireblocks ERC-20F, ERC-721F, and ERC-1155F contracts |
| 81 | +- Shared usage across multiple token contracts |
| 82 | +- Upgradeability via the UUPS proxy pattern |
| 83 | + |
| 84 | +### [UUPS Proxy](./contracts/library/Proxy/Proxy.sol) |
| 85 | + |
| 86 | +Provides upgradeable functionality for all smart contracts using the UUPS proxy pattern, ensuring flexibility and forward compatibility. |
| 87 | + |
| 88 | +### [Trusted Forwarder](./contracts/gasless-contracts/TrustedForwarder.sol) |
| 89 | + |
| 90 | +Enables seamless meta-transactions, supporting off-chain signing and gasless interactions with Fireblocks token contracts. |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## Gasless Variants |
| 95 | + |
| 96 | +This repository also includes **gasless versions** via the following contracts: |
| 97 | + |
| 98 | +- [ERC20FGasless](./contracts/gasless-contracts/ERC20FGasless.sol) |
| 99 | +- [ERC721FGasless](./contracts/gasless-contracts/ERC721FGasless.sol) |
| 100 | +- [ERC1155FGasless](./contracts/gasless-contracts/ERC1155FGasless.sol) |
| 101 | +- [AllowlistGasless](./contracts/gasless-contracts/AccessRegistry/AllowListGasless.sol) |
| 102 | +- [DenylistGasless](./contracts/gasless-contracts/AccessRegistry/DenylistGasless.sol) |
| 103 | + |
| 104 | +These variants use the ERC2771 standard and allow users to perform transactions without requiring them to pay gas fees, enhancing usability and accessibility. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## Gasless Upgrades |
| 109 | + |
| 110 | +Additionally, this repository provides contracts for upgrading from the standard contracts to the gasless variants (If you have already deployed the standard contracts): |
| 111 | + |
| 112 | +- [ERC20FV2](./contracts/gasless-upgrades/ERC20FV2.sol) |
| 113 | +- [ERC721FV2](./contracts/gasless-upgrades/ERC721FV2.sol) |
| 114 | +- [ERC1155FV2](./contracts/gasless-upgrades/ERC1155FV2.sol) |
| 115 | +- [AllowlistV2](./contracts/gasless-upgrades/AccessRegistry/AllowListV2.sol) |
| 116 | +- [DenylistV2](./contracts/gasless-upgrades/AccessRegistry/DenyListV2.sol) |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +## Getting Started |
| 121 | + |
| 122 | +### Prerequisites |
| 123 | + |
| 124 | +1. Install [Node.js](https://nodejs.org/). |
| 125 | + |
| 126 | +### Setup |
| 127 | + |
| 128 | +Clone the repository and install dependencies: |
| 129 | + |
| 130 | +```bash |
| 131 | +git clone https://github.com/fireblocks/fireblocks-smart-contracts.git |
| 132 | +cd fireblocks-smart-contracts |
| 133 | +npm install |
| 134 | +``` |
| 135 | + |
| 136 | +### Compile |
| 137 | +```bash |
| 138 | +npx hardhat compile |
| 139 | +``` |
| 140 | + |
| 141 | +### Verify |
| 142 | +Verify, dont trust. Always make sure your deployed bytecode matches the bytecode in the [artifacts](./artifacts/) directory |
0 commit comments