contracts/ holds two small, dependency-free Solidity contracts. Both compile with node scripts/compile-contracts.mjs, which writes ABIs and bytecode to src/lib/abi/.
KansokuPass
A minimal ERC-1155 with three access tiers, checked through hasAccess(account, level).
| Tier | Access | How it is obtained |
|---|---|---|
| Explorer | Base tier, 5 analyses/week | Free, one-per-wallet mintExplorer() |
| Analyst | Higher quota, longer watchtowers | purchaseAnalyst(months), paid in USDG |
| Founder | Full access, all levels | Operator grantPass(to, FOUNDER_PASS) |
WatchtowerRegistry
Holds ownership of monitoring jobs and anchors analysis receipts. The polygon and rule configuration never reach the contract, only their hashes.
createWatchtower
areaHash, ruleHash, expiresAt → new id
commitAnalysis
reportHash anchored while active
expired
expiresAt has passed
transferWatchtower
owner hands the watchtower to another address
commitStandalone(reportHash) anchors a receipt with no watchtower at all, marked with watchtower id 0, for one-off analyses run outside any monitor.
