Testing status
Automated application tests
bun test covers:
- Financial values exposed by the app and API never display below zero.
- Fixed returns are prorated from 10% simple APY for each supported term.
- Every term's early-exit penalty decays from 25% to 10%, then zero at maturity.
- The 10 bp marketplace fee rounds up.
- Rolling-price display caching and retired Vault oracle-worker behavior.
Sway tests
Using forc 0.68.1:
- Vault: 17 tests for supported terms, oracle conversion, penalty boundaries, fixed-point rounding, and checked overflow/underflow behavior.
- Bond Market V2: 5 tests for fee ceilings, value conservation, and checked accounting boundaries.
- Legacy Bond Market: 5 tests for rounded fees, value conservation, and checked accounting boundaries.
- Test Assets: 5 tests for faucet quantities, sub-IDs, reserve units, and supply overflow protection.
Local-node integration
bun run test:integration uses forc 0.68.1 and fuel-core 0.43.1 from the sdk101 toolchain, with the same contract bytecode as testnet. Isolated, named suites live in test/integration/ for test assets, Vault, Market V2, and the owned proxy, alongside a cross-contract end-to-end suite covering the legacy market and pre-upgrade V2 bid recovery. Each named test starts a fresh local node and can run independently, for example:
bun test ./test/integration/vault.integration.ts -t "maturity"The suites verify:
- One-use tFUEL/tstFUEL faucet allocations.
- User rejection and owner authorization for tUSDC minting.
- Deployment with generated storage slots and contract initialization.
- Exactly
1_000_000_000_000raw tUSDC deposited into the Vault. - One FUEL and one stFUEL position opened with the same simulated O2-derived, non-$1 on-chain TWAP.
- Exact persistence of that equal price in both positions'
opening_price_e6. position_countand directget_positionreads.- Successful early-unbonding claim after advancing node time by 15 days.
- Successful maturity claim after advancing node time beyond the term.
- Atomic rollback for oracle multiplication, USDC-obligation, and test-supply overflow attacks at
u64boundaries. - Exact one-unit asks, recovered bids, buy-order fills, fee accounting, refunds, and zero-value Vault payouts without underflow or zero-transfer reverts.
Live oracle smoke test
bun run oracle:health:testnet validates the shared oracle's immutable O2 source, rolling record, sample count, freshness, and external updater health. The integration suite verifies rolling-price persistence, stale-open rejection, and that early exit remains available while the oracle is stale.
Fresh Fuel testnet smoke tests
The reserve-hardened deployment beginning at block 0x46b48aa / 74139818 was tested live for:
- Eight FUEL/stFUEL position openings using
min(live O2, rolling TWAP). Position 8 recorded live803, rolling799, and selected opening price799; its transaction is0x98eef9a9a9972959b30eb00f3e152be059e0b93839aef58ddb17edb5d4fd37d3. - Position transfer and early-unbond initiation, including NFT ownership and indexed-state verification.
- ETH and USDC ask creation and purchase, ask cancellation, general buy-order fill and refund, and permissionless ask/buy-order expiration.
- A one-raw-unit sale where the rounded fee consumes the full price, proving zero seller proceeds do not revert and fee accounting remains exact.
- Exact
NOT_MANAGER,NOT_OWNER, andNOT_PROXY_OWNERrejection for Vault, market, proxy, and test-asset attacks from the non-authority wallet. - Proxy target and owner, 10 bp market fee, Vault manager, zero initial liabilities, and exactly
1_000_000_000_000raw tUSDC reserve. - Protected-principal strategy deployment and unauthorized surplus withdrawal rejection, plus an authorized one-unit withdraw/fund reserve round trip.
- D1 reset/reindex from the new deployment block, eight indexed positions, aggregate market history, and current API configuration.
- Shared-oracle
price(), immutable O2 source/asset, 20 retained samples, and external updater health.
Public testnet time cannot be advanced, so successful live maturity and 14-day-unbonding claims remain time-dependent. Mainnet remains disabled and unaudited.