Skip to content

Commit c32af12

Browse files
authored
Merge pull request OffchainLabs#328 from OffchainLabs/develop
chore: merge develop with 3.1.0 to main
2 parents 94999b3 + 50cbad0 commit c32af12

File tree

89 files changed

+4622
-3585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4622
-3585
lines changed

.env-sample

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
L1_RPC_URL="http://127.0.0.1:8545"
21
L1_PRIV_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
3-
CONFIG_NETWORK_NAME="arb1"
2+
CONFIG_NETWORK_NAME="custom"
43
DEPLOYED_CONTRACTS_DIR="./scripts/files/"
54
DISABLE_VERIFICATION=true
5+
6+
# to use the 'custom' hardhat network, set the following variables
7+
CUSTOM_RPC_URL="http://127.0.0.1:8545"
8+
CUSTOM_ETHERSCAN_API_KEY=
9+
CUSTOM_CHAINID=1337
10+
CUSTOM_ETHERSCAN_API_URL=
11+
CUSTOM_ETHERSCAN_BROWSER_URL=

.github/workflows/contract-tests.yml

Lines changed: 106 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ jobs:
2121
- name: Install Foundry
2222
uses: foundry-rs/foundry-toolchain@v1
2323
with:
24-
version: nightly
24+
version: stable
25+
cache: false
2526

2627
- name: Setup node/yarn
2728
uses: actions/setup-node@v3
@@ -50,7 +51,8 @@ jobs:
5051
- name: Install Foundry
5152
uses: foundry-rs/foundry-toolchain@v1
5253
with:
53-
version: nightly
54+
version: stable
55+
cache: false
5456

5557
- name: Setup nodejs
5658
uses: actions/setup-node@v2
@@ -62,7 +64,8 @@ jobs:
6264
- name: Install Foundry
6365
uses: foundry-rs/foundry-toolchain@v1
6466
with:
65-
version: nightly
67+
version: stable
68+
cache: false
6669

6770
- name: Check Contracts Format
6871
run: forge fmt --check
@@ -128,7 +131,8 @@ jobs:
128131
- name: Install Foundry
129132
uses: foundry-rs/foundry-toolchain@v1
130133
with:
131-
version: nightly
134+
version: stable
135+
cache: false
132136

133137
- uses: OffchainLabs/actions/run-nitro-test-node@main
134138
with:
@@ -150,114 +154,88 @@ jobs:
150154

151155
- name: Test 4844
152156
run: yarn test:4844
153-
# test-e2e:
154-
# name: Test e2e
155-
# runs-on: ubuntu-latest
156-
# steps:
157-
# - uses: actions/checkout@v3
158-
# with:
159-
# submodules: recursive
160-
161-
# - uses: OffchainLabs/actions/run-nitro-test-node@main
162-
# with:
163-
# l3-node: true
164-
# no-token-bridge: true
165-
# no-l3-token-bridge: true
166-
# nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
167-
# nitro-testnode-ref: node-18
168-
169-
# - name: Setup node/yarn
170-
# uses: actions/setup-node@v3
171-
# with:
172-
# node-version: 18
173-
# cache: 'yarn'
174-
# cache-dependency-path: '**/yarn.lock'
175157

176-
# - name: Install packages
177-
# run: yarn
178-
179-
# - name: Compile contracts
180-
# run: yarn build
158+
test-e2e:
159+
name: Test e2e
160+
runs-on: ubuntu-latest
161+
steps:
162+
- uses: actions/checkout@v3
163+
with:
164+
submodules: recursive
181165

182-
# - name: Run e2e tests
183-
# run: yarn test:e2e
184-
# test-e2e-custom-fee-token:
185-
# name: Test e2e custom fee token
186-
# runs-on: ubuntu-latest
187-
# steps:
188-
# - uses: actions/checkout@v3
189-
# with:
190-
# submodules: recursive
166+
- uses: OffchainLabs/actions/run-nitro-test-node@main
167+
with:
168+
l3-node: true
169+
no-token-bridge: true
170+
no-l3-token-bridge: true
171+
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
172+
nitro-testnode-ref: v3-support
191173

192-
# - uses: OffchainLabs/actions/run-nitro-test-node@main
193-
# with:
194-
# l3-node: true
195-
# args: --l3-fee-token
196-
# no-token-bridge: true
197-
# no-l3-token-bridge: true
198-
# nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
199-
# nitro-testnode-ref: node-18
174+
- name: Setup node/yarn
175+
uses: actions/setup-node@v3
176+
with:
177+
node-version: 18
178+
cache: 'yarn'
179+
cache-dependency-path: '**/yarn.lock'
200180

201-
# - name: Setup node/yarn
202-
# uses: actions/setup-node@v3
203-
# with:
204-
# node-version: 18
205-
# cache: 'yarn'
206-
# cache-dependency-path: '**/yarn.lock'
181+
- name: Install packages
182+
run: yarn
207183

208-
# - name: Install packages
209-
# run: yarn
184+
- name: Compile contracts
185+
run: yarn build
210186

211-
# - name: Compile contracts
212-
# run: yarn build
187+
- name: Run e2e tests
188+
run: yarn test:e2e
213189

214-
# - name: Run e2e tests
215-
# run: yarn test:e2e
216-
# test-e2e-fee-token-6-decimals:
217-
# name: Test e2e fee token with 6 decimals
218-
# runs-on: ubuntu-latest
219-
# steps:
220-
# - uses: actions/checkout@v3
221-
# with:
222-
# submodules: recursive
190+
test-e2e-custom-fee-token:
191+
name: Test e2e custom fee token
192+
runs-on: ubuntu-latest
193+
steps:
194+
- uses: actions/checkout@v3
195+
with:
196+
submodules: recursive
223197

224-
# - uses: OffchainLabs/actions/run-nitro-test-node@main
225-
# with:
226-
# l3-node: true
227-
# args: --l3-fee-token --l3-fee-token-decimals 6
228-
# no-token-bridge: true
229-
# no-l3-token-bridge: true
230-
# nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
231-
# nitro-testnode-ref: 'non18-decimal-token-node-18'
198+
- uses: OffchainLabs/actions/run-nitro-test-node@main
199+
with:
200+
l3-node: true
201+
args: --l3-fee-token
202+
no-token-bridge: true
203+
no-l3-token-bridge: true
204+
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
205+
nitro-testnode-ref: v3-support
232206

233-
# - name: Setup node/yarn
234-
# uses: actions/setup-node@v3
235-
# with:
236-
# node-version: 18
237-
# cache: 'yarn'
238-
# cache-dependency-path: '**/yarn.lock'
207+
- name: Setup node/yarn
208+
uses: actions/setup-node@v3
209+
with:
210+
node-version: 18
211+
cache: 'yarn'
212+
cache-dependency-path: '**/yarn.lock'
239213

240-
# - name: Install packages
241-
# run: yarn
214+
- name: Install packages
215+
run: yarn
242216

243-
# - name: Compile contracts
244-
# run: yarn build
217+
- name: Compile contracts
218+
run: yarn build
245219

246-
# - name: Run e2e tests
247-
# run: yarn test:e2e
220+
- name: Run e2e tests
221+
run: yarn test:e2e
248222

249-
bold-upgrade:
250-
name: BOLD upgrade test
223+
test-e2e-fee-token-6-decimals:
224+
name: Test e2e fee token with 6 decimals and pricer
251225
runs-on: ubuntu-latest
252226
steps:
253227
- uses: actions/checkout@v3
254228
with:
255229
submodules: recursive
256230

257-
- name: Install Foundry
258-
uses: foundry-rs/foundry-toolchain@v1
231+
- uses: OffchainLabs/actions/run-nitro-test-node@main
259232
with:
260-
version: nightly
233+
l3-node: true
234+
args: --l3-fee-token --l3-fee-token-pricer --l3-fee-token-decimals 6
235+
no-token-bridge: true
236+
no-l3-token-bridge: true
237+
nitro-testnode-ref: v3-support
238+
nitro-contracts-branch: '${{ github.event.pull_request.head.sha || github.sha }}'
261239

262240
- name: Setup node/yarn
263241
uses: actions/setup-node@v3
@@ -270,11 +248,41 @@ jobs:
270248
run: yarn
271249

272250
- name: Compile contracts
273-
run: yarn build:all
251+
run: yarn build
252+
253+
- name: Run e2e tests
254+
run: yarn test:e2e
255+
256+
# bold-upgrade:
257+
# name: BOLD upgrade test
258+
# runs-on: ubuntu-latest
259+
# steps:
260+
# - uses: actions/checkout@v3
261+
# with:
262+
# submodules: recursive
263+
264+
# - name: Install Foundry
265+
# uses: foundry-rs/foundry-toolchain@v1
266+
# with:
267+
# version: stable
268+
# cache: false
269+
270+
# - name: Setup node/yarn
271+
# uses: actions/setup-node@v3
272+
# with:
273+
# node-version: 18
274+
# cache: 'yarn'
275+
# cache-dependency-path: '**/yarn.lock'
276+
277+
# - name: Install packages
278+
# run: yarn
279+
280+
# - name: Compile contracts
281+
# run: yarn build:all
274282

275-
- name: Copy .env
276-
run: |
277-
cp ./.env-sample ./.env
283+
# - name: Copy .env
284+
# run: |
285+
# cp ./.env-sample ./.env
278286

279-
- name: Test upgrade
280-
run: L1_RPC=${{ secrets.L1_RPC || 'https://rpc.ankr.com/eth' }} yarn test:upgrade
287+
# - name: Test upgrade
288+
# run: L1_RPC=${{ secrets.L1_RPC || 'https://rpc.ankr.com/eth' }} yarn test:upgrade

audit-ci.jsonc

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,8 @@
22
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json",
33
"low": true,
44
"allowlist": [
5-
// OpenZeppelin Contracts's SignatureChecker may revert on invalid EIP-1271 signers
6-
"GHSA-4g63-c64m-25w9",
75
// OpenZeppelin Contracts's GovernorVotesQuorumFraction updates to quorum may affect past defeated proposals
8-
"GHSA-xrc4-737v-9q75",
9-
// OpenZeppelin Contracts's ERC165Checker may revert instead of returning false
10-
"GHSA-qh9x-gcfh-pcrw",
11-
// OpenZeppelin Contracts vulnerable to ECDSA signature malleability. Only an issue for the functions that take a single `bytes` argument, and not the functions that take `r, v, s` or `r, vs` as separate arguments.
12-
"GHSA-4h98-2769-gh6h",
13-
// GovernorCompatibilityBravo may trim proposal calldata
146
"GHSA-93hq-5wgc-jc82",
15-
// OpenZeppelin Contracts ERC165Checker unbounded gas consumption
16-
"GHSA-7grf-83vw-6f5x",
177
// OpenZeppelin: Using ERC2771Context with a custom forwarder can yield address(0)
188
"GHSA-g4vp-m682-qqmp",
199
// OpenZeppelin Contracts TransparentUpgradeableProxy clashing selector calls may not be delegated
@@ -22,59 +12,21 @@
2212
"GHSA-5h3x-9wvq-w4m2",
2313
// axios cookies data-privacy issue; used only in hardhat-deploy and sol2uml (dev deps)
2414
"GHSA-wf5p-g6vw-rhxx",
25-
// flat vulnerable to Prototype Pollution
26-
"GHSA-2j2x-2gpw-g8fm",
27-
// regular expression DoS in debug
28-
"GHSA-gxpj-cx7g-858c",
29-
// tough-cookie Prototype Pollution vulnerability; used only via eth-gas-reporter
30-
"GHSA-72xf-g2v4-qvf3",
31-
// minimatch ReDoS vulnerability
32-
"GHSA-f8q6-p94x-37v3",
33-
// Server-Side Request Forgery in Request
34-
"GHSA-p8p7-x288-28g6",
3515
// OpenZeppelin Contracts using MerkleProof multiproofs may allow proving arbitrary leaves for specific trees; unused
3616
"GHSA-wprv-93r4-jj2p",
37-
// follow-redirects improperly handles URLs in the url.parse() function
38-
"GHSA-jchw-25xp-jwwc",
39-
// yargs-parser Vulnerable to Prototype Pollution
40-
"GHSA-p9pc-299p-vxgp",
41-
// Axios vulnerable to Server-Side Request Forgery
42-
"GHSA-4w2v-q235-vp99",
43-
// axios Inefficient Regular Expression Complexity vulnerability
44-
"GHSA-cph5-m8f7-6c5x",
45-
// Exposure of Sensitive Information to an Unauthorized Actor in follow-redirects
46-
"GHSA-pw2r-vq6v-hr8c",
47-
// Exposure of sensitive information in follow-redirects
48-
"GHSA-74fj-2j2h-c42q",
4917
// Open Zeppelin: Base64 encoding may read from potentially dirty memory
5018
"GHSA-9vx6-7xxf-x967",
5119
// semver vulnerable to Regular Expression Denial of Service
5220
"GHSA-c2qf-rxjj-qqgw",
53-
// follow-redirects' Proxy-Authorization header kept across hosts
54-
"GHSA-cxjh-pqwp-8mfp",
55-
// Prototype Pollution in async
56-
"GHSA-fwr7-v2mv-hh25",
57-
// ws affected by a DoS when handling a request with many HTTP headers
58-
"GHSA-3h5v-q93c-6h6q",
59-
// Elliptic allows BER-encoded signatures - only used in dev
60-
"GHSA-49q7-c7j4-3p7m",
61-
// Elliptic's EDDSA missing signature length check - only used in dev
62-
"GHSA-f7q4-pwc6-w24p",
63-
// Elliptic's ECDSA missing check for whether leading bit of r and s is zero - only used in dev
64-
"GHSA-977x-g7h5-7qgw",
6521
// Server-Side Request Forgery in axios
6622
"GHSA-8hc4-vh64-cxmj",
6723
// Regular Expression Denial of Service (ReDoS) in micromatch
6824
"GHSA-952p-6rrq-rcjv",
6925
// cookie accepts cookie name, path, and domain with out of bounds characters
7026
"GHSA-pxg6-pf52-xh8x",
71-
// Elliptic's verify function omits uniqueness validation
72-
"GHSA-434g-2637-qmqr",
73-
// Valid ECDSA signatures erroneously rejected in Elliptic
74-
"GHSA-fc9h-whq2-v747",
75-
// secp256k1-node allows private key extraction over ECDH
76-
"GHSA-584q-6j8j-r5pm",
7727
// Regular Expression Denial of Service (ReDoS) in cross-spawn
78-
"GHSA-3xgq-45jj-v275"
28+
"GHSA-3xgq-45jj-v275",
29+
// axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL
30+
"GHSA-jr5f-v2jv-69x6"
7931
]
8032
}

deploy/InboxStubCreator.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
module.exports = async hre => {
22
const { deployments, getNamedAccounts, ethers } = hre
3-
const { deploy } = deployments
43
const { deployer } = await getNamedAccounts()
54

6-
const inboxDeployResult = await deploy('InboxStub', {
5+
const inboxDeployResult = await deployments.deploy('InboxStub', {
76
from: deployer,
87
args: [],
98
})
109

11-
const bridge = await ethers.getContract('BridgeStub')
12-
const inbox = await ethers.getContract('InboxStub')
10+
const bridge = await ethers.getContractAt(
11+
'BridgeStub',
12+
(
13+
await deployments.get('BridgeStub')
14+
).address
15+
)
16+
const inbox = await ethers.getContractAt(
17+
'InboxStub',
18+
(
19+
await deployments.get('InboxStub')
20+
).address
21+
)
1322

1423
if (inboxDeployResult.newlyDeployed) {
1524
await bridge.setDelayedInbox(inbox.address, true)

0 commit comments

Comments
 (0)