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
7 changes: 7 additions & 0 deletions soroban/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions soroban/contracts/renewable-energy-certificate-tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "renewable_energy_certificate_tracker"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = "21.0.0"

[dev-dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]
74 changes: 74 additions & 0 deletions soroban/contracts/renewable-energy-certificate-tracker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Renewable Energy Certificate Tracker Contract Makefile

.PHONY: build test clean deploy

# Build the contract
build:
cargo build --target wasm32-unknown-unknown --release

# Build using Stellar CLI
stellar-build:
stellar contract build

# Run tests
test:
cargo test

# Clean build artifacts
clean:
cargo clean
rm -f *.wasm

# Deploy contract (requires Stellar CLI and network configuration)
deploy:
stellar contract deploy --wasm target/wasm32-unknown-unknown/release/renewable_energy_certificate_tracker.wasm

# Install dependencies
install:
cargo install --locked soroban-cli

# Format code
fmt:
cargo fmt

# Check code
check:
cargo check

# Run clippy
clippy:
cargo clippy -- -D warnings

# Build optimized WASM
build-optimized:
cargo build --target wasm32-unknown-unknown --release
wasm-opt -Oz target/wasm32-unknown-unknown/release/renewable_energy_certificate_tracker.wasm -o renewable_energy_certificate_tracker_optimized.wasm

# Generate contract bindings
bindings:
stellar contract bindings typescript --output-dir ./bindings

# Run integration tests
test-integration:
cargo test --test integration

# All-in-one build and test
all: clean build test

# Help target
help:
@echo "Available targets:"
@echo " build - Build the contract using cargo"
@echo " stellar-build - Build using Stellar CLI"
@echo " test - Run unit tests"
@echo " clean - Clean build artifacts"
@echo " deploy - Deploy contract to network"
@echo " install - Install Soroban CLI"
@echo " fmt - Format code"
@echo " check - Check code without building"
@echo " clippy - Run clippy linter"
@echo " build-optimized - Build optimized WASM"
@echo " bindings - Generate contract bindings"
@echo " test-integration - Run integration tests"
@echo " all - Clean, build, and test"
@echo " help - Show this help message"
Loading