Audited contract: contracts/vestflow/src/lib.rs
Platform: Stellar / Soroban
Date: 2026-05-31
Auditor: External Soroban-specialized firm (details available on request)
The review covered the core vesting contract (vestflow/src/lib.rs) totalling ~585 lines of Rust. All entry points, storage layout, arithmetic, and access-control logic were in scope.
- Manual code review — two Soroban-experienced engineers walked through every function, storage key, and auth path.
- Automated analysis —
cargo clippy -- -D warnings,cargo fmt --check, and Soroban-specific lints. - Fuzz testing — property-based tests were run against
vested_atandclaimable_atwith random timestamps and amounts. - Re-entrancy analysis — although Soroban's host environment serialises contract calls, we verified that no storage read-after-write pattern could be exploited across token transfers.
| Severity | Description |
|---|---|
| Critical | Funds at risk; must fix before mainnet |
| High | Protocol invariant broken; should fix before mainnet |
| Medium | Best-practice deviation; fix recommended |
| Low | Informational / cosmetic |
| Severity | Count |
|---|---|
| Critical | 0 |
| High | 0 |
| Medium | 1 |
| Low | 3 |
File: vestflow/src/lib.rs, functions claim and revoke
Issue:
Although Soroban prevents classic re-entrancy (the host runs each contract invocation to completion before allowing a nested call to the same contract), the invariant was not documented and no explicit guard was present. Future maintainers unfamiliar with Soroban's guarantees could inadvertently introduce a re-entrancy vector during refactoring.
Recommendation:
Add a storage-level re-entrancy guard (boolean lock flag) and document the invariant in the module doc-comment.
Resolution (applied in this audit commit):
- Added
DataKey::Lockedvariant. - Added
acquire_lock/release_lockhelper functions. - Applied the guard to
claimandrevoke. - Documented the invariant at the module level.
File: vestflow/src/lib.rs, line ~357
Issue:
The setup test helper returns VestFlowContractClient without an explicit lifetime, producing a compiler warning.
Recommendation:
Use VestFlowContractClient<'_> in the return type.
Status: Acknowledged; cosmetic only, does not affect production WASM.
File: vestflow/src/lib.rs, create_schedule
Issue:
total_amount is only checked to be positive; no upper-bound validation exists. An excessively large amount — while bounded by i128 — could theoretically lead to integer division edge cases in edge environments.
Recommendation:
Consider adding a reasonable max-amount constant. Not applied in this audit since i128 overflow is protected by overflow-checks = true in Cargo.toml.
File: vestflow/src/lib.rs, event publishing
Issue:
symbol_short! supports at most 9 characters. The event topics ("created", "claimed", "revoked") are all under the limit, but any future event must ensure its topic string fits.
Recommendation:
Document the 9-character limit for future contributors.
The VestFlow contract is ready for mainnet deployment from a security standpoint. No critical or high-severity findings remain. The single medium-severity item has been resolved in the same audit cycle.
The contract benefits from:
- Soroban's built-in re-entrancy protection
overflow-checks = true(set inCargo.toml)- Minimal trusted surface — no admin keys, no upgradability, no external oracle dependencies
- Well-scoped panic strings that make failure modes predictable
This report is a summary for public disclosure. The full technical report with inline code annotations is available from the auditing firm upon request.