Living document for tracking protocol development, security improvements, and planned upgrades.
| Contract | Address | Version | Status |
|---|---|---|---|
| Token | 0x73F6d2BBef125b3A5F91Fe23c722f3C321f007E5 |
V1 | ✅ Final |
| Registry | 0xb8264f3117b498ddF912EBF641B2301103D80f06 |
V1 | |
| Registry | 0x7EA99470e22E5149F97FbDeB5807AEF54Deafc01 |
V2 | ✅ Active |
| Staking | 0x916FFb3eB82616220b81b99f70c3B7679B9D62ca |
V1 | ✅ Active |
| Oracle | 0xf02c3A5FED3c460628b5781E3c304Dd8206E85bd |
V1 | |
| RewardPool | 0x790b0766e9e2db7c59526b247851D16bB493a95B |
V1 | ✅ Active |
| Timelock | 0x3Ef44fb908C86865A9315277f9AFc6b65A87e702 |
V1 | ✅ Active |
| Governor | 0xB230Ffa9CA40F705756BC12698119f1B45687cd6 |
V1 | ✅ Active |
Priority: CRITICAL
Status: Code ready, awaiting deployment
Script: contracts/scripts/deploy-registry-v2.ts
- Problem: Chunked inscriptions have no timeout. Attacker can block arbitrary content hashes forever by starting chunk 0 and never completing.
- Solution: Added
CHUNK_TIMEOUT(24h) andcleanupAbandonedChunk()function - Migration:
- Deploy V2
- Update indexer to watch both V1 + V2
- Frontend uses V2 for new inscriptions
- V1 data preserved in events (immutable)
- Deploy Registry V2 to Base mainnet —
0x7EA99470e22E5149F97FbDeB5807AEF54Deafc01 - Verify on BaseScan — https://basescan.org/address/0x7EA99470e22E5149F97FbDeB5807AEF54Deafc01#code
- Update API config (
api/src/chain/networks.ts) - Update web config (
web/src/lib/contracts.ts) - Rebuild & redeploy API to Railway
- Announce migration
Priority: HIGH
Status: Code ready, deployment blocked on VRF integration
Target: Before significant TVL in detection system
- Problem: Jury selection uses
blockhash(block.number - 1)— predictable by validators - Solution: Commit-reveal pattern with 5-block delay
- Code:
ISNADOracle.solupdated withcommitBlockfield andCOMMIT_BLOCKSconstant
- Problem:
transfer()forwards only 2300 gas — fails for contract recipients - Solution: Replace with
call()+ existing reentrancy guards - Locations fixed: 3 (executeSlash, _finalizeVerdict x2)
- Decision: Intentionally permissionless for protocol liveness
- Added:
nonReentrantmodifier, NatSpec documentation
The commit-reveal pattern is a stopgap. For production-grade randomness:
TODO: Chainlink VRF Integration
- [ ] Add VRF consumer contract
- [ ] Fund LINK subscription
- [ ] Replace commit-reveal with VRF callback
- [ ] Test on Sepolia first
- Integrate Chainlink VRF (or keep commit-reveal for MVP)
- Deploy Oracle V2
- Update Staking contract reference (if needed)
- Migrate active flags (if any) or wait for clean slate
- Update API/indexer
File: ISNADStakingV3.sol
-
Unbounded Array Iteration
getTrustScore()loops all attestations — DoS risk at scale- Fix: Maintain running totals or pagination
- Priority: MEDIUM (not urgent at current scale)
-
Stale Attestation Cleanup
- Unstaked attestations remain in arrays (amount=0)
- Fix: Swap-and-pop removal
- Priority: LOW (gas optimization)
-
Typed Interface for Burn
- Using raw
call()instead of typed interface - Fix:
ISNADToken(token).burnFrom(...) - Priority: LOW (works but fragile)
- Using raw
-
Reduce admin key power
- Move more functions behind Timelock
- Consider multisig for emergency functions
-
Juror pool expansion
- Currently admin-managed
- Future: Permissionless juror registration with stake requirement
Performed by: Rapi (using ToB audit skills)
| Finding | Severity | Status |
|---|---|---|
| Chunk timeout griefing | CRITICAL | ✅ Fixed (V2) |
| Weak PRNG jury selection | HIGH | ✅ Fixed (V2 code) |
| transfer() gas limit | HIGH | ✅ Fixed (V2 code) |
| executeSlash permissionless | HIGH | ✅ Documented |
| Unbounded array iteration | MEDIUM | 📋 Backlog |
| Stale attestation arrays | LOW | 📋 Backlog |
| Raw call for burn | LOW | 📋 Backlog |
- ✅ ReentrancyGuard on all state-changing functions
- ✅ SafeERC20 for token transfers
- ✅ Granular role-based access control
- ✅ AutoUnpausable emergency brake (max 7 days)
- ✅ Whale caps prevent stake concentration
- ✅ Lock periods prevent flash loan exploits
- ✅ Zero-address checks on constructors
- ✅ Solidity 0.8+ overflow protection
- Proxy pattern: Consider for future contracts to enable upgrades
- Diamond pattern: For complex multi-facet upgrades
- L2 deployment: Already on Base, consider other L2s
- Cross-chain: Bridge trust scores to other chains
- Fee distribution: LP fees currently to deployer wallet
- Staking rewards: RewardPool funded but distribution TBD
- Governance: Governor active but needs proposal templates
# Deploy Registry V2
cd contracts && npx hardhat run scripts/deploy-registry-v2.ts --network base
# Run security checks
npx hardhat test
slither .
# Verify contract
npx hardhat verify --network base <ADDRESS>Last updated: 2026-02-02 by Rapi