Introduction
#
An introduction to the ZORA V3 smart contracts#
V3 Core AddressesSource code for all ZORA V3 contracts can be found in this GitHub repository.
#
Mainnet Deployments#
Ethereum - 1Contract | Address |
---|---|
Module Manager | 0x850A7c6fE2CF48eea1393554C8A3bA23f20CC401 |
ERC-721 TransferHelper | 0x909e9efE4D87d1a6018C2065aE642b6D0447bc91 |
ERC-20 TransferHelper | 0xCCA379FDF4Beda63c4bB0e2A3179Ae62c8716794 |
Protocol Fee Settings | 0x9641169A1374b77E052E1001c5a096C29Cd67d35 |
#
Polygon - 137Contract | Address |
---|---|
Module Manager | 0xCCA379FDF4Beda63c4bB0e2A3179Ae62c8716794 |
ERC-721 TransferHelper | 0xCe6cEf2A9028e1C3B21647ae3B4251038109f42a |
ERC-20 TransferHelper | 0x909e9efE4D87d1a6018C2065aE642b6D0447bc91 |
Protocol Fee Settings | 0x9641169A1374b77E052E1001c5a096C29Cd67d35 |
#
Testnet Deployments#
Goerli - 5Contract | Address |
---|---|
Module Manager | 0x9458E29713B98BF452ee9B2C099289f533A5F377 |
ERC-721 TransferHelper | 0xd1adAF05575295710dE1145c3c9427c364A70a7f |
ERC-20 TransferHelper | 0x53172d999a299198a935f9E424f9f8544e3d4292 |
Protocol Fee Settings | 0x5f7072E1fA7c01dfAc7Cf54289621AFAaD2184d0 |
#
Mumbai - 80001Contract | Address |
---|---|
Module Manager | 0x850A7c6fE2CF48eea1393554C8A3bA23f20CC401 |
ERC-721 TransferHelper | 0x909e9efE4D87d1a6018C2065aE642b6D0447bc91 |
ERC-20 TransferHelper | 0xCCA379FDF4Beda63c4bB0e2A3179Ae62c8716794 |
Protocol Fee Settings | 0x9641169A1374b77E052E1001c5a096C29Cd67d35 |
note
The addresses for specific ZORA modules can be found in the Modules folder linked in the chart below.
#
Supported V3 ModulesModule Name | Mainnet Deployment | V3 Package | API |
---|---|---|---|
Asks | ✅ | ✅ | ✅ |
Reserve Auction | ✅ | ✅ | ✅ |
Offers | ✅ | ✅ | Soon ™️ |
#
Getting Started#
Installing the V3 PackageYou can begin building with ZORA V3 by installing the v3 package.
This package provides ZORA contract address, ABIs, and supports typechain
to make it easier to get started.
- Yarn
- NPM
yarn add @zoralabs/v3
npm i -S @zoralabs/v3
Source code for all ZORA V3 contracts can be found in this GitHub repository. If you are interested to contributing to ZORA V3 you can learn more here.
ZORA V3 is comprised of a few core contracts and an ever-expanding set of modules. Modules are non-upgradable contracts that add specific functionality to the protocol.
Modules: Contracts with specific functionality that can be added to ZORA V3
Module Manager: Manages which modules a user has approved to use their tokens and which new modules can be added to the protocol
Transfer Helpers: Handles transferring ERC-20 and ERC-721 tokens for the modules
#
Approving Tokens to V3Tokens must first be approved to their respective Transfer Helper contracts before being able to be used by the ZORA modules. For example, all ERC-721 token approvals must be made to the ERC-721 Transfer Helper. Once completed, the user will then need to approve which modules can access their approved tokens by submitting a transaction to the Module Manager. This means that a user will only need to approve each token contract to ZORA V3 once and then approve which ZORA modules can access to their tokens.
note
We have created a guide on ZORA V3 approvals if you would like to learn more.
Lastly, if a user is trying to make a purchase with just ETH then they don't need to approve Transfer Helpers or ZORA modules.
#
Approving ModulesUsers can either approve a single ZORA module or selectively batch approve certain modules. Every time a new module is added to the protocol a user must opt in and approve the newly added module to access to their tokens. Approving a module means that all tokens that have been approved to the Transfer Helpers will be able to be accessed by that module.
#
setApprovalForModuleApproves a single module to access a user's tokens.
setApprovalForModule(address _moduleAddress, bool _approved)
#
setBatchApprovalForModulesApproves a series of modules to access a user's tokens.
setBatchApprovalForModules( address[] memory _moduleAddresses, bool _approved)
#
setApprovalForModuleBySigSets approval for a module given an EIP-712 signature
setApprovalForModuleBySig( address _module, address _user, bool _approved, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s)