generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·28 lines (24 loc) · 1.18 KB
/
run.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
#!/bin/bash
example=$1
if [ -z "$example" ]; then
echo "Use: $0 <example>"
echo -n "Available examples: "
echo `ls ./examples | sed s/\.ts//g`
exit
fi
if [ ! -e "examples/$example.ts" ]; then
echo "example '$example' not found"
echo -n "Available examples: "
echo `ls ./examples | sed s/\.ts//g`
exit
fi
anvil --hardfork prague > anvil.log 2>&1 &
anvilPID=$!
sleep 2
echo ">>> Deploying contracts..."
forge create --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 src/BatchCallDelegation.sol:BatchCallDelegation --broadcast
forge create --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 src/StorageDelegation.sol:StorageDelegation --broadcast
forge create --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 src/StorageDelegation.sol:StorageDelegation --broadcast
forge create --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 src/ReceiveEthDelegation.sol:ReceiveEthDelegation --broadcast
npx ts-node examples/$example.ts
kill $anvilPID