-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Award Scripts & Dynamic NFT Data Directory (#260)
* wip * award on sepolia * award on mainnet * award on local * award on local * use envs from root * wip * wip * dynamic routing for nft images * dynamic routing for nft images * dynamic routing for nft metadata * up for review * fmt * gofmt * testing fmt * scarb fmt with scarb 2.6.3 * updated markdown * updated markdown * updated markdown * Various readme and test changes * React app env var on docker compose * Scarb fmt * Go fmt --------- Co-authored-by: Brandon Roberts <[email protected]>
- Loading branch information
1 parent
ec99f2f
commit fc7ec9a
Showing
20 changed files
with
211 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Load environment variables from `.env` file | ||
if [ -f ../.env ]; then | ||
export $(grep -v '^#' ../.env | xargs) | ||
fi | ||
|
||
# Set environment and network details | ||
ENVIRONMENT="local" | ||
NETWORK_URL="http://localhost:5050" # Use the URL from your console output | ||
ART_PEACE_CONTRACT="0x6fe75e8821863019aa3e7b824cceaa8a42265bbf1374e3c92eebc698036d438" | ||
|
||
# Define the JSON file path from command line argument | ||
JSON_FILE_PATH="$1" | ||
|
||
# Verify contract exists before proceeding | ||
echo "Verifying contract at $ART_PEACE_CONTRACT..." | ||
if ! starkli class-hash-at $ART_PEACE_CONTRACT --rpc $NETWORK_URL > /dev/null 2>&1; then | ||
echo "Error: ArtPeace contract not found at $ART_PEACE_CONTRACT" | ||
echo "Please verify the contract address is correct" | ||
exit 1 | ||
fi | ||
|
||
echo "Contract verified successfully!" | ||
|
||
# Iterate through each user address and amount in the JSON file | ||
jq -c '.[]' "$JSON_FILE_PATH" | while read -r entry; do | ||
USER_ADDRESS=$(echo "$entry" | jq -r '.address') | ||
AMOUNT=$(echo "$entry" | jq -r '.amount') | ||
echo "Awarding $AMOUNT pixels to $USER_ADDRESS..." | ||
|
||
# Invoke the host_award_user function using starkli | ||
starkli invoke --rpc $NETWORK_URL --keystore $STARKNET_KEYSTORE --account $STARKNET_ACCOUNT \ | ||
--watch $ART_PEACE_CONTRACT host_award_user $USER_ADDRESS $AMOUNT | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"address": "0x328ced46664355fc4b885ae7011af202313056a7e3d44827fb24c9d3206aaa0", | ||
"amount": 10 | ||
}, | ||
{ | ||
"address": "0x05e01dB693CBF7461a016343042786DaC5A6000104813cF134a1E8B1D0a6810b", | ||
"amount": 20 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.