Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nojira update scripts #58

Merged
merged 48 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
48c1051
Support ledger & switch to ts
wcgcyx Nov 27, 2023
68faca9
Fix mocha issue
wcgcyx Nov 27, 2023
5543823
Merge pull request #57 from immutable/1993-Hardware-Wallet-Integration
wcgcyx Nov 28, 2023
ac227d3
Fix issues
wcgcyx Dec 2, 2023
d90f3b4
Fix ledge issue with multiple accounts
wcgcyx Dec 4, 2023
acdade4
Fix role control
wcgcyx Dec 5, 2023
5b7ced7
Add create2 contract deployer with access control
ermyas Dec 5, 2023
81747bd
Accept intended owner in constructor
ermyas Dec 5, 2023
3418986
Merge pull request #63 from immutable/add/create2-contract-deployer
ermyas Dec 6, 2023
5608a4e
Merge branch 'develop' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Dec 6, 2023
42debb9
Fix issue
wcgcyx Dec 6, 2023
9e5dddc
Fix defaults
wcgcyx Dec 6, 2023
6e04ccb
Update root_initialisation.ts
wcgcyx Dec 8, 2023
6384295
Fix e2e
wcgcyx Dec 8, 2023
56672af
Fix CI
wcgcyx Dec 8, 2023
e90aa43
Update bootstrap
wcgcyx Dec 8, 2023
d2d9273
Merge branch 'main' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Dec 13, 2023
f9f1c8a
Fix CI
wcgcyx Dec 13, 2023
e5e48a8
Add role on L2
wcgcyx Dec 13, 2023
78ac63d
Update e2e.yml
wcgcyx Dec 13, 2023
b58a234
Add verification of contracts
wcgcyx Dec 13, 2023
3ea5908
Fix CI
wcgcyx Dec 13, 2023
25a5a75
Delete verify.txt
wcgcyx Dec 14, 2023
44cf804
Update helpers.ts
wcgcyx Dec 14, 2023
e989792
Update helpers.ts
wcgcyx Dec 14, 2023
156005a
Improve stability
wcgcyx Dec 14, 2023
bcac3a9
Improve stability again
wcgcyx Dec 14, 2023
11359b3
Update verification
wcgcyx Dec 15, 2023
480d7da
Use Retry provider & Improve stability
wcgcyx Dec 19, 2023
6f5d84a
Update rate configuration
wcgcyx Dec 19, 2023
49f7af9
Fix rate limit for USDC
wcgcyx Dec 19, 2023
52130e5
Merge branch 'main' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Jan 22, 2024
b8a2603
Add more e2e test cases
wcgcyx Jan 29, 2024
1f3db34
Fix CI
wcgcyx Jan 29, 2024
2a730d2
Lint
wcgcyx Jan 29, 2024
9cfd57f
Add test case
wcgcyx Jan 31, 2024
33cbe5c
Merge branch 'main' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Jan 31, 2024
ba85766
Update e2e.yml
wcgcyx Jan 31, 2024
4692803
Merge branch 'main' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Jan 31, 2024
9a678f6
Delete OwnableCreate2Deployer.sol
wcgcyx Feb 11, 2024
f4c7278
Delete OwnableCreate2Deployer.t.sol
wcgcyx Feb 11, 2024
1e83d42
Refactor
wcgcyx Feb 12, 2024
f102a3e
Update e2e.ts
wcgcyx Feb 12, 2024
b3bd113
Update e2e.ts
wcgcyx Feb 12, 2024
ece2260
Update e2e.ts
wcgcyx Feb 12, 2024
e7f5e37
Fix e2e
wcgcyx Feb 12, 2024
edc3b75
Fix e2e
wcgcyx Feb 12, 2024
e79a3f9
Merge branch 'main' into NOJIRA_UPDATE_SCRIPTS
wcgcyx Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-34f684ddfacc5b2ed371353ba6f730c485616ffe
version: nightly-caef1360e29dfefb1723fa501f425e6f7824bf7f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specific nightly builds for Foundry are apparently pruned every few days (see here for more), so it is possible that this build could eventually fail. While they periodically have pinned nightly releases, it is not clear which these are.
I'd suggest we remove the specific version and use "nightly" instead.


- name: Run Forge build
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
- name: Set Node.js 18.18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 18.18.x

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-34f684ddfacc5b2ed371353ba6f730c485616ffe
version: nightly-caef1360e29dfefb1723fa501f425e6f7824bf7f

- name: Run install
uses: borales/actions-yarn@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-34f684ddfacc5b2ed371353ba6f730c485616ffe
version: nightly-caef1360e29dfefb1723fa501f425e6f7824bf7f

- name: Run Forge fmt --check
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-34f684ddfacc5b2ed371353ba6f730c485616ffe
version: nightly-caef1360e29dfefb1723fa501f425e6f7824bf7f

- name: Run Forge build
run: |
Expand Down
7 changes: 7 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extensions": ["ts"],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"test": "forge test",
"lint": "forge fmt",
"local:start": "cd scripts/localdev; ./start.sh",
"local:setup": "cd scripts/localdev; ./deploy.sh",
"local:test": "cd scripts/localdev; npx mocha --require mocha-suppress-logs ../e2e/",
"local:ci": "cd scripts/localdev; ./ci.sh && ./deploy.sh && npx mocha --require mocha-suppress-logs ../e2e/ && ./stop.sh",
"local:setup": "cd scripts/localdev; rm -rf .child.bridge.contracts.json .root.bridge.contracts.json; ./deploy.sh",
"local:test": "cd scripts/localdev; AXELAR_API_URL=skip npx mocha --require mocha-suppress-logs ../e2e/e2e.ts",
"local:ci": "cd scripts/localdev; rm -rf .child.bridge.contracts.json .root.bridge.contracts.json; ./ci.sh && ./deploy.sh && AXELAR_API_URL=skip npx mocha --require mocha-suppress-logs ../e2e/e2e.ts && ./stop.sh",
"local:chainonly": "cd scripts/localdev; LOCAL_CHAIN_ONLY=true ./start.sh",
"local:axelaronly": "cd scripts/localdev; node axelar_setup.js",
"local:axelaronly": "cd scripts/localdev; npx ts-node axelar_setup.ts",
"stop": "cd scripts/localdev; ./stop.sh"
},
"author": "",
Expand All @@ -27,7 +27,10 @@
"@axelar-network/axelar-local-dev": "^2.1.1-alpha.2",
"@axelar-network/axelarjs-sdk": "^0.12.8",
"@ethersproject/hardware-wallets": "^5.7.0",
"@ledgerhq/hw-app-eth": "^6.35.0",
"@ledgerhq/hw-transport-node-hid": "^6.28.0",
"@openzeppelin/contracts": "^4.5.0",
"@types/chai-as-promised": "^7.1.8",
"axios": "^0.27.2",
"bip39": "^3.0.4",
"config": "^3.3.9",
Expand Down
98 changes: 42 additions & 56 deletions scripts/bootstrap/.env.example
Original file line number Diff line number Diff line change
@@ -1,74 +1,56 @@
# Set prior to 1_deployer_funding.js
# Set prior to 0_pre_validation.js
# Name of the child chain MUST match Axelar's definition.
CHILD_CHAIN_NAME=
# The RPC URL of child chain.
CHILD_RPC_URL=
# The chain ID of the child chain.
CHILD_CHAIN_ID=
# Name of the root chain MUST match Axelar's definition.
ROOT_CHAIN_NAME=
# The RPC URL of root chain.
ROOT_RPC_URL=
# The chain ID of the root chain.
ROOT_CHAIN_ID=
## The admin EOA address on the child chain.
CHILD_ADMIN_ADDR=
## The private key for the admin EOA or "ledger" if using hardware wallet.
CHILD_ADMIN_EOA_SECRET=
## The deployer address on child chain.
CHILD_DEPLOYER_ADDR=
## The private key for the deployer on child chain or "ledger" if using hardware wallet.
CHILD_DEPLOYER_SECRET=
## The amount of fund deployer required on L2, unit is in IMX or 10^18 Wei.
CHILD_DEPLOYER_FUND=
## The deployer address on root chain.
ROOT_DEPLOYER_ADDR=
## The private key for the deployer on root chain or "ledger" if using hardware wallet.
ROOT_DEPLOYER_SECRET=
## The private key for rate admin or "ledger" if using hardware wallet.
ROOT_BRIDGE_RATE_ADMIN_SECRET=
## The deployer address on child & root chains.
DEPLOYER_ADDR=
## The private key for the deployer on child & root chains or "ledger" if using hardware wallet.
DEPLOYER_SECRET=
## The ledger index for the deployer on child & root chains, required if using ledger.
DEPLOYER_LEDGER_INDEX=
## The nonce reserved deployer address on child & root chains.
NONCE_RESERVED_DEPLOYER_ADDR=
## The nonce reserved deployer, or "ledger" if using hardware wallet.
NONCE_RESERVED_DEPLOYER_SECRET=
## The ledger index for the nonce reserved deployer.
NONCE_RESERVED_DEPLOYER_INDEX=
## The reserved nonce for token template deployment.
NONCE_RESERVED=
## The IMX token address on root chain.
ROOT_IMX_ADDR=
## The Wrapped ETH token address on the root chain.
ROOT_WETH_ADDR=
## The Axelar address for receive initial funding on the child chain.
## The Axelar address to receive initial funding on the child chain.
AXELAR_EOA=
## The passport nonce reserver
PASSPORT_NONCE_RESERVER_ADDR=
## The amount of fund Axelar requested, unit is in IMX or 10^18 Wei.
AXELAR_FUND=
## The amount of fund deployer to be left with after bootstrapping on L2, unit is in IMX or 10^18 Wei.
CHILD_DEPLOYER_FUND=
## The amount of fund nonce reserved deployer required on L2, unit is in IMX or 10^18 Wei.
CHILD_NONCE_RESERVED_DEPLOYER_FUND=
## The amount of fund passport reserver required on L2, unit is in IMX or 10^18 Wei.
PASSPORT_NONCE_RESERVER_FUND=
## The maximum amount of IMX that can be deposited to L2, unit is in IMX or 10^18 Wei.
IMX_DEPOSIT_LIMIT=
## The address to perform child bridge upgrade.
CHILD_PROXY_ADMIN=
## The address to be assigned with DEFAULT_ADMIN_ROLE in child bridge.
CHILD_BRIDGE_DEFAULT_ADMIN=
## The address to be assigned with PAUSER_ROLE in child bridge.
CHILD_BRIDGE_PAUSER=
## The address to be assigned with UNPAUSER_ROLE in child bridge.
CHILD_BRIDGE_UNPAUSER=
## The address to be assigned with ADAPTOR_MANAGER_ROLE in child bridge.
CHILD_BRIDGE_ADAPTOR_MANAGER=
## The address to be assigned with DEFAULT_ADMIN_ROLE in child adaptor.
CHILD_ADAPTOR_DEFAULT_ADMIN=
## The address to be assigned with BRIDGE_MANAGER_ROLE in child adaptor.
CHILD_ADAPTOR_BRIDGE_MANAGER=
## The address to be assigned with GAS_SERVICE_MANAGER_ROLE in child adaptor.
CHILD_ADAPTOR_GAS_SERVICE_MANAGER=
## The address to be assigned with TARGET_MANAGER_ROLE in child adaptor.
CHILD_ADAPTOR_TARGET_MANAGER=
## The address to perform root adaptor upgrade.
ROOT_PROXY_ADMIN=
## The address to be assigned with DEFAULT_ADMIN_ROLE in root bridge.
ROOT_BRIDGE_DEFAULT_ADMIN=
## The address to be assigned with PAUSER_ROLE in root bridge.
ROOT_BRIDGE_PAUSER=
## The address to be assigned with UNPAUSER_ROLE in root bridge.
ROOT_BRIDGE_UNPAUSER=
## The address to be assigned with VARIABLE_MANAGER_ROLE in root bridge.
ROOT_BRIDGE_VARIABLE_MANAGER=
## The address to be assigned with ADAPTOR_MANAGER_ROLE in root bridge.
ROOT_BRIDGE_ADAPTOR_MANAGER=
## The address to be assigned with DEFAULT_ADMIN_ROLE in root adaptor.
ROOT_ADAPTOR_DEFAULT_ADMIN=
## The address to be assigned with BRIDGE_MANAGER_ROLE in root adaptor.
ROOT_ADAPTOR_BRIDGE_MANAGER=
## The address to be assigned with GAS_SERVICE_MANAGER_ROLE in root adaptor.
ROOT_ADAPTOR_GAS_SERVICE_MANAGER=
## The address to be assigned with TARGET_MANAGER_ROLE in root adaptor.
ROOT_ADAPTOR_TARGET_MANAGER=
## The privileged transaction Multisig address on the root chain.
ROOT_PRIVILEGED_MULTISIG_ADDR=
# The break glass signer address on the root chain.
ROOT_BREAKGLASS_ADDR=
## The privileged transaction Multisig address on the child chain.
CHILD_PRIVILEGED_MULTISIG_ADDR=
# The break glass signer address on the child chain.
CHILD_BREAKGLASS_ADDR=
## The capacity of the rate limit policy of IMX token, unit is in 10^18.
RATE_LIMIT_IMX_CAPACITY=
## The refill rate of the rate limit policy of IMX token, unit is in 10^18.
Expand Down Expand Up @@ -120,6 +102,10 @@ CHILD_GAS_SERVICE_ADDRESS=
MULTISIG_CONTRACT_ADDRESS=
ROOT_GATEWAY_ADDRESS=
ROOT_GAS_SERVICE_ADDRESS=
## (Optional) to verify child contract after deployment
CHILD_CHAIN_BLOCKSCOUT_API_URL=
## (Optional) to verify root contract after deployment
ROOT_CHAIN_ETHERSCAN_API_KEY=

# Set prior to bridge testing
TEST_ACCOUNT_SECRET=
Loading
Loading