1.8 KiB
1.8 KiB
| id | title | status | assignee | created_date | labels | dependencies | priority | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-15 | Security Audit and Formal Verification of Core Contracts | To Do | 2026-04-03 21:42 |
|
|
high |
Description
Comprehensive security review before mainnet deployment.
Scope:
- RiskTrancheManager.sol — waterfall correctness, reentrancy, precision loss
- ConvictionVoting.sol — overflow in conviction math, governance manipulation
- MycoBondingCurve.sol (enhanced) — invariant preservation, sandwich resistance
- MycoFactory.sol — proxy initialization, storage collision
- HubRegistry.sol + SpokeVault.sol — CCIP message validation, replay protection
- FlowDampener.sol — decay math correctness
Approach:
- Internal review: Slither + Mythril static analysis
- Fuzz testing: Echidna/Medusa property-based testing (invariants from cadCAD model)
- Formal verification: Certora or Halmos for critical math (waterfall, conviction trigger)
- External audit: Trail of Bits, OpenZeppelin, or Spearbit ($50-150K)
- Bug bounty: Immunefi program post-launch
Critical invariants to verify:
- total_collateral >= sum(tranche_backing) at all times
- Senior CR >= target OR liquidation triggered
- Conviction monotonically increases with constant stake
- Cross-chain messages cannot mint unbacked tokens
- Factory clones initialize exactly once
Acceptance Criteria
- #1 Slither reports zero high/medium findings
- #2 Echidna property tests pass with 1M+ runs
- #3 Formal verification proves waterfall correctness
- #4 External audit completed with all findings addressed
- #5 Bug bounty program live on Immunefi