1- # Thirdweb Contracts
1+ <p align =" center " >
2+ <br />
3+ <a href =" https://thirdweb.com " ><img src =" https://github.com/thirdweb-dev/typescript-sdk/blob/main/logo.svg?raw=true " width =" 200 " alt =" " ></a >
4+ <br />
5+ </p >
6+ <h1 align =" center " >Thirdweb Contracts</h1 >
7+ <p align =" center " >
8+ <a href =" https://www.npmjs.com/package/@thirdweb-dev/contracts " ><img src =" https://img.shields.io/npm/v/@thirdweb-dev/contracts?color=red&logo=npm " alt =" npm version " ></a >
9+ <a href =" https://github.com/thirdweb-dev/contracts/actions " ><img alt =" Build Status " src =" https://github.com/thirdweb-dev/contracts/actions/workflows/tests.yml/badge.svg " ></a >
10+ <a href =" https://discord.gg/thirdweb " ><img alt =" Join our Discord! " src =" https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat " ></a >
11+
12+ </p >
13+ <p align =" center " ><strong >Collection of smart contracts deployable via thirdweb dashboard and CLI</strong ></p >
14+ <br />
15+
16+ ## Installation
17+
18+ ``` shell
19+ npm i @thirdweb-dev/contracts
20+ ```
221
3- > Looking for version 1? Click [ here ] ( https://github.com/thirdweb-dev/contracts/tree/v1 ) !
22+ ## Usage
423
5- ## Quick start
24+ ``` solidity
25+ // SPDX-License-Identifier: MIT
26+ pragma solidity ^0.8.4;
627
7- ### BYOC Deployments - (new)
28+ import "@thirdweb-dev/contracts/ThirdwebContract.sol";
829
9- ### ByocRegistry - Mumbai
10- - ` TWRegistry ` : [ 0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C] ( https://blockscan.com/address/0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C#code )
30+ contract HellowWorldContract is ThirdwebContract {
31+ // your contract code
32+ }
1133
12- - ` ByocRegistry ` : [ 0x61Bb02795b4fF5248169A54D9f149C4557B0B7de ] ( https://mumbai.polygonscan.com/address/0x61Bb02795b4fF5248169A54D9f149C4557B0B7de#code )
34+ ```
1335
14- - ` ByocFactory ` : [ 0x3c3D901Acb5f7746dCf06B26fCe881d21970d2B6 ] ( https://mumbai.polygonscan. com/address/0x3c3D901Acb5f7746dCf06B26fCe881d21970d2B6#code )
36+ By extending ` ThirdwebContract ` you can use the [ thirdeb cli ] ( https://github. com/[thirdweb-dev/thirdweb-cli ) to publish, deploy and manage your contracts on your [ thirdweb dashboard ] ( https://thirdweb.com/dashboard ) .
1537
16- ### BYOC Deployments - (previous)
38+ ## Deployed addresses
1739
18- ` @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:
40+ ### Production
1941
20- ``` solidity
21- // Example usage
42+ - ` TWRegistry ` : [ 0x7c487845f98938Bb955B1D5AD069d9a30e4131fd] ( https://blockscan.com/address/0x7c487845f98938Bb955B1D5AD069d9a30e4131fd )
2243
23- import "@thirdweb-dev/contracts/interfaces/token/TokenERC721.sol";
44+ - ` TWFactory ` : [ 0x11c34F062Cb10a20B9F463E12Ff9dA62D76FDf65 ] ( https://blockscan.com/address/0x11c34F062Cb10a20B9F463E12Ff9dA62D76FDf65 )
2445
25- contract MyNFT is TokenERC721 { ... }
26- ```
46+ ### Dev - (Mumbai only)
2747
28- ## Run locally
48+ - ` TWRegistry ` : [ 0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C ] ( https://blockscan.com/address/0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C#code )
2949
30- ### Deployments (prod)
31- - ` TWRegistry ` : [ 0x7c487845f98938Bb955B1D5AD069d9a30e4131fd] ( https://blockscan.com/address/0x7c487845f98938Bb955B1D5AD069d9a30e4131fd )
50+ - ` ByocRegistry ` : [ 0x61Bb02795b4fF5248169A54D9f149C4557B0B7de] ( https://mumbai.polygonscan.com/address/0x61Bb02795b4fF5248169A54D9f149C4557B0B7de#code )
3251
33- - ` TWFactory ` : [ 0x11c34F062Cb10a20B9F463E12Ff9dA62D76FDf65 ] ( https://blockscan. com/address/0x11c34F062Cb10a20B9F463E12Ff9dA62D76FDf65 )
52+ - ` ByocFactory ` : [ 0x3c3D901Acb5f7746dCf06B26fCe881d21970d2B6 ] ( https://mumbai.polygonscan. com/address/0x3c3D901Acb5f7746dCf06B26fCe881d21970d2B6#code )
3453
3554## Running Tests
55+
36561 . ` yarn ` : install contracts dependencies
37572 . ` forge install ` : install tests dependencies
38583 . ` forge test ` : run the tests
3959
4060This repository is a hybrid [ hardhat] ( https://hardhat.org/ ) and [ forge] ( https://github.com/foundry-rs/foundry/tree/master/forge ) project.
4161
4262First install the relevant dependencies of the project:
63+
4364``` bash
4465yarn
4566
4667forge install
4768```
4869
4970To compile contracts, run:
71+
5072``` bash
5173forge build
5274```
5375
5476Or, if you prefer hardhat, you can run:
77+
5578``` bash
5679npx hardhat compile
5780```
5881
59-
6082To run tests:
83+
6184``` bash
6285forge test
6386```
6487
6588To export the ABIs of the contracts in the ` /contracts ` directory, run:
89+
6690```
6791npx hardhat export-abi
6892```
6993
7094To run any scripts in the ` /scripts ` directory, run:
95+
7196```
7297npx hardhat run scripts/{path to the script}
7398```
7499
75100## Deployments
76101
77102The thirdweb registry (` TWRegistry ` ) and factory (` TWFactory ` ) have been deployed on the following chains:
103+
78104- [ Ethereum mainnet] ( https://etherscan.io/ )
79105- [ Rinkeby] ( https://rinkeby.etherscan.io/ )
80106- [ Goerli] ( https://goerli.etherscan.io/ )
@@ -90,7 +116,6 @@ The thirdweb registry (`TWRegistry`) and factory (`TWFactory`) have been deploye
90116- ` TWRegistry ` : [ 0x7c487845f98938Bb955B1D5AD069d9a30e4131fd] ( https://blockscan.com/address/0x7c487845f98938Bb955B1D5AD069d9a30e4131fd )
91117
92118- ` TWFactory ` : [ 0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0] ( https://blockscan.com/address/0x5DBC7B840baa9daBcBe9D2492E45D7244B54A2A0 )
93-
94119- ` TWFactory ` (Fantom mainnet): [ 0x97EA0Fcc552D5A8Fb5e9101316AAd0D62Ea0876B] ( https://blockscan.com/address/0x97EA0Fcc552D5A8Fb5e9101316AAd0D62Ea0876B )
95120
96121## Feedback
0 commit comments