Labels: Official Campaign | FWC26 GrantFox OSS Maybe Rewarded contract soroban tooling bug
This is a smart-contract issue for the GrantFox FWC26 campaign. Bump the counters read by the stats view and make invariant checks callable by non-admin watchers so monitoring can run unattended.
Requirements and Context
contracts/finchippay-contract/src/multi_sig.rs — get_contract_stats (≈ line 280):
let c = env.storage().persistent().get(&key).unwrap_or(0);
bump_if_present(&env, &key);
This one bumps — but the singleton counters it reads (EscrowCount, StreamCount, MultiSigCount) are not bumped by the sweep's bump_config_key arms (they are swept under their class item 0 via bump_to_floor_if_present, which is fine). The real gap: check_invariants in lib.rs (≈ line 1940) requires admin.require_auth() — a public watcher/keeper cannot run the invariant check, so the "on-chain invariant checker" the README advertises is only callable by the admin. Off-chain monitoring has to call an admin-gated function or simulate a privileged call, which is awkward and misleading.
Objectives
- Make
check_invariants permissionless (it only reads and validates state; it performs no writes that harm callers), or expose a separate permissionless get_invariant_report view.
- Keep the admin-gated
check_invariants for audit if desired, but add the public view.
- Add a test calling the invariant view from a non-admin address.
Suggested Execution
- Fork and branch:
git checkout -b fix/invariant-public.
- Add a permissionless invariant-report entrypoint in
lib.rs.
- Add tests; run
cargo fmt --check && cargo clippy -- -D warnings && cargo test.
Acceptance Criteria
Guidelines
- The report must be read-only (no state mutation) so it is safe to expose publicly.
Timeframe: 24 hours
Labels:
Official Campaign | FWC26GrantFox OSSMaybe RewardedcontractsorobantoolingbugRequirements and Context
contracts/finchippay-contract/src/multi_sig.rs—get_contract_stats(≈ line 280):This one bumps — but the singleton counters it reads (
EscrowCount,StreamCount,MultiSigCount) are not bumped by the sweep'sbump_config_keyarms (they are swept under their class item 0 viabump_to_floor_if_present, which is fine). The real gap:check_invariantsinlib.rs(≈ line 1940) requiresadmin.require_auth()— a public watcher/keeper cannot run the invariant check, so the "on-chain invariant checker" the README advertises is only callable by the admin. Off-chain monitoring has to call an admin-gated function or simulate a privileged call, which is awkward and misleading.Objectives
check_invariantspermissionless (it only reads and validates state; it performs no writes that harm callers), or expose a separate permissionlessget_invariant_reportview.check_invariantsfor audit if desired, but add the public view.Suggested Execution
git checkout -b fix/invariant-public.lib.rs.cargo fmt --check && cargo clippy -- -D warnings && cargo test.Acceptance Criteria
okor the first violation.cargo test+wasm32v1-nonebuild pass.Guidelines
Timeframe: 24 hours