Skip to content

Commit

Permalink
added new constructor args to docker/launcer setup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDegenDeveloper committed Dec 4, 2024
1 parent 0fea233 commit 3386b6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ARG SIGNER_ADDRESS
ARG FOSSIL_PROCESSOR_ADDRESS
ARG VAULT_ALPHA
ARG VAULT_STRIKE
ARG ROUND_TRANSITION_DURATION
ARG AUCTION_DURATION
ARG ROUND_DURATION
ARG ARGENT_ADDRESS
ARG ARGENT_SALT
ARG ARGENT_CONSTRUCTOR_ARG1
Expand All @@ -24,6 +27,9 @@ RUN if [ -z "$SIGNER_PRIVATE_KEY" ] || \
[ -z "$FOSSIL_PROCESSOR_ADDRESS" ] || \
[ -z "$VAULT_ALPHA" ] || \
[ -z "$VAULT_STRIKE" ] || \
[ -z "$ROUND_TRANSITION_DURATION" ] || \
[ -z "$AUCTION_DURATION" ] || \
[ -z "$ROUND_DURATION" ] || \
[ -z "$ARGENT_ADDRESS" ] || \
[ -z "$ARGENT_SALT" ] || \
[ -z "$ARGENT_CONSTRUCTOR_ARG1" ]; then \
Expand All @@ -40,6 +46,9 @@ ENV SIGNER_ADDRESS=$SIGNER_ADDRESS
ENV FOSSIL_PROCESSOR_ADDRESS=$FOSSIL_PROCESSOR_ADDRESS
ENV VAULT_ALPHA=$VAULT_ALPHA
ENV VAULT_STRIKE=$VAULT_STRIKE
ENV ROUND_TRANSITION_DURATION=$ROUND_TRANSITION_DURATION
ENV AUCTION_DURATION=$AUCTION_DURATION
ENV ROUND_DURATION=$ROUND_DURATION
ENV ARGENT_ADDRESS=$ARGENT_ADDRESS
ENV ARGENT_SALT=$ARGENT_SALT
ENV ARGENT_CONSTRUCTOR_ARG1=$ARGENT_CONSTRUCTOR_ARG1
Expand Down Expand Up @@ -71,5 +80,5 @@ RUN scarb build
CMD bash -c " cd katana && \
chmod +x ./deploy_contracts_devnet.sh && \
chmod +x ./deploy_and_fund_argent_wallet.sh && \
./deploy_contracts_devnet.sh $SIGNER_ADDRESS $FOSSIL_PROCESSOR_ADDRESS $VAULT_ALPHA $VAULT_STRIKE && \
./deploy_contracts_devnet.sh $SIGNER_ADDRESS $FOSSIL_PROCESSOR_ADDRESS $VAULT_ALPHA $VAULT_STRIKE $ROUND_TRANSITION_DURATION $AUCTION_DURATION $ROUND_DURATION && \
./deploy_and_fund_argent_wallet.sh $ARGENT_ADDRESS $ARGENT_SALT $ARGENT_CONSTRUCTOR_ARG1"
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ services:
- FOSSIL_PROCESSOR_ADDRESS=${FOSSIL_PROCESSOR_ADDRESS}
- VAULT_ALPHA=${VAULT_ALPHA}
- VAULT_STRIKE=${VAULT_STRIKE}
- ROUND_TRANSITION_DURATION=${ROUND_TRANSITION_DURATION}
- AUCTION_DURATION=${AUCTION_DURATION}
- ROUND_DURATION=${ROUND_DURATION}
- ARGENT_ADDRESS=${ARGENT_WALLET_ADDRESS}
- ARGENT_SALT=${ARGENT_WALLET_SALT}
- ARGENT_CONSTRUCTOR_ARG1=${ARGENT_WALLET_CONSTRUCTOR_ARG1}
17 changes: 10 additions & 7 deletions katana/deploy_contracts_devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Ensure the script stops on the first error
set -e

echo
echo
echo "============================"
echo "Deploy Pitchlake Contracts"
echo "============================"
echo
echo

# Set compiler version
COMPILER_VERSION="2.8.2"
Expand All @@ -26,7 +26,7 @@ fi

# Check if all required arguments are provided
if [ $# -ne 4 ]; then
echo "Usage: $0 <SIGNER_ADDRESS> <FOSSIL_PROCESSOR_ADDRESS> <VAULT_ALPHA> <VAULT_STRIKE>"
echo "Usage: $0 <SIGNER_ADDRESS> <FOSSIL_PROCESSOR_ADDRESS> <VAULT_ALPHA> <VAULT_STRIKE> <ROUND_TRANSITION_DURATION> <AUCTION_DURATION> <ROUND_DURATION>"
exit 1
fi

Expand All @@ -35,6 +35,9 @@ SIGNER_ADDRESS=$1
FOSSIL_PROCESSOR_ADDRESS=$2
VAULT_ALPHA=$3
VAULT_STRIKE=$4
ROUND_TRANSITION_DURATION=$5
AUCTION_DURATION=$6
ROUND_DURATION=$7

# Check if deployment_addresses.env exists
if [ -f "deployment_addresses.env" ]; then
Expand All @@ -47,9 +50,9 @@ fi

# Check if the account file already exists
if [ ! -f "$STARKNET_ACCOUNT" ]; then
starkli account fetch $SIGNER_ADDRESS --output $STARKNET_ACCOUNT
else
echo "Acount config already exists at path $STARKNET_ACCOUNT"
starkli account fetch $SIGNER_ADDRESS --output $STARKNET_ACCOUNT
else
echo "Acount config already exists at path $STARKNET_ACCOUNT"
fi

# Declare and deploy the ETH contract
Expand Down Expand Up @@ -85,7 +88,7 @@ echo "[Vault] Class hash declared"

# Deploy the third contract with additional parameters and salt
sleep 2
VAULT_ADDRESS=$(starkli deploy $VAULT_HASH $FOSSILCLIENT_ADDRESS $ETH_ADDRESS $OPTIONROUND_HASH $VAULT_ALPHA $VAULT_STRIKE --salt 1 | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
VAULT_ADDRESS=$(starkli deploy $VAULT_HASH $FOSSILCLIENT_ADDRESS $ETH_ADDRESS $OPTIONROUND_HASH $VAULT_ALPHA $VAULT_STRIKE $ROUND_TRANSITION_DURATION $AUCTION_DURATION $ROUND_DURATION --salt 1 | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
echo "[Vault] Contract deployed"

# Set pricing data for first round to start
Expand Down

0 comments on commit 3386b6e

Please sign in to comment.