Skip to content

Commit 93fe475

Browse files
committed
fix: update scripts
1 parent 7fe983b commit 93fe475

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

deploy.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
export VERIFIER_API_KEY="" #placeholder for the foundry.toml
34
source .env.local
45

56
# ask for SHOULD_BE_LOCAL_TEST loaded as env liket the ones below (y/n)
@@ -17,7 +18,6 @@ if [ -z "$SHOULD_BE_LOCAL_TEST" ]; then
1718
fi
1819
fi
1920

20-
export VERIFIER_API_KEY="" #placeholder for the foundry.toml
2121

2222
# if not SHOULD BE LOCAL TEST, then ask for REMOTE_RPC_URL
2323
if [ "$SHOULD_BE_LOCAL_TEST" != "y" ]; then
@@ -111,8 +111,8 @@ else
111111
# we need to submit transaction with a slow mode to avoid issues
112112
# the script submits and verifies
113113
if [ "$verify_contracts" = "y" ]; then
114-
MNEMONIC=$MNEMONIC forge script ./src/$SCRIPT_NAME --rpc-url $REMOTE_RPC_URL --etherscan-api-key $VERIFIER_API_KEY --verifier-url $REMOTE_RPC_URL/verify/etherscan --broadcast --ffi -vvv --slow --mnemonics "$MNEMONIC" --verify --delay 5 --retries 5
114+
MNEMONIC=$MNEMONIC VERIFIER_API_KEY=$VERIFIER_API_KEY REMOTE_RPC_URL=$REMOTE_RPC_URL forge script ./src/$SCRIPT_NAME --rpc-url $REMOTE_RPC_URL --etherscan-api-key $VERIFIER_API_KEY --verifier-url $REMOTE_RPC_URL/verify/etherscan --broadcast --ffi -vvv --slow --mnemonics "$MNEMONIC" --verify --delay 5 --retries 5
115115
else
116-
MNEMONIC=$MNEMONIC forge script ./src/$SCRIPT_NAME --rpc-url $REMOTE_RPC_URL --broadcast --ffi -vvv --slow --mnemonics "$MNEMONIC"
116+
MNEMONIC=$MNEMONIC VERIFIER_API_KEY=$VERIFIER_API_KEY REMOTE_RPC_URL=$REMOTE_RPC_URL forge script ./src/$SCRIPT_NAME --rpc-url $REMOTE_RPC_URL --broadcast --ffi -vvv --slow --mnemonics "$MNEMONIC"
117117
fi
118118
fi

tenderlyDeal.sh

+23
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ account=$(cast wallet address --mnemonic "$MNEMONIC" --mnemonic-index $accountIn
3636
dealValue=1000000
3737

3838
echo "Trying to deal the tokens to $account..."
39+
echo "Setting ETH balance..."
40+
ethDecimals=18
41+
ethDealValueCalc=$(echo "obase=16; $dealValue * 10^$ethDecimals" | bc)
42+
ethDealValueHex="0x$(printf $ethDealValueCalc)"
43+
# fund ETH first
44+
jsonPayload=$(jq -n \
45+
--arg account "$account" \
46+
--arg ethDealValueHex "$ethDealValueHex" \
47+
'{
48+
"jsonrpc": "2.0",
49+
"method": "tenderly_setBalance",
50+
"params": [
51+
$account,
52+
$ethDealValueHex
53+
],
54+
"id": 1
55+
}')
56+
57+
echo "JSON payload for $symbol: $jsonPayload"
58+
59+
response=$(curl -s -X POST $rpc_url \
60+
-H "Content-Type: application/json" \
61+
-d "$jsonPayload")
3962

4063
# Load the token list from the JSON file
4164
tokenListPath=$(pwd)"/data/forkTokenList.json"

0 commit comments

Comments
 (0)