Skip to content

Commit

Permalink
feat: add deploy script for hedera
Browse files Browse the repository at this point in the history
  • Loading branch information
iphyman committed Aug 19, 2024
1 parent 51caf8f commit 0667a25
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.23"
evm_version = "paris"
evm_version = "shanghai"

[profile.default.fuzz]
runs = 1000
Expand Down
54 changes: 54 additions & 0 deletions hedera.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

while getopts ":c:u:e:k:" opt; do
case $opt in
u) rpc="$OPTARG"
;;
e) etherscan_key="$OPTARG"
;;
k) private_key="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac

case $OPTARG in
-*) echo "Option $opt needs a valid argument" >&2
exit 1
;;
esac
done

if [ -z ${private_key+x} ];
then
echo "private key (-k) is unset" >&2
exit 1
fi

set -euo pipefail

ROOT=$(dirname $0)
FORGE_SCRIPTS=$ROOT/script

. $ROOT/.hedera.env

# Use the RPC environment variable if rpc isn't set.
if [ -z ${rpc+x} ];
then
rpc=$RPC
fi

# Use the verfifier url environment variable if verifier_url isn't set.
if [ -z ${verifier_url+x} ];
then
verifier_url=$VERIFIER_URL
fi

forge script $FORGE_SCRIPTS/DeployOptionMarket.s.sol \
--rpc-url $rpc \
--broadcast \
--private-key $private_key \
--verify --verifier sourcify --verifier-url $verifier_url \
--slow \
--skip test

0 comments on commit 0667a25

Please sign in to comment.