Skip to content

Commit

Permalink
Update .gitignore and deploy.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
Arn0d committed Jan 10, 2024
1 parent 1a4dd07 commit 595577f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
32 changes: 29 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
target
.env
# IDE
.vscode
account.json
keystore.json
keystore.json

# Python
__pycache__
env
test.*

# starknet
node.json
*.deployments.txt
artifacts
target

# nile
127.0.0.1.*

# Protostar
build
*logs.json

.DS_Store

# system & test
tmp
.tmp*
.env*
scripts/debug_*
23 changes: 21 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/bash
source ../.env

# Check if --debug parameter is passed
debug="false"
for arg in "$@"
do
if [ "$arg" == "--debug" ]
then
debug="true"
fi
done

SIERRA_FILE=../target/dev/migrator_Migrator.sierra.json
SOURCE_ADDRESS=0x5c30f6043246a0c4e45a0316806e053e63746fba3584e1f4fc1d4e7f5300acf
TARGET_ADDRESS=0x007afb15db3fb57839fec89c20754eb59f8d7e3f87d953ee68b0a99b6f527b3e
Expand All @@ -21,6 +31,9 @@ build() {
# declare the contract
declare() {
build
if [[ $debug == "true" ]]; then
printf "declare %s\n" "$SIERRA_FILE" > debug_migrator.log
fi
output=$(starkli declare $SIERRA_FILE --keystore-password $KEYSTORE_PASSWORD --watch 2>&1)

if [[ $output == *"Error"* ]]; then
Expand All @@ -39,8 +52,12 @@ declare() {
# $4 - Owner
deploy() {
class_hash=$(declare | tail -n 1)
sleep 5
sleep 1

build
if [[ $debug == "true" ]]; then
printf "deploy %s %s %s u256:%s u256:%s %s \n" "$class_hash" "$SOURCE_ADDRESS" "$TARGET_ADDRESS" "$SLOT" "$VALUE" "$OWNER" >> debug_migrator.log
fi
output=$(starkli deploy $class_hash "$SOURCE_ADDRESS" "$TARGET_ADDRESS" u256:"$SLOT" u256:"$VALUE" "$OWNER" --keystore-password $KEYSTORE_PASSWORD --watch 2>&1)

if [[ $output == *"Error"* ]]; then
Expand All @@ -55,7 +72,9 @@ deploy() {
setup() {
contract=$(deploy)
sleep 5

if [[ $debug == "true" ]]; then
printf "invoke %s add_minter u256:%s %s \n" "$TARGET_ADDRESS" "$SLOT" "$contract" >> debug_migrator.log
fi
output=$(starkli invoke $TARGET_ADDRESS add_minter u256:$SLOT $contract --keystore-password $KEYSTORE_PASSWORD --watch 2>&1)

if [[ $output == *"Error"* ]]; then
Expand Down

0 comments on commit 595577f

Please sign in to comment.