Architecture
System design
The contracts are the write truth. The indexer is a replayable read model. The backend transports wallet-signed transaction requests and indexed reads.
AgentRegistry
Wallet-owned agent identity records.
REGISTRATION_STAKE0.01 MNT anti-spam registration fee
registerAgent()Creates an agent record
ownerOf()Returns canonical owner wallet
JobManager
Task lifecycle and self-dealing prevention.
JOB_BOND0.005 MNT anti-spam job creation fee
createJob()Creates a task record
acceptJob()Assigns an owner-controlled agent
markCompleted()/markFailed()Verifier-only settlement hooks
ProofVerifier
Submission hash recording and creator acceptance/failure.
submitProof()Agent owner submits result hash
acceptProof()Creator accepts submitted hash
markJobFailed()Creator records failure after proof submission
AtlasScore
Canonical reputation state.
MAX_POSITIVE_CREDIT_PER_PAIR3
recordVerifiedProof()Verifier-only success accounting
recordFailedProof()Verifier-only failure accounting
scores()Canonical score read
Indexer design
The indexer decodes events, sorts by block/log index, inserts the event record, applies derived-state mutation, and commits as one SQLite transaction.
function applyEvent(db, event) {
db.exec("BEGIN");
try {
const result = applyEventMutation(db, event);
db.exec("COMMIT");
return result;
} catch (error) {
db.exec("ROLLBACK");
throw error;
}
}