This guide defines the local workflow for building, documenting, deploying, and verifying the Soroban contracts in contracts/.
- Rust toolchain with the
wasm32-unknown-unknowntarget installed. - Soroban CLI available as
soroban. - A deployment environment with
NETWORK,CONTRACT_ID, and account credentials set when executing real chain operations.
Run the generated-docs script to assemble the current contract documentation bundle:
./scripts/generate-docs.shThis writes a single generated reference to docs/generated/contract-documentation.md so reviewers can inspect the ABI, operational steps, and verification report from one place.
The deployment script follows a narrow sequence:
- Build the contract WASM artifact.
- Flatten the source tree into a deterministic verification bundle.
- Record a deployment manifest with hashes and metadata.
- Optionally execute a chain deployment when the caller provides the required environment variables and CLI arguments.
Example:
NETWORK=testnet CONTRACT_ID=<CONTRACT_ID> ./scripts/deploy.shThe script keeps the manifest under target/nestera-contract-ops/deployments/ so later verification steps can compare the deployed artifact with the local tree.
The verification script performs two checks:
- Recompute the current source hash.
- Compare it against the latest deployment manifest.
If the hashes differ, the deployment is out of sync and should be redeployed from the current source.
Example:
NETWORK=testnet CONTRACT_ID=<CONTRACT_ID> ./scripts/verify.shThe status script prints the most recent deployment manifest, including:
- network name
- contract ID
- source hash
- WASM hash
- source bundle location
Use it before posting release notes or explorer links.
Rollback is implemented as a redeployment of a previous manifest or source bundle. The contract scripts do not mutate on-chain history; they prepare and document the previous known-good state so the operator can redeploy it cleanly.
Example:
ROLLBACK_MANIFEST=target/nestera-contract-ops/deployments/testnet/latest.json ./scripts/rollback.shExplorer verification is a metadata problem for Soroban: the deployed WASM hash, source bundle, network, and contract ID must match. The flattening step provides a deterministic source artifact for explorer-side or auditor-side comparison.
- Run the contract tests.
- Generate the documentation bundle.
- Build and deploy the WASM artifact.
- Run the verification script against the manifest.
- Record the explorer URL and manifest hash in the release notes.