From d8f7ecb2c90a378c7318f30cba5b3d1bc85980f0 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Mon, 31 Mar 2025 11:40:45 +0100 Subject: [PATCH 1/5] Add CI for custom gas token chains --- .github/workflows/test-all.yml | 42 ++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index e70a8ad..74d13ea 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -15,8 +15,8 @@ env: TransferTo: '0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E' jobs: - test-all: - name: Test all tutorials + test-all-eth: + name: Test all tutorials (ETH-based chain) runs-on: ubuntu-latest steps: - name: Checkout @@ -37,3 +37,41 @@ jobs: - name: Test run: yarn run testAll + + test-all-custom-gas: + name: Test all tutorials (Custom-gas-token chain) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Restore node_modules + uses: OffchainLabs/actions/node-modules/install@main + + - name: Set up the local node + # https://github.com/OffchainLabs/actions/blob/feat-simplify/run-nitro-test-node/action.yml + uses: OffchainLabs/actions/run-nitro-test-node@feat-simplify + with: + nitro-testnode-ref: release + args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token + + - name: Copy .env + run: cp ./.env-sample ./.env + + - name: Modify custom network file + # Some contract addresses are different when using a custom gas token chain + run: > + jq -c ' + .[1].nativeToken = "0xE069078bA9ACCE4eeAE609d8754515Cf13dd6706" | + .[1].ethBridge.rollup = "0xA7c5B54f271844ff9cA8B5da77500180d1aD8899" | + .[1].tokenBridge.parentGatewayRouter = "0x0C085152C2799834fc1603533ff6916fa1FdA302" | + .[1].tokenBridge.parentErc20Gateway = "0x59156b0596689D965Ba707E160e5370AF22461a0" | + .[1].tokenBridge.parentCustomGateway = "0xCe02eA568090ae7d5184B0a98df90f6aa69C1552" | + .[1].tokenBridge.parentWethGateway = "0x0000000000000000000000000000000000000000" | + .[1].tokenBridge.childWethGateway = "0x0000000000000000000000000000000000000000" | + .[1].tokenBridge.parentWeth = "0x0000000000000000000000000000000000000000" | + .[1].tokenBridge.childWeth = "0x0000000000000000000000000000000000000000" + ' customNetwork.json > tmp.customNetwork.json && mv tmp.customNetwork.json customNetwork.json + + - name: Test + run: yarn run testAll From 10209df604032df152f009978e376f72baf74510 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Mon, 31 Mar 2025 12:03:42 +0100 Subject: [PATCH 2/5] Remove .env file step --- .github/workflows/test-all.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 74d13ea..83c087e 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -32,9 +32,6 @@ jobs: nitro-testnode-ref: release args: --tokenbridge --l3node --l3-token-bridge - - name: Copy .env - run: cp ./.env-sample ./.env - - name: Test run: yarn run testAll @@ -54,9 +51,6 @@ jobs: with: nitro-testnode-ref: release args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token - - - name: Copy .env - run: cp ./.env-sample ./.env - name: Modify custom network file # Some contract addresses are different when using a custom gas token chain From 323208bc0841efb62069dda89217f0e8b5ecf573 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Mon, 31 Mar 2025 13:10:21 +0100 Subject: [PATCH 3/5] Send tokens to the main dev account before running tests --- .github/workflows/test-all.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 83c087e..80881aa 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -66,6 +66,11 @@ jobs: .[1].tokenBridge.parentWeth = "0x0000000000000000000000000000000000000000" | .[1].tokenBridge.childWeth = "0x0000000000000000000000000000000000000000" ' customNetwork.json > tmp.customNetwork.json && mv tmp.customNetwork.json customNetwork.json + + - name: Fund main account with native tokens + # In nitro-testnode the account that has native tokens is the L3 rollup owner + # (https://docs.arbitrum.io/run-arbitrum-node/run-local-full-chain-simulation#default-endpoints-and-addresses) + run: cast send -r http://localhost:8547 --private-key 0xecdf21cb41c65afb51f91df408b7656e2c8739a5877f2814add0afd780cc210e 0xE069078bA9ACCE4eeAE609d8754515Cf13dd6706 "transfer(address,uint256)()" 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E 10ether - name: Test run: yarn run testAll From 1eb2c5dd42373fcbbfcc8b251603cdf0d24028da Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Mon, 31 Mar 2025 13:32:19 +0100 Subject: [PATCH 4/5] Use L3 rollup owner for custom gas chain tests --- .github/workflows/test-all.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 80881aa..c18ee26 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -38,6 +38,9 @@ jobs: test-all-custom-gas: name: Test all tutorials (Custom-gas-token chain) runs-on: ubuntu-latest + env: + # We need to use the account that has the native token (the L3 rollup owner) + PRIVATE_KEY: 'ecdf21cb41c65afb51f91df408b7656e2c8739a5877f2814add0afd780cc210e' steps: - name: Checkout uses: actions/checkout@v4 @@ -66,11 +69,6 @@ jobs: .[1].tokenBridge.parentWeth = "0x0000000000000000000000000000000000000000" | .[1].tokenBridge.childWeth = "0x0000000000000000000000000000000000000000" ' customNetwork.json > tmp.customNetwork.json && mv tmp.customNetwork.json customNetwork.json - - - name: Fund main account with native tokens - # In nitro-testnode the account that has native tokens is the L3 rollup owner - # (https://docs.arbitrum.io/run-arbitrum-node/run-local-full-chain-simulation#default-endpoints-and-addresses) - run: cast send -r http://localhost:8547 --private-key 0xecdf21cb41c65afb51f91df408b7656e2c8739a5877f2814add0afd780cc210e 0xE069078bA9ACCE4eeAE609d8754515Cf13dd6706 "transfer(address,uint256)()" 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E 10ether - name: Test run: yarn run testAll From 5cdaf349c264520eb9118ae2bae65eeaa8186aa0 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Wed, 23 Apr 2025 17:58:49 +0100 Subject: [PATCH 5/5] Change rollup contract --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index c18ee26..aad9713 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -60,7 +60,7 @@ jobs: run: > jq -c ' .[1].nativeToken = "0xE069078bA9ACCE4eeAE609d8754515Cf13dd6706" | - .[1].ethBridge.rollup = "0xA7c5B54f271844ff9cA8B5da77500180d1aD8899" | + .[1].ethBridge.rollup = "0x44612A67F6A7c4C894fB4AeA66c7Cfa7A0f0D388" | .[1].tokenBridge.parentGatewayRouter = "0x0C085152C2799834fc1603533ff6916fa1FdA302" | .[1].tokenBridge.parentErc20Gateway = "0x59156b0596689D965Ba707E160e5370AF22461a0" | .[1].tokenBridge.parentCustomGateway = "0xCe02eA568090ae7d5184B0a98df90f6aa69C1552" |