-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 2.27 KB
/
bytecode.yml
File metadata and controls
77 lines (70 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Bytecode Artifacts
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
bytecode:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
- name: Build
run: forge build
- name: Extract deployed bytecode
run: |
mkdir -p artifacts
for contract in \
Blake2fDeployed \
Sha256Deployed \
Ripemd160Deployed \
IdentityDeployed \
ModexpDeployed \
PointEvalDeployed
do
json=$(find out -path "*/${contract}.sol/${contract}.json" -print -quit)
if [ -n "$json" ]; then
# Runtime bytecode (what lives on-chain after deployment)
jq -r '.deployedBytecode.object' "$json" > "artifacts/${contract}.bin"
# Init bytecode (used to deploy)
jq -r '.bytecode.object' "$json" > "artifacts/${contract}.init.bin"
# ABI
jq '.abi' "$json" > "artifacts/${contract}.abi.json"
echo "${contract}: $(wc -c < "artifacts/${contract}.bin") bytes runtime"
else
echo "WARNING: ${contract} artifact not found"
fi
done
- name: Upload all bytecode artifacts
uses: actions/upload-artifact@v4
with:
name: deployed-bytecode
path: artifacts/
- name: Upload per-contract artifacts
uses: actions/upload-artifact@v4
with:
name: Blake2fDeployed
path: artifacts/Blake2fDeployed.*
- uses: actions/upload-artifact@v4
with:
name: Sha256Deployed
path: artifacts/Sha256Deployed.*
- uses: actions/upload-artifact@v4
with:
name: Ripemd160Deployed
path: artifacts/Ripemd160Deployed.*
- uses: actions/upload-artifact@v4
with:
name: IdentityDeployed
path: artifacts/IdentityDeployed.*
- uses: actions/upload-artifact@v4
with:
name: ModexpDeployed
path: artifacts/ModexpDeployed.*
- uses: actions/upload-artifact@v4
with:
name: PointEvalDeployed
path: artifacts/PointEvalDeployed.*