/web3-eth-contracts

Primary LanguageSolidityApache License 2.0Apache-2.0

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:

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.

Feedback

If you have any feedback, please reach out to us at support@thirdweb.com.

Authors

License

Apache 2.0