-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from carbonable-labs/devnet-scripting
Devnet scripting
- Loading branch information
Showing
17 changed files
with
342 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
KEYSTORE_PASSWORD=my_keystore_password | ||
STARKNET_ACCOUNT=path/to/account.json | ||
STARKNET_KEYSTORE=/path/to/keystore.json | ||
DEPLOYER_ADDRESS=="0x to your account" | ||
|
||
|
||
#mainnet/testnet/devnet rpc | ||
#The entrypoint to the chain (here is a local node) | ||
|
||
STARKNET_RPC='http://0.0.0.0:5050' | ||
|
||
# OPTIONAL | ||
#Nethermind juno rpc works perfectly but you can try another one ( not every rpc works) | ||
#Here is Sepolia URL, you can replace by a mainnet one. | ||
# If you have apikey https://free-rpc.nethermind.io/sepolia-juno/?apikey=<YOUR_API_KEY> | ||
FORK_URL='https://free-rpc.nethermind.io/sepolia-juno/' | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ keystore.json | |
__pycache__ | ||
env | ||
.env | ||
.env.* | ||
|
||
test.* | ||
|
||
# starknet | ||
|
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,2 @@ | ||
declare ../target/dev/carbon_v3_USDCarb.contract_class.json | ||
contract deployed at: declarelolError at deployment: Error: Failed to create Felt from string |
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,100 @@ | ||
{ | ||
"number": 0, | ||
"parentHash": "0x999", | ||
"timestamp": 5123512314, | ||
"stateRoot": "0x99", | ||
"sequencerAddress": "0x100", | ||
"gasPrices": { | ||
"ETH": 1111, | ||
"STRK": 2222 | ||
}, | ||
"feeToken": { | ||
"address": "0x55", | ||
"name": "ETHER", | ||
"symbol": "ETH", | ||
"decimals": 18, | ||
"class": "0x8", | ||
"storage": { | ||
"0x111": "0x1", | ||
"0x222": "0x2" | ||
} | ||
}, | ||
"universalDeployer": { | ||
"address": "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", | ||
"storage": { | ||
"0x10": "0x100" | ||
} | ||
}, | ||
"accounts": { | ||
"0x10f3d55ff67700b7d7c34294c57b6489992a76d33dd8dbca1e2d47209f2d338": { | ||
"publicKey": "0x1", | ||
"balance": "0xD3C21BCECCEDA1000000", | ||
"nonce": "0x1", | ||
"class": "0x444", | ||
"storage": { | ||
"0x1": "0x1", | ||
"0x2": "0x2" | ||
} | ||
}, | ||
"0x66efb28ac62686966ae85095ff3a772e014e7fbf56d4c5f6fac5606d4dde23a": { | ||
"publicKey": "0x1", | ||
"balance": "0xD3C21BCECCEDA1000000", | ||
"nonce": "0x1", | ||
"class": "0x444", | ||
"storage": { | ||
"0x1": "0x1", | ||
"0x2": "0x2" | ||
} | ||
}, | ||
"0x6b86e40118f29ebe393a75469b4d926c7a44c2e2681b6d319520b7c1156d114": { | ||
"publicKey": "0x2", | ||
"balance": "0xD3C21BCECCEDA1000000" | ||
}, | ||
"0x79156ecb3d8f084001bb498c95e37fa1c4b40dbb35a3ae47b77b1ad535edcb9": { | ||
"publicKey": "0x3" | ||
}, | ||
"0x053a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf": { | ||
"publicKey": "0x4", | ||
"balance": "0xD3C21BCECCEDA1000000", | ||
"privateKey": "0x115" | ||
} | ||
}, | ||
"contracts": { | ||
"0x29873c310fbefde666dc32a1554fea6bb45eecc84f680f8a2b0a8fbb8cb89af": { | ||
"balance": "0xD3C21BCECCEDA1000000", | ||
"class": "MyERC20", | ||
"storage": { | ||
"0x1": "0x1", | ||
"0x2": "0x2" | ||
} | ||
}, | ||
"0xe29882a1fcba1e7e10cad46212257fea5c752a4f9b1b1ec683c503a2cf5c8a": { | ||
"balance": "0xD3C21BCECCEDA1000000" | ||
}, | ||
"0x05400e90f7e0ae78bd02c77cd75527280470e2fe19c54970dd79dc37a9d3645c": { | ||
"storage": { | ||
"0x1": "0x1" | ||
} | ||
} | ||
}, | ||
"classes": [ | ||
{ | ||
"class": { | ||
"abi": [ | ||
{ | ||
"members": [ | ||
{ "name": "to", "offset": 0, "type": "felt" }, | ||
{ "name": "selector", "offset": 1, "type": "felt" }, | ||
{ "name": "data_offset", "offset": 2, "type": "felt" }, | ||
{ "name": "data_len", "offset": 3, "type": "felt" } | ||
], | ||
"name": "AccountCallArray", | ||
"size": 4, | ||
"type": "struct" | ||
} | ||
] | ||
}, | ||
"classHash": "0x444" | ||
} | ||
] | ||
} |
Empty file.
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,45 @@ | ||
#!/bin/bash | ||
source ../.env | ||
source .env | ||
|
||
# Function to set the contract path based on the given parameter | ||
set_contract_path() { | ||
case $1 in | ||
project) | ||
CONTRACT_PATH="./target/dev/carbon_v3_Project.contract_class.json" | ||
;; | ||
offsetter) | ||
CONTRACT_PATH="./target/dev/carbon_v3_Offsetter.contract_class.json" | ||
;; | ||
mock_stable) | ||
CONTRACT_PATH="./target/dev/carbon_v3_USDCarb.contract_class.json" | ||
;; | ||
minter) | ||
CONTRACT_PATH="./target/dev/carbon_v3_Minter.contract_class.json" | ||
;; | ||
*) | ||
echo "Invalid parameter. Please use one of the following: project, offsetter, mock_stable, minter." | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
# Check if a parameter is passed | ||
if [ -z "$1" ]; then | ||
echo "No parameter provided. Please specify a parameter: project, offsetter, mock_stable, minter." | ||
exit 1 | ||
fi | ||
|
||
# Set the contract path based on the provided parameter | ||
set_contract_path $1 | ||
|
||
# Declare the contract | ||
echo "Declaring the contract with CONTRACT_PATH=$CONTRACT_PATH..." | ||
output=$(starkli declare "$CONTRACT_PATH" --account "$STARKNET_ACCOUNT" --rpc "$STARKNET_RPC" --keystore "$STARKNET_KEYSTORE" --keystore-password "$KEYSTORE_PASSWORD" 2>&1) | ||
|
||
if [[ $output == *"Error"* ]]; then | ||
echo "Error: $output" | ||
exit 1 | ||
fi | ||
|
||
echo -e "Contract declare: $output" |
Oops, something went wrong.