Skip to content

Commit fe0735f

Browse files
committed
chore: add compilation script
1 parent 62854f1 commit fe0735f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Compiler files
22
cache/
33
out/
4+
out-optimized/
45
.DS_Store
56
docs/
67

foundry.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ solc_version = "0.8.24"
33
src = 'src'
44
out = 'out'
55
libs = ['lib']
6-
evm_version = 'paris'
6+
evm_version = 'cancun'
7+
8+
9+
# Compile only the production code and the test mocks with via IR
10+
[profile.optimized]
11+
out = "out-optimized"
12+
via_ir = true
713

814
[fmt]
915
bracket_spacing = true

shell/prepare-artifacts.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
#!/usr/bin/env bash
3+
4+
# Strict mode: https://gist.github.com/vncsna/64825d5609c146e80de8b1fd623011ca
5+
set -euo pipefail
6+
7+
8+
# Delete the current artifacts
9+
artifacts=./artifacts
10+
rm -rf $artifacts
11+
12+
# Create the new artifacts directories
13+
mkdir $artifacts \
14+
"$artifacts/interfaces"
15+
16+
FOUNDRY_PROFILE=optimized forge build
17+
18+
cp out-optimized/Registry.sol/Registry.json $artifacts
19+
20+
21+
interfaces=./artifacts/interfaces
22+
23+
cp out-optimized/IRegistry.sol/IERC7484.json $interfaces
24+
cp out-optimized/IRegistry.sol/IRegistry.json $interfaces
25+
cp out-optimized/IExternalResolver.sol/IExternalResolver.json $interfaces
26+
cp out-optimized/IExternalSchemaValidator.sol/IExternalSchemaValidator.json $interfaces
27+
28+
pnpm prettier --write ./artifacts

0 commit comments

Comments
 (0)