Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
scarb 2.6.3
starknet-foundry 0.24.0
scarb 2.9.2
13 changes: 7 additions & 6 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "examples"
version = "0.1.0"
dependencies = [
"hdp_cairo",
]

[[package]]
name = "hdp_cairo"
version = "0.1.0"
Expand All @@ -10,10 +17,4 @@ name = "modules"
version = "0.1.0"
dependencies = [
"hdp_cairo",
"snforge_std",
]

[[package]]
name = "snforge_std"
version = "0.24.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.24.0#95e9fb09cb91b3c05295915179ee1b55bf923653"
2 changes: 2 additions & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ version = "0.1.0"
edition = "2023_11"

members = [
"examples",
"hdp_cairo",
"tests",
]

[workspace.dependencies]
starknet = "2.9.2"
hdp_cairo = { path = "hdp_cairo" }
18 changes: 18 additions & 0 deletions examples/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "examples"
version = "0.1.0"
edition = "2023_11"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = { workspace = true }
hdp_cairo = { workspace = true }

[[target.starknet-contract]]
sierra = true
casm = true
casm-add-pythonic-hints = true

[scripts]
test = "snforge test"
29 changes: 29 additions & 0 deletions examples/compose_hdp_input.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Resolve the absolute path of the compiled class file
compiled_class_path=$(realpath ../target/dev/examples_example.compiled_contract_class.json)

# Check if the file exists
if [ ! -f "$compiled_class_path" ]; then
echo "Error: Compiled class file not found at $compiled_class_path"
exit 1
fi

# Read the contents of the file
compiled_class_content=$(<"$compiled_class_path")

# Define the JSON structure using jq
json_output=$(jq -n \
--argjson compiled_class "$compiled_class_content" \
'{
"params": [],
"compiled_class": $compiled_class
}')

# Specify the output file name
output_file="hdp_input.json"

# Write the JSON to the file
echo "$json_output" > "$output_file"

echo "JSON file created: $output_file"
Loading
Loading