Skip to content

Commit cd2c59e

Browse files
committed
Initial shop bindings
1 parent 130f883 commit cd2c59e

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
artifacts/
2-
cache/
3-
gnoshcontracts/
4-
out/
1+
artifacts/
2+
cache/
3+
gnoshcontracts/
4+
shopcontracts/
5+
out/

gen_shop_bindings.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
CONTRACTS=(
4+
"Inbox"
5+
"ValidatorRegistry"
6+
"KeyperSetManager"
7+
"KeyperSet"
8+
"EonKeyPublish"
9+
"KeyBroadcastContract"
10+
)
11+
OUTPUT_DIR="shopcontracts"
12+
PACKAGE_NAME="shopcontracts"
13+
14+
mkdir -p "$OUTPUT_DIR"
15+
16+
forge build
17+
18+
for contract in "${CONTRACTS[@]}"; do
19+
pkg=$(echo "$contract" | tr '[:upper:]' '[:lower:]')
20+
d="${OUTPUT_DIR}/${pkg}"
21+
mkdir -p "${d}"
22+
abigen --abi <(jq '.["abi"]' "out/${contract}.sol/${contract}.json") --pkg "${pkg}" --out "${d}/${pkg}.go"
23+
done

0 commit comments

Comments
 (0)