forked from Vero-protocol/vero-core-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (57 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
67 lines (57 loc) · 2.16 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
# Vero Core Contracts — Makefile
#
# Targets:
# build — Compile the WASM contract
# test — Run all unit and integration tests
# check — Quick syntax check without full compilation
# verify — Run Kani formal verification harnesses
# invariants — Run runtime safety invariant tests
# proofs — Run K-framework proofs (requires K Framework)
# deploy-testnet — Upload WASM and deploy a fresh instance on testnet
# all — Build, test, and verify
.PHONY: build test check verify invariants proofs deploy-testnet all
build:
cargo build --target wasm32-unknown-unknown --release
test:
cargo test
check:
cargo check
# Kani proof harnesses (requires cargo-kani installed)
verify:
cargo kani --manifest-path verification/Cargo.toml
# Runtime invariant tests (pure consensus logic, no Soroban host)
invariants:
cargo test --test safety_invariants
# K-framework proofs (requires K Framework 6.0+)
proofs:
cd proofs && bash build.sh
# Deploy to testnet.
# Requires: DEPLOYER_SECRET, TOKEN_CONTRACT_ID, and LOCK_THRESHOLD to be set
# in the environment (or sourced from .env). See DEPLOY.md for full setup.
deploy-testnet: build
@echo "==> Uploading WASM to testnet..."
$(eval WASM_HASH := $(shell stellar contract upload \
--network testnet \
--source deployer \
--wasm target/wasm32-unknown-unknown/release/vero_core_contracts.wasm))
@echo "WASM hash: $(WASM_HASH)"
@echo "==> Deploying contract instance..."
$(eval CONTRACT_ID := $(shell stellar contract deploy \
--network testnet \
--source deployer \
--wasm-hash $(WASM_HASH)))
@echo "Contract ID: $(CONTRACT_ID)"
@echo ""
@echo "Next: run 'make initialize-testnet CONTRACT_ID=$(CONTRACT_ID)' or follow DEPLOY.md Step 5."
# Initialize a deployed contract instance on testnet.
# Requires: CONTRACT_ID, TOKEN_CONTRACT_ID, LOCK_THRESHOLD env vars.
initialize-testnet:
stellar contract invoke \
--network testnet \
--source deployer \
--id $(CONTRACT_ID) \
-- initialize \
--admin $$(stellar keys address deployer) \
--token $(TOKEN_CONTRACT_ID) \
--lock_threshold $(LOCK_THRESHOLD)
all: check test invariants verify