-
Notifications
You must be signed in to change notification settings - Fork 4
/
bind.sh
executable file
·32 lines (25 loc) · 1.64 KB
/
bind.sh
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
#!/bin/bash
cargo build -p binder
if [ -d "contracts" ];
then
rm -r "contracts"
fi
forge clean
echo "Installing cozy contracts ... "
forge install https://github.com/Cozy-Finance/cozy-protocol-v2 --no-commit
forge install https://github.com/Cozy-Finance/cozy-models-v2-simulation --no-commit
forge install https://github.com/Cozy-Finance/cozy-triggers-v2-simulation --no-commit
forge install https://github.com/gnosis/canonical-weth --no-commit
forge install https://github.com/Cozy-Finance/cozy-simulation-contracts --no-commit
echo "Building contract artifacts ... "
for d in ./contracts/*/ ; do (cd "$d" && [ -d "test" ] && mv "test" "test_ignore"); done
for d in ./contracts/*/ ; do (cd "$d" && [ -d "script" ] && mv "script" "script_ignore"); done
for d in ./contracts/*/ ; do (cd "$d" && FOUNDRY_PROFILE='default' forge build --revert-strings debug); done
echo "Removing some artifacts ... "
rm -r "contracts/cozy-protocol-v2/out/structs"
echo "Building rust bindings ... "
cargo run --bin binder -- --abis "contracts/cozy-triggers-v2-simulation/out" --bindings "crates/bindings" --mod-name "cozy_triggers" --overwrite
cargo run --bin binder -- --abis "contracts/cozy-models-v2-simulation/out" --bindings "crates/bindings" --mod-name "cozy_models" --overwrite
cargo run --bin binder -- --abis "contracts/cozy-protocol-v2/out" --bindings "crates/bindings" --mod-name "cozy_protocol" --overwrite
cargo run --bin binder -- --abis "contracts/canonical-weth/out" --bindings "crates/bindings" --mod-name "weth" --overwrite
cargo run --bin binder -- --abis "contracts/cozy-simulation-contracts/out" --bindings "crates/bindings" --mod-name "cozy_simulation" --overwrite