Contracts — Getting Started
Prerequisites
- Rust:
1.80.0or higher (rustup target add wasm32v1-none) - Stellar CLI:
21.0.0or higher (cargo install --locked stellar-cli)
🛠️ Building & Testing
Clone the contracts repository:
bash
git clone https://github.com/aigbagbobila/stellar-agent-guard-contracts.git
cd stellar-agent-guard-contractsRun unit and integration tests:
bash
cargo testRun linter & formatter checks:
bash
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --checkBuild release WASM bytecode:
bash
cargo build --target wasm32v1-none --releaseWASM output artifact location: target/wasm32v1-none/release/stellar_agent_guard_contracts.wasm
🚀 Deployment & Initialization (Testnet)
1. Upload WASM Bytecode
bash
stellar contract install \
--wasm target/wasm32v1-none/release/stellar_agent_guard_contracts.wasm \
--network testnet \
--source <ADMIN_KEY>2. Deploy Custom Account Instance
bash
stellar contract deploy \
--wasm-hash <WASM_HASH> \
--network testnet \
--source <ADMIN_KEY>3. Initialize Contract
bash
stellar contract invoke \
--id <CONTRACT_ID> \
--network testnet \
--source <ADMIN_KEY> \
-- \
initialize \
--admin <ADMIN_ADDRESS> \
--agent_pubkey <AGENT_ED25519_HEX_32_BYTES>