-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (58 loc) · 1.78 KB
/
Copy pathjustfile
File metadata and controls
72 lines (58 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# COMEBACKHERE-contracts task runner
# Compile all contracts
build:
cargo build
# Run all tests
test:
cargo test
# Format all code
fmt:
cargo fmt --all
# Run clippy lints
lint:
cargo clippy -- -D warnings
# Check dependencies for vulnerabilities and license issues
deny:
cargo deny check
# Audit dependencies for known security vulnerabilities
audit:
cargo audit
# Run format and lint checks (for CI)
check: fmt lint test deny
@echo "✓ All checks passed"
# Run all quality gates before pushing
check-all: fmt lint test audit
@echo "✓ All quality gates passed"
# Deploy all three contracts to testnet.
#
# Required env vars:
# STELLAR_ACCOUNT — signing identity (key name or secret key), e.g. "alice"
# STELLAR_NETWORK — network alias configured in the Stellar CLI, e.g. "testnet"
#
# Optional env vars (override when using a custom RPC):
# STELLAR_RPC_URL — RPC endpoint (defaults to the CLI network alias)
# STELLAR_NETWORK_PASSPHRASE — network passphrase (defaults to the CLI network alias)
#
# Example:
# STELLAR_ACCOUNT=alice STELLAR_NETWORK=testnet just deploy
deploy:
#!/usr/bin/env bash
set -euo pipefail
: "${STELLAR_ACCOUNT:?STELLAR_ACCOUNT must be set}"
: "${STELLAR_NETWORK:?STELLAR_NETWORK must be set}"
cargo build --target wasm32-unknown-unknown --release
WASM_DIR="target/wasm32-unknown-unknown/release"
deploy_contract() {
local name="$1"
local id
id=$(stellar contract deploy \
--wasm "$WASM_DIR/${name}.wasm" \
--source "$STELLAR_ACCOUNT" \
--network "$STELLAR_NETWORK")
echo "$name contract ID: $id"
}
deploy_contract compliance
deploy_contract invoice
deploy_contract treasury
# Default target
default: check