-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
executable file
·62 lines (43 loc) · 2.12 KB
/
deploy.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#this script is meant to be run from solidity/
#configuration
#the way to sign the transactions to send, it is recommended to use a ledger dedicated to test and deployment
#SIGNER="--ledger" #safe version, open Ethereum application on your ledger, allow blind signing
SIGNER="--private-key 0x80208c8c8030fa963691eec6c93ecb83c709791d675bb5a54f2609a18ca212d7"
#, unsafe version, using a private key of EOA
#PRIVATE_KEY
#opmainnet --chain-id 10 --rpc-url https://mainnet.optimism.io
#chain-id 137 --rpc-url https://polygon.llamarpc.com --sender 0x936632cC3B9BC47ad23D41dC7cc200015c447f71
#the public key related to your ledger/private key
SENDER=0x54669c319D656EcB1357F3D8D536449eedf5181C
#the script path to deploy
SCRIPT_PATH=script/Deploy7212.s.sol
SCRIPT_FUNCTION=:Script_Deploy_SCL
#TESTNETS
SEPOLIA_CHAINID=11155111
SEPOLIA_RPC=https://ethereum-sepolia.blockpi.network/v1/rpc/public
OP_TESNET_CHAINID=11155420
OP_TESTNET_RPC=https://optimism-sepolia.blockpi.network/v1/rpc/public
KKR_TESNET_CHAINID=1802203764
KKR_TESTNET_RPC=https://sepolia-rpc.kakarot.org/
ALL_RPC=($KKR_TESTNET_RPC $OP_TESTNET_RPC)
ALL_TESTNETWORKS=("KAKAROT" "OP TESTNET")
#ALL_NETWORKS=("POLYGON MAINNET")
ALL_CHAINID=($KKR_TESNET_CHAINID $OP_TESNET_CHAINID)
#the api key for block explorer verification
SEPOLIA_API_KEY=HURV4UYJZCCUTXEYM73M6J6CIJE1KN1W5X
OP_API_KEY=FV931ZWRMJCQWPHSJQ3KMPHI3CH48AFA7R
ALL_API_KEY=($SEPOLIA_API_KEY $OP_API_KEY)
echo "******************** BEGIN DEPLOYMENT OF PR:"$LAST_PR
#deploy and verify library on all networks, polygon need --legacy
for i in ${!ALL_TESTNETWORKS[@]}; do
echo "Chain $i is ${ALL_NETWORKS[$i]} "
echo " ChainID: ${ALL_CHAINID[$i]}"
CHAIN_ID="${ALL_CHAINID[$i]}"
echo " RPC: ${ALL_RPC[$i]}"
RPC="${ALL_RPC[$i]}"
API_KEY=${ALL_API_KEY[$i]}
#with verification
ETHERSCAN_API_KEY=$API_KEY forge script $SCRIPT_PATH$SCRIPT_FUNCTION --broadcast --verify --chain-id $CHAIN_ID $SIGNER --rpc-url $RPC --sender $SENDER
#without verification
ETHERSCAN_API_KEY=$API_KEY forge script $SCRIPT_PATH$SCRIPT_FUNCTION --broadcast --verify --chain-id $CHAIN_ID $SIGNER --rpc-url $RPC --sender $SENDER
done