Skip to content

Commit

Permalink
Merge pull request #173 from OilerNetwork/eugen/devenv-lock-starkli-v…
Browse files Browse the repository at this point in the history
…ersion

Devenv: lock starkli version in Docker image
  • Loading branch information
eugenPtr authored Dec 3, 2024
2 parents 92aa905 + 4d03d64 commit 9a4dfe3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SHELL ["/bin/bash", "-c"]

# Set environment variables
ENV SCARB_VERSION=2.8.4
ENV STARKLI_VERSION=0.2.8
ENV STARKLI_VERSION=0.3.5

# Define build-time arguments
ARG SIGNER_PRIVATE_KEY
Expand Down Expand Up @@ -52,8 +52,10 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/instal

# Install Starkli
ENV PATH="$PATH:/root/.starkli/bin"
RUN curl https://get.starkli.sh | sh
RUN starkliup
RUN curl -L https://github.com/xJonathanLEI/starkli/releases/download/v${STARKLI_VERSION}/starkli-x86_64-unknown-linux-gnu.tar.gz -o starkli.tar.gz && \
mkdir -p /root/.starkli/bin && \
tar -xvf starkli.tar.gz -C /root/.starkli/bin && \
rm starkli.tar.gz

WORKDIR /contracts
# Copy project files
Expand Down
9 changes: 6 additions & 3 deletions katana/deploy_contracts_devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ echo "Deploy Pitchlake Contracts"
echo "============================"
echo

# Set compiler version
COMPILER_VERSION="2.8.2"

# Print environment variables
echo "Environment variables:"
echo "STARKNET_ACCOUNT: $STARKNET_ACCOUNT"
Expand Down Expand Up @@ -61,7 +64,7 @@ ETH_ADDRESS="0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"

# Declare the first contract
sleep 2
FOSSILCLIENT_HASH=$(starkli declare ../target/dev/pitch_lake_FossilClient.contract_class.json --compiler-version 2.8.2 | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
FOSSILCLIENT_HASH=$(starkli declare ../target/dev/pitch_lake_FossilClient.contract_class.json --compiler-version $COMPILER_VERSION | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
echo "[Fossil Client] Class hash declared"

# Deploy the first contract with salt and FOSSIL_PROCESSOR_ADDRESS
Expand All @@ -71,12 +74,12 @@ echo "[Fossil Client] Contract deployed"

# Declare the second contract
sleep 2
OPTIONROUND_HASH=$(starkli declare ../target/dev/pitch_lake_OptionRound.contract_class.json --compiler-version 2.8.2 | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
OPTIONROUND_HASH=$(starkli declare ../target/dev/pitch_lake_OptionRound.contract_class.json --compiler-version $COMPILER_VERSION | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
echo "[Option Round] Class hash declared"

# Declare the third contract
sleep 2
VAULT_HASH=$(starkli declare ../target/dev/pitch_lake_Vault.contract_class.json --compiler-version 2.8.2 | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
VAULT_HASH=$(starkli declare ../target/dev/pitch_lake_Vault.contract_class.json --compiler-version $COMPILER_VERSION | grep -o '0x[a-fA-F0-9]\{64\}' | head -1)
echo "[Vault] Class hash declared"

# Deploy the third contract with additional parameters and salt
Expand Down

0 comments on commit 9a4dfe3

Please sign in to comment.