Skip to content

Commit 646a4d1

Browse files
authored
[evm]: IntentGatewayV2 Audit Fixes (#819)
1 parent 5c0dca4 commit 646a4d1

106 files changed

Lines changed: 5566 additions & 5140 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- ".github/workflows/ci.yml"
1212
- "!sdk/**"
1313

14-
pull_request_target:
14+
pull_request:
1515
types: [opened, synchronize, reopened, ready_for_review]
1616
paths:
1717
- "**/*.rs"
@@ -20,6 +20,8 @@ on:
2020
- ".github/workflows/ci.yml"
2121
- "!sdk/**"
2222

23+
workflow_dispatch:
24+
2325
# pull_request_target:
2426
# branches:
2527
# - main
@@ -58,7 +60,7 @@ jobs:
5860
detect-changes:
5961
name: Detect Changed Paths
6062
runs-on: ubuntu-22.04
61-
if: github.event.pull_request_target.draft != true
63+
if: github.event.pull_request.draft != true
6264
outputs:
6365
pharos: ${{ steps.filter.outputs.pharos }}
6466
sync-committee: ${{ steps.filter.outputs.sync-committee }}
@@ -67,7 +69,7 @@ jobs:
6769
steps:
6870
- uses: actions/checkout@v3
6971
with:
70-
ref: ${{ github.event.pull_request_target.head.sha || github.sha }}
72+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
7173
token: ${{ secrets.GH_TOKEN }}
7274
fetch-depth: 0
7375

@@ -98,7 +100,7 @@ jobs:
98100
check-wasm:
99101
name: Check Wasm Crates
100102
runs-on: arc-runner-set
101-
if: github.event.pull_request_target.draft != true
103+
if: github.event.pull_request.draft != true
102104
strategy:
103105
matrix:
104106
crate: [gargantua-runtime, nexus-runtime]
@@ -121,7 +123,7 @@ jobs:
121123
122124
- uses: actions/checkout@v3
123125
with:
124-
ref: ${{ github.event.pull_request_target.head.sha }}
126+
ref: ${{ github.event.pull_request.head.sha }}
125127
token: ${{ secrets.GH_TOKEN }}
126128
submodules: recursive
127129

@@ -183,7 +185,7 @@ jobs:
183185
check-workspace:
184186
name: Check Workspace
185187
runs-on: arc-runner-set
186-
if: github.event.pull_request_target.draft != true
188+
if: github.event.pull_request.draft != true
187189
steps:
188190
- name: Get User Permission
189191
id: checkAccess
@@ -202,7 +204,7 @@ jobs:
202204
203205
- uses: actions/checkout@v3
204206
with:
205-
ref: ${{ github.event.pull_request_target.head.sha }}
207+
ref: ${{ github.event.pull_request.head.sha }}
206208
token: ${{ secrets.GH_TOKEN }}
207209
submodules: recursive
208210

@@ -270,7 +272,7 @@ jobs:
270272
unit-tests:
271273
name: Unit Tests
272274
runs-on: arc-runner-set
273-
if: github.event.pull_request_target.draft != true
275+
if: github.event.pull_request.draft != true
274276
steps:
275277
- name: Get User Permission
276278
id: checkAccess
@@ -289,7 +291,7 @@ jobs:
289291
290292
- uses: actions/checkout@v3
291293
with:
292-
ref: ${{ github.event.pull_request_target.head.sha }}
294+
ref: ${{ github.event.pull_request.head.sha }}
293295
token: ${{ secrets.GH_TOKEN }}
294296
submodules: recursive
295297

@@ -357,7 +359,7 @@ jobs:
357359
simnet-tests:
358360
name: Simnet Tests
359361
runs-on: arc-runner-set
360-
if: github.event.pull_request_target.draft != true
362+
if: github.event.pull_request.draft != true
361363
steps:
362364
- name: Get User Permission
363365
id: checkAccess
@@ -376,7 +378,7 @@ jobs:
376378
377379
- uses: actions/checkout@v3
378380
with:
379-
ref: ${{ github.event.pull_request_target.head.sha }}
381+
ref: ${{ github.event.pull_request.head.sha }}
380382
token: ${{ secrets.GH_TOKEN }}
381383
submodules: recursive
382384

@@ -451,7 +453,7 @@ jobs:
451453
name: Ethereum Sync Committee Tests
452454
needs: detect-changes
453455
runs-on: ubuntu-22.04
454-
if: github.event.pull_request_target.draft != true && needs.detect-changes.outputs.sync-committee == 'true'
456+
if: github.event.pull_request.draft != true && needs.detect-changes.outputs.sync-committee == 'true'
455457
steps:
456458
- name: Get User Permission
457459
id: checkAccess
@@ -470,7 +472,7 @@ jobs:
470472
471473
- uses: actions/checkout@v3
472474
with:
473-
ref: ${{ github.event.pull_request_target.head.sha }}
475+
ref: ${{ github.event.pull_request.head.sha }}
474476
token: ${{ secrets.GH_TOKEN }}
475477
submodules: recursive
476478

@@ -545,7 +547,7 @@ jobs:
545547
name: Binance Smart Chain Tests
546548
needs: detect-changes
547549
runs-on: ubuntu-22.04
548-
if: github.event.pull_request_target.draft != true && needs.detect-changes.outputs.bsc == 'true'
550+
if: github.event.pull_request.draft != true && needs.detect-changes.outputs.bsc == 'true'
549551
steps:
550552
- name: Get User Permission
551553
id: checkAccess
@@ -564,7 +566,7 @@ jobs:
564566
565567
- uses: actions/checkout@v3
566568
with:
567-
ref: ${{ github.event.pull_request_target.head.sha }}
569+
ref: ${{ github.event.pull_request.head.sha }}
568570
token: ${{ secrets.GH_TOKEN }}
569571
submodules: recursive
570572

@@ -626,7 +628,7 @@ jobs:
626628
name: Tendermint Tests
627629
needs: detect-changes
628630
runs-on: ubuntu-22.04
629-
if: github.event.pull_request_target.draft != true && needs.detect-changes.outputs.tendermint == 'true'
631+
if: github.event.pull_request.draft != true && needs.detect-changes.outputs.tendermint == 'true'
630632
steps:
631633
- name: Get User Permission
632634
id: checkAccess
@@ -645,7 +647,7 @@ jobs:
645647
646648
- uses: actions/checkout@v3
647649
with:
648-
ref: ${{ github.event.pull_request_target.head.sha }}
650+
ref: ${{ github.event.pull_request.head.sha }}
649651
token: ${{ secrets.GH_TOKEN }}
650652
submodules: recursive
651653

@@ -707,7 +709,7 @@ jobs:
707709
name: Pharos Tests
708710
needs: detect-changes
709711
runs-on: ubuntu-22.04
710-
if: github.event.pull_request_target.draft != true && needs.detect-changes.outputs.pharos == 'true'
712+
if: github.event.pull_request.draft != true && needs.detect-changes.outputs.pharos == 'true'
711713
steps:
712714
- name: Get User Permission
713715
id: checkAccess
@@ -726,7 +728,7 @@ jobs:
726728
727729
- uses: actions/checkout@v3
728730
with:
729-
ref: ${{ github.event.pull_request_target.head.sha }}
731+
ref: ${{ github.event.pull_request.head.sha }}
730732
token: ${{ secrets.GH_TOKEN }}
731733
submodules: recursive
732734

.github/workflows/evm.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- "evm/**/*.js"
1515
- ".github/workflows/evm.yml"
1616

17-
pull_request_target:
17+
pull_request:
1818
types: [opened, synchronize, reopened, ready_for_review]
1919
paths:
2020
- "evm/**/*.sol"
@@ -24,6 +24,8 @@ on:
2424
- "evm/**/package.json"
2525
- ".github/workflows/evm.yml"
2626

27+
workflow_dispatch:
28+
2729
concurrency:
2830
group: evm-ci-${{ github.head_ref || github.ref_name }}
2931
cancel-in-progress: true
@@ -37,13 +39,13 @@ jobs:
3739
check-evm:
3840
name: Check EVM Contracts
3941
runs-on: ubuntu-latest
40-
if: github.event.pull_request_target.draft != true
42+
if: github.event.pull_request.draft != true
4143
steps:
4244
- uses: actions/checkout@v3
4345
with:
4446
submodules: recursive
4547
token: ${{ secrets.GH_TOKEN }}
46-
ref: ${{ github.event.pull_request_target.head.sha }}
48+
ref: ${{ github.event.pull_request.head.sha }}
4749

4850
- uses: pnpm/action-setup@v2
4951
with:
@@ -79,13 +81,13 @@ jobs:
7981
integration-tests-rust:
8082
name: Rust Integration Tests (revm)
8183
runs-on: ubuntu-latest
82-
if: github.event.pull_request_target.draft != true
84+
if: github.event.pull_request.draft != true
8385
steps:
8486
- uses: actions/checkout@v3
8587
with:
8688
submodules: recursive
8789
token: ${{ secrets.GH_TOKEN }}
88-
ref: ${{ github.event.pull_request_target.head.sha }}
90+
ref: ${{ github.event.pull_request.head.sha }}
8991

9092
- uses: pnpm/action-setup@v2
9193
with:

.github/workflows/test-core.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
paths:
88
- "sdk/packages/core/**"
99
- ".github/workflows/test-core.yml"
10-
pull_request_target:
10+
pull_request:
1111
branches:
1212
- main
1313
types: [opened, synchronize, reopened, ready_for_review]
1414
paths:
1515
- "sdk/packages/core/**"
1616
- ".github/workflows/test-core.yml"
17+
workflow_dispatch:
1718

1819
concurrency:
1920
group: ${{ github.ref }}-core
@@ -26,13 +27,15 @@ jobs:
2627
compile:
2728
name: Compile
2829
# Skip on draft pull requests; run on push, ready PRs, and manual dispatch.
29-
if: github.event_name != 'pull_request_target' || github.event.pull_request_target.draft == false
30+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
3031
runs-on: ubuntu-latest
3132
defaults:
3233
run:
3334
working-directory: sdk
3435
steps:
3536
- uses: actions/checkout@v3
37+
with:
38+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3639

3740
- name: Install Foundry
3841
uses: foundry-rs/foundry-toolchain@v1
@@ -42,11 +45,11 @@ jobs:
4245
- name: Setup Node.js
4346
uses: actions/setup-node@v3
4447
with:
45-
node-version: "18"
48+
node-version: "22"
4649

4750
- uses: pnpm/action-setup@v4
4851
with:
49-
version: 10
52+
version: 11
5053
run_install: false
5154

5255
- name: Get pnpm store directory

.github/workflows/test-lz-endpoint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
paths:
88
- "sdk/packages/lz-endpoint/**"
99
- ".github/workflows/test-lz-endpoint.yml"
10-
pull_request_target:
10+
pull_request:
1111
branches:
1212
- main
1313
types: [opened, synchronize, reopened, ready_for_review]
1414
paths:
1515
- "sdk/packages/lz-endpoint/**"
1616
- ".github/workflows/test-lz-endpoint.yml"
17+
workflow_dispatch:
1718

1819
concurrency:
1920
group: ${{ github.ref }}-lz-endpoint
@@ -25,13 +26,15 @@ env:
2526
jobs:
2627
test:
2728
name: Build & Test
28-
if: github.event_name != 'pull_request_target' || github.event.pull_request_target.draft == false
29+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2930
runs-on: ubuntu-latest
3031
defaults:
3132
run:
3233
working-directory: sdk
3334
steps:
3435
- uses: actions/checkout@v3
36+
with:
37+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3538

3639
- name: Install Foundry
3740
uses: foundry-rs/foundry-toolchain@v1
@@ -41,11 +44,11 @@ jobs:
4144
- name: Setup Node.js
4245
uses: actions/setup-node@v3
4346
with:
44-
node-version: "18"
47+
node-version: "22"
4548

4649
- uses: pnpm/action-setup@v4
4750
with:
48-
version: 10
51+
version: 11
4952
run_install: false
5053

5154
- name: Get pnpm store directory

.github/workflows/test-sdk.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "@hyperbridge/sdk"
22

33
concurrency:
4-
group: ${{ github.workflow }}-${{ github.event.pull_request_target.number || github.ref }}
5-
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
66

77
on:
88
push:
@@ -12,7 +12,7 @@ on:
1212
- "sdk/packages/indexer/**"
1313
- "sdk/packages/simplex/**"
1414
- ".github/workflows/test-sdk.yml"
15-
pull_request_target:
15+
pull_request:
1616
branches: [main]
1717
types: [opened, synchronize, reopened, ready_for_review]
1818
paths:
@@ -25,7 +25,7 @@ on:
2525
jobs:
2626
test:
2727
# Skip on draft pull requests; run on push, ready PRs, and manual dispatch.
28-
if: github.event_name != 'pull_request_target' || github.event.pull_request_target.draft == false
28+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
2929
runs-on: ubuntu-latest
3030
defaults:
3131
run:
@@ -34,17 +34,17 @@ jobs:
3434
- name: Checkout repository
3535
uses: actions/checkout@v4
3636
with:
37-
ref: ${{ github.event.pull_request_target.head.sha || github.sha }}
37+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3838

3939
- name: Setup Node.js
4040
uses: actions/setup-node@v4
4141
with:
4242
node-version: "22"
4343

4444
- name: Setup pnpm
45-
uses: pnpm/action-setup@v2
45+
uses: pnpm/action-setup@v4
4646
with:
47-
version: "7"
47+
version: 11
4848

4949
- name: Install dependencies
5050
run: pnpm install
@@ -128,6 +128,9 @@ jobs:
128128
echo "GraphQL server is available!"
129129
sleep 10
130130
131+
- name: Run SDK test - hyper-fungible-token
132+
run: pnpm --filter="@hyperbridge/sdk" test:hyper-fungible-token
133+
131134
- name: Run SDK test - intents-coprocessor
132135
run: pnpm --filter="@hyperbridge/sdk" test:intents-coprocessor
133136

@@ -140,9 +143,6 @@ jobs:
140143
- name: Run SDK test - requests
141144
run: pnpm --filter="@hyperbridge/sdk" test:requests
142145

143-
- name: Run SDK test - hyper-fungible-token
144-
run: pnpm --filter="@hyperbridge/sdk" test:hyper-fungible-token
145-
146146
- name: Run SDK test - intent-gateway
147147
run: pnpm --filter="@hyperbridge/sdk" test:intent-gateway
148148

0 commit comments

Comments
 (0)