Thirdweb Contracts
Looking for version 1? Click here!
Quick start
The @thirdweb-dev/contracts
package gives you access to all contracts and interfaces available in the /contracts
directory of this repository.
Installation:
yarn add @thirdweb-dev/contracts
Usage:
@thirdweb-dev/contracts
can be used in your Solidity project just like other popular libraries e.g. @openzeppelin/contracts
. Once you've installed the package, import the relevant resources from the package as follows:
// Example usage
import "@thirdweb-dev/contracts/contracts/interfaces/token/TokenERC721.sol";
contract MyNFT is TokenERC721 { ... }
Run locally
Clone the repository:
git clone https://github.com/thirdweb-dev/contracts.git
This repository is a hybrid hardhat and forge project.
First install the relevant dependencies of the project:
yarn
forge install
To compile contracts, run:
forge build
Or, if you prefer hardhat, you can run:
npx hardhat compile
To run tests:
forge test
To export the ABIs of the contracts in the /contracts
directory, run:
npx hardhat export-abi
To run any scripts in the /scripts
directory, run:
npx hardhat run scripts/{path to the script}
Deployments
The thirdweb registry (TWRegistry
) and factory (TWFactory
) have been deployed on the following chains:
- Ethereum mainnet
- Rinkeby
- Goerli
- Polygon mainnet
- Polygon Mumbai testnet
- Avalanche mainnet
- Avalanche Fuji testnet
- Fantom mainnet
- Fantom testnet
TWRegistry
is deployed to a common address on all mentioned networks. TWFactory
is deployed to a common address on all mentioned networks except Fantom mainnet.
-
TWRegistry
: 0x7c487845f98938Bb955B1D5AD069d9a30e4131fd -
TWFactory
: 0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0 -
TWFactory
(Fantom mainnet): 0x97EA0Fcc552D5A8Fb5e9101316AAd0D62Ea0876B
Feedback
If you have any feedback, please reach out to us at support@thirdweb.com.