Kansoku LabsDocs

Docs

Smart contracts

KansokuPass access tiers and the WatchtowerRegistry lifecycle.

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).

TierAccessHow it is obtained
ExplorerBase tier, 5 analyses/weekFree, one-per-wallet mintExplorer()
AnalystHigher quota, longer watchtowerspurchaseAnalyst(months), paid in USDG
FounderFull access, all levelsOperator 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

from createWatchtower

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.