Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f9101f5
first commit
godzillaba Feb 13, 2024
5082cc5
update readme
godzillaba Feb 13, 2024
cde0e5f
package.json
godzillaba Feb 13, 2024
2f4dcd9
hardhat init
godzillaba Feb 13, 2024
b0e6f9b
foundry init
godzillaba Feb 13, 2024
6d422a4
Counter
godzillaba Feb 13, 2024
bc5f3b8
package.json
godzillaba Feb 13, 2024
239a06a
Merge branch 'main' into hardhat-foundry-ethers-v6
godzillaba Feb 13, 2024
aa31614
Merge pull request #1 from OffchainLabs/hardhat-foundry-ethers-v6
godzillaba Feb 13, 2024
87ec434
sync compiler settings
godzillaba Feb 13, 2024
c28bb95
typo
godzillaba Feb 13, 2024
20d50a0
update readme
godzillaba Feb 13, 2024
bf93fee
Formatting (#3)
godzillaba Feb 14, 2024
0c8c0f8
Misc CI (#5)
godzillaba Feb 14, 2024
a79e748
Fork tests (#7)
godzillaba Feb 15, 2024
c6c05c9
e2e test (#8)
godzillaba Feb 22, 2024
c12d75f
Audit (#9)
godzillaba Feb 22, 2024
8aa9ed6
minimal-publish (#10)
godzillaba Feb 22, 2024
b199f71
Update README.md
godzillaba Feb 22, 2024
9b4f94a
publish.bash
godzillaba Feb 22, 2024
0772589
separate files for jobs (#12)
godzillaba Feb 23, 2024
245bb44
fix: yarn and misc improvements (#13)
gzeoneth Feb 27, 2024
2770d48
document disabling e2e (#14)
godzillaba Feb 27, 2024
380fc79
fix: script path
gzeoneth Feb 29, 2024
160fe16
Merge pull request #17 from OffchainLabs/gzeoneth-patch-1
gzeoneth Feb 29, 2024
f741bd2
minimal-install
godzillaba Mar 5, 2024
029c435
Merge pull request #18 from OffchainLabs/minimal-install
gzeoneth Mar 5, 2024
f57a1e0
Lighter e2e (#19)
godzillaba Mar 5, 2024
577f8b6
add gas snapshot to fix
godzillaba Mar 5, 2024
b1c75fe
fix print contracts script (#20)
godzillaba Mar 5, 2024
910ac04
error if no contracts found (#21)
godzillaba Mar 6, 2024
92f6f30
unused import
godzillaba Mar 6, 2024
e5f4559
improve inspect (#22)
godzillaba Mar 7, 2024
64a0dfa
Delete sample files script (#23)
godzillaba Mar 7, 2024
f2bddcb
fix bash scripts (#24)
godzillaba Mar 7, 2024
dc0ac29
Unused errors checker (#26)
gvladika Jul 25, 2024
d6a159f
use hardhat-sizer (#29)
godzillaba Jul 26, 2024
8f9ee56
move template scripts to their own dir (#28)
godzillaba Jul 26, 2024
3d6c1cb
simplify test scripts (#25)
godzillaba Jul 26, 2024
fe7daba
fix audit:ci
godzillaba Jul 30, 2024
84db337
Merge pull request #31 from OffchainLabs/audit-ci-fix
gzeoneth Jul 31, 2024
6cff375
Mocks + DoubleProvider (#30)
godzillaba Aug 7, 2024
3b432ae
explicit formatter config (#34)
godzillaba Oct 7, 2024
b3edd41
uncomment e2e ci (#36)
godzillaba Aug 8, 2025
d553ef0
use stable foundry (#37)
godzillaba Aug 8, 2025
d7b043b
use node v22, run `yarn upgrade`, fix tsconfig (#38)
godzillaba Aug 8, 2025
dac51dc
Bump arbitrum sdk (#39)
godzillaba Aug 11, 2025
7ea120b
fix: audit (#40)
godzillaba Aug 11, 2025
7262aa5
import template
godzillaba Aug 18, 2025
3993013
install contract deps through npm and fix contract import paths
godzillaba Aug 18, 2025
8f354a2
fmt
godzillaba Aug 20, 2025
cf3ac1d
fix FundRouters.test.ts
godzillaba Aug 20, 2025
265a10f
fmt
godzillaba Aug 20, 2025
ca58a10
install viem
godzillaba Aug 20, 2025
d0295b3
fix ChildToParentMessageRedeemer.ts
godzillaba Aug 20, 2025
fc33935
lib.ts
godzillaba Sep 2, 2025
6016f18
checkAndRouteFunds.ts
godzillaba Sep 2, 2025
2c2aed5
bump ts, couple files
godzillaba Sep 2, 2025
90cb2d6
add yargs, cli
godzillaba Sep 2, 2025
129f3f7
fix e2e tests
godzillaba Sep 2, 2025
9fe4fb4
no lint on build
godzillaba Sep 2, 2025
679e105
fix print-contracts script
godzillaba Sep 2, 2025
e06b9fe
format
godzillaba Sep 2, 2025
7748674
fix
godzillaba Sep 2, 2025
663d35f
fix lint
godzillaba Sep 2, 2025
003e982
include total supply in deployment of test token
godzillaba Sep 2, 2025
eb7e303
remove test token minting
godzillaba Sep 3, 2025
1c6473f
try fix tests
godzillaba Sep 3, 2025
fca328f
fix tests
godzillaba Sep 3, 2025
7d59c9f
use ha/traffic-flag branch of testnode
godzillaba Sep 3, 2025
25c01a3
Revert "use ha/traffic-flag branch of testnode"
godzillaba Sep 4, 2025
90c4dc8
audit fix
godzillaba Sep 4, 2025
32221a5
remove publish helpers
godzillaba Sep 4, 2025
db9abdc
Merge remote-tracking branch 'template/ha/remove-publish' into local/…
godzillaba Sep 4, 2025
c7c27d7
remove publish
godzillaba Sep 4, 2025
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: 0 additions & 2 deletions .env.sample

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
91 changes: 91 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true,
},
plugins: ['prettier'],
extends: [
'eslint:recommended',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'off',
'prefer-const': [2, { destructuring: 'all' }],
'object-curly-spacing': ['error', 'always'],
},
overrides: [
{
// this config is run against test files (same as the one bellow but not limited to `src` folder)
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'no-empty-pattern': 'warn',
'prettier/prettier': ['error', { singleQuote: true }],
'@typescript-eslint/member-delimiter-style': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-use-before-define': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'@typescript-eslint/ban-ts-comment': ['warn'],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-implicit-coercion': 'error',
},
},
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier', '@typescript-eslint/tslint'],
rules: {
'no-empty-pattern': 'warn',
'prettier/prettier': ['error', { singleQuote: true }],
'@typescript-eslint/member-delimiter-style': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-use-before-define': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'@typescript-eslint/ban-ts-comment': ['warn'],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/tslint/config': [
'error',
{
rules: { 'strict-comparisons': true },
},
],
'no-implicit-coercion': 'error',
'@typescript-eslint/no-shadow': ['error'],
},
},
],
}
54 changes: 36 additions & 18 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
RewardDistributorTest:testBlockGasLimit() (gas: 22830786)
RewardDistributorTest:testConstructor() (gas: 533016)
RewardDistributorTest:testConstructorDoesNotAcceptEmpty() (gas: 69042)
RewardDistributorTest:testConstructorDoesNotAcceptPastLimit() (gas: 1636148)
RewardDistributorTest:testDistributeAndUpdateRecipients() (gas: 4276467)
RewardDistributorTest:testDistributeAndUpdateRecipientsBadPrevious() (gas: 2096822)
RewardDistributorTest:testDistributeAndUpdateRecipientsNotOwner() (gas: 2099732)
RewardDistributorTest:testDistributeRewards() (gas: 653269)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeToEmpty() (gas: 532370)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeToWrongCount() (gas: 537165)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeWrongRecipients() (gas: 535861)
RewardDistributorTest:testDistributeRewardsDoesRefundsOwner() (gas: 937648)
RewardDistributorTest:testDistributeRewardsFailsForEmptyRD() (gas: 533039)
RewardDistributorTest:testDistributeRewardsFailsToRefundsOwner() (gas: 662631)
RewardDistributorTest:testHashAddresses() (gas: 87649)
RewardDistributorTest:testLowSend() (gas: 658025)
RewardDistributorTest:testUncheckedInc() (gas: 651)
RewardDistributorTest:testUpdateDoesNotAcceptInvalidValues() (gas: 1018294)
ArbChildToParentRewardRouterTest:testSanityCheck() (gas: 257342)
ArbChildToParentRewardRouterTest:testSendNative(uint64) (runs: 256, μ: 44649, ~: 44780)
ArbChildToParentRewardRouterTest:testSendToken(uint256) (runs: 256, μ: 99537, ~: 99238)
ChildToParentRewardRouterTest:testCantRouteTokenTooSoon() (gas: 107176)
ChildToParentRewardRouterTest:testCantRouteTokensWhenSetToNativeOnly() (gas: 8624)
ChildToParentRewardRouterTest:testCantrouteNativeFundsTooSoon() (gas: 100623)
ChildToParentRewardRouterTest:testDistributionUpdate() (gas: 206068)
ChildToParentRewardRouterTest:testRouteNativeFunds() (gas: 78065)
ChildToParentRewardRouterTest:testRouteToken() (gas: 79806)
ChildToParentRewardRouterTest:testZeroAddressConstructorCheck() (gas: 111253)
OpChildToParentRewardRouterTest:testSanityCheck() (gas: 46295)
OpChildToParentRewardRouterTest:testSendNative(uint64) (runs: 256, μ: 23548, ~: 23679)
OpChildToParentRewardRouterTest:testSendToken(uint256) (runs: 256, μ: 93099, ~: 92788)
ParentToChildRewardRouterTest:testCantRouteTooSoon() (gas: 93093)
ParentToChildRewardRouterTest:testRevertsWithInsufficientValue() (gas: 37185)
ParentToChildRewardRouterTest:testrouteNativeFunds() (gas: 89285)
RewardDistributorTest:testBlockGasLimit() (gas: 69524218)
RewardDistributorTest:testConstructor() (gas: 1023688)
RewardDistributorTest:testConstructorDoesNotAcceptEmpty() (gas: 72612)
RewardDistributorTest:testConstructorDoesNotAcceptPastLimit() (gas: 3124911)
RewardDistributorTest:testConstructorInputLengthMismatch() (gas: 252338)
RewardDistributorTest:testDistributeAndUpdateRecipients() (gas: 6231656)
RewardDistributorTest:testDistributeAndUpdateRecipientsBadPrevious() (gas: 4007775)
RewardDistributorTest:testDistributeAndUpdateRecipientsNotOwner() (gas: 4018821)
RewardDistributorTest:testDistributeRewards(uint256) (runs: 256, μ: 1130540, ~: 1130540)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeToEmpty() (gas: 1011249)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeToWrongCount() (gas: 1017358)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeWrongRecipients() (gas: 1015863)
RewardDistributorTest:testDistributeRewardsDoesNotDistributeWrongWeights() (gas: 1015179)
RewardDistributorTest:testDistributeRewardsDoesRefundsOwner(uint256) (runs: 256, μ: 2133067, ~: 2133067)
RewardDistributorTest:testDistributeRewardsFailsToRefundsOwner() (gas: 1144021)
RewardDistributorTest:testDistributeRewardsInputLengthMismatch() (gas: 1012801)
RewardDistributorTest:testHashAddresses() (gas: 84052)
RewardDistributorTest:testLowSend(uint256) (runs: 256, μ: 1252855, ~: 1252855)
RewardDistributorTest:testUncheckedInc() (gas: 5127)
RewardDistributorTest:testUpdateDoesNotAcceptInvalidValues() (gas: 2110869)
26 changes: 26 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Audit

on:
pull_request:
workflow_dispatch:

jobs:
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- run: yarn
- run: yarn audit:ci
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
pull_request:
workflow_dispatch:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- run: yarn && yarn build
- run: yarn lint
46 changes: 37 additions & 9 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ on:
workflow_dispatch:

jobs:
test-e2e:
name: Test E2E with ETH fee L3
# Run e2e tests against a local L1 and L2 node
l1-l2:
name: L1 + L2
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -15,24 +16,24 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22

- name: Set up the local node
uses: OffchainLabs/actions/run-nitro-test-node@main
with:
nitro-testnode-ref: release
l3-node: true

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
version: stable

- run: yarn
- run: cp .env.example .env && yarn test:e2e

# test-e2e-custom-fee:
# name: Test E2E with Custom Fee L3
# # Run e2e tests against a local L1, L2, and L3 node with ETH fees
# l1-l2-l3:
# name: L1 + L2 + L3
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
Expand All @@ -41,7 +42,34 @@ jobs:
# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 18
# node-version: 22
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we wanna keep these commented out workflows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i think we should just to keep the diff with the template smaller


# - name: Set up the local node
# uses: OffchainLabs/actions/run-nitro-test-node@main
# with:
# nitro-testnode-ref: release
# l3-node: true

# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: stable

# - run: yarn
# - run: cp .env.example .env && yarn test:e2e

# # Run e2e tests against a local L1, L2, and L3 node with ERC20 fees
# l1-l2-l3-erc20:
# name: L1 + L2 + L3 with ERC20 fees
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 22

# - name: Set up the local node
# uses: OffchainLabs/actions/run-nitro-test-node@main
Expand All @@ -53,7 +81,7 @@ jobs:
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
# version: stable

# - run: yarn
# - run: cp .env.example .env && yarn test:e2e
26 changes: 26 additions & 0 deletions .github/workflows/test-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test Fork

on:
pull_request:
workflow_dispatch:

jobs:
test-fork:
name: Test Fork
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- run: yarn
- run: ETH_FORK_URL=${{ secrets.ETH_FORK_URL }} ARB_FORK_URL=${{ secrets.ARB_FORK_URL }} yarn test:fork
Loading