You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Hardhat is used to manage the contract development environment and deployment.
97
97
This repository provides a couple of Hardhat tasks to simplify the deployment process.
98
98
99
-
Instead of combining the deployment of the token contracts and chain managers into a single Hardhat task, the deployment is split into smaller tasks so that any one of these individual tasks can be run on its own when needed.
100
-
For instance, one may prefer to deploy the token contracts without the chain managers first.
101
-
102
-
> 💡 The configurations of the network and accounts are in `hardhat.config.ts`.
103
-
> The deployer will be the first account of the network.
--chain Chain ('ethereum' or 'polygon') to deploy token (default: "ethereum")
113
-
--mintable Mintability of the token
106
+
--network Name of network
114
107
--name Name of the token
115
108
--symbol Symbol of token
116
109
--verify Verify on Etherscan
117
110
118
111
deploy:token: Deploys the TradeTrustERC721 token
119
112
```
120
-
> 💡 Note that the `--chain` argument is optional. If not provided, the default chain will always be the root chain, `ethereum`.
121
-
> The `--mintable` and `--verify` flags are optional.
122
-
123
-
> 💡 The `--mintable` flag specifies whether a token is mintable on L2, for example, Polygon.
124
-
> If the intention is to mint the tokens on L1, the `--mintable` flag is not necessary.
125
-
126
-
#### Example
127
-
```
128
-
npx hardhat deploy:token --name "The Great Shipping Co." --symbol GSC --chain polygon --network mumbai --mintable --verify
129
-
```
130
-
This uses the _mintable_ contract meant for the _Polygon_ chain and deploys it to the Polygon's _Mumbai_ network. The token will be deployed with the name _The Great Shipping Co._ under the symbol _GSC_.
131
-
The contract source will also be _verified_ on Etherscan.
132
-
133
-
## Chain Managers
134
-
The Chain Managers can be deployed and used to bridge the tokens between Ethereum and Polygon. They are not needed if the intention is to remain on a blockchain only.
135
-
136
-
> ⚠️ Transferring of documents across chains currently only works when the address of the token registry is the same between them.
137
-
138
-
The deployment of the Chain Managers mainly involves 3 steps.
--check-point-manager Address of Checkpoint Manager (default: "0x2890bA17EfE978480615e330ecB65333b880928e")
147
-
--fx-root Address of FxRoot (default: "0x3d1d3E34f7fB6D26245E6640E1c50710eFFf15bA")
148
-
--token Address of Root Token
149
-
--verify Verify on Etherscan
150
-
151
-
deploy:cm:root: Deploys the root chain manager
152
-
```
153
-
> 💡 The `--check-point-manager` and `--fx-root` parameters are optional.
154
-
> The default value of these parameters will refer to the addresses on the mainnet if the env variable value of `NODE_ENV` is `production`. Otherwise, the default values will refer to the addresses on the testnet.
--fx-child Address of FxChild (default: "0xCf73231F28B7331BBe3124B907840A94851f9f11")
171
-
--verify Verify on Etherscan
172
-
173
-
deploy:cm:child: Deploys the child chain manager
174
-
```
175
-
> 💡 The `--fx-child` parameter is optional.
176
-
> Its default value refers to the addresses on the mainnet if the env variable value of `NODE_ENV` is `production`. Otherwise, the default value will refer to the address on the testnet.
114
+
> 💡 Remember to supply the`--network` argument with the name of the network you wish to deploy on.
115
+
> See section below for more info on the list of network names.
This example will link up the root chain manager located at `0xRootChainManagerAddress` on the Ethereum _Goerli_ network to the child chain manager located at `0xChildChainManagerAddress` on the Polygon _Mumbai_ network. Notice that the name of the child network is provided to `--child-network`.
134
+
> 💡 You can configure existing and add other networks you wish to deploy to in the `hardhat.config.ts` file.
205
135
206
136
## Verification
207
137
When verifying the contracts through either the Hardhat's verify plugin or passing the `--verify` flag to the deployment tasks (which internally uses the same plugin), you will need to set `ETHERSCAN_API_KEY` in your environment to your Etherscan API key.
0 commit comments