Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy script #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
set -e

# Check if the arguments are provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <identity_string>"
if [ $# -ne 3 ]; then
echo "Usage: $0 <identity_string> <admin_address> <auction token address>"
exit 1
fi

IDENTITY_STRING=$1
ADMIN_ADDR=$2
AUCTION_TOKEN_ADDR=$3
NETWORK="testnet"

echo "Build and optimize the contracts...";
Expand All @@ -21,6 +23,7 @@ echo "Optimizing contracts..."

soroban contract optimize --wasm phoenix_nft_collections.wasm
soroban contract optimize --wasm phoenix_nft_deployer.wasm
soroban contract optimize --wasm phoenix_nft_auctions.wasm

echo "Contracts optimized."

Expand Down Expand Up @@ -60,6 +63,24 @@ soroban contract install \

echo "Collections contract deployed and installed."

echo "Deploy and install the auctions contract and capture its contract ID and hash..."

AUCTION_ADDR=$(
stellar contract deploy \
--wasm phoenix_nft_auctions.optimized.wasm \
--source $IDENTITY_STRING \
--network $NETWORK
)

AUCTION_WASM_HASH=$(
soroban contract install \
--wasm phoenix_nft_auctions.optimized.wasm \
--source $IDENTITY_STRING \
--network $NETWORK
)

echo "Auctions contract deployed and installed."

echo "Initialize deployer with the collections hash..."

soroban contract invoke \
Expand All @@ -72,6 +93,19 @@ soroban contract invoke \

echo "Deployer initialized."

echo "Initialize auctions with the auction token address"

soroban contract invoke \
--id $AUCTION_ADDR \
--source $IDENTITY_STRING \
--network $NETWORK \
-- \
initialize \
--admin $ADMIN_ADDR
--auction_token $AUCTION_TOKEN_ADDR

echo "Auction initialized"

echo "#############################"

echo "Setup complete!"
Expand Down
Loading