-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
102 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output-*.json | ||
output-*.json | ||
genesis-rollupID-*.json | ||
output-rollupID-*.json | ||
genesis-base.json | ||
create-genesis-sovereign-params.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Create sovereign genesis | ||
Script to generate the genesis file for a rollup with `SovereignContracts`. This genesis si aim to be used for chains that are run with vanilla clients. | ||
This script should be run after the rollup is created, so its `rollupID` and the bridge initialization parameters are known. | ||
The script does the following: | ||
- read base genesis file | ||
- deploy sovereign cobtracts | ||
- initialize them | ||
|
||
## Setup | ||
- install packages | ||
``` | ||
npm i | ||
``` | ||
|
||
- Set env variables | ||
```` | ||
cp .env.example .env | ||
```` | ||
|
||
Fill `.env` with your `INFURA_PROJECT_ID` and `ETHERSCAN_API_KEY` | ||
|
||
- Copy configuration files: | ||
``` | ||
cp ./tools/createSovereignGenesis/create-genesis-sovereign-params.json.example ./tools/createSovereignGenesis/create-genesis-sovereign-params.json | ||
``` | ||
|
||
- Copy genesis base file: | ||
``` | ||
cp ./tools/createSovereignGenesis/genesis-base.json.example ./tools/createSovereignGenesis/genesis-base.json | ||
``` | ||
|
||
- Set your parameters | ||
- `rollupManagerAddress`: `polygonRollupManager` smart contract address | ||
- `rollupID`: Rollup identifier. Assigned to a rollup when it is created in the contracts | ||
- `chainID`: ChainID of the rollup | ||
- `gasTokenAddress`: Address of the native gas token of the rollup, zero if ether | ||
- `bridgeManager`: bridge manager address | ||
- `sovereignWETHAddress`: sovereign WETH address | ||
- `sovereignWETHAddressIsNotMintable`: Flag to indicate if the wrapped ETH is not mintable | ||
- `globalExitRootUpdater`: Address of globalExitRootUpdater for sovereign chains | ||
- `globalExitRootRemover`: Address of globalExitRootRemover for sovereign chains | ||
|
||
- Run tool: | ||
``` | ||
npx hardhat run ./tools/createSovereignGenesis/create-sovereign-genesis.ts --network sepolia | ||
``` | ||
|
||
### More Info | ||
- All commands are done from root repository | ||
- The output files are: | ||
- `genesis-rollupID-${rollupID}__${timestamp}`: genesis file | ||
- `output-rollupID-${rollupID}__${timestamp}`: input parameters, gastokenAddress information and network used | ||
- outputs are saved in the tool folder: `./tools/createSovereignGenesis` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.