— Contracts —

FOUR CONTRACTS, ONE INTERFACE

An on-chain task/reward orchestrator that delegates every accept/reject decision to a pluggable verifier -- so 'how do we know a proof is valid' stays fully swappable.

IProofVerifier

The interface every verifier implements. One function:

function verify(bytes calldata proof, bytes32 publicInputsHash)
    external view returns (bool);

publicInputsHash is keccak256 of the exact .zkasm program text -- the program fully determines (initial value, instructions, result), so hashing it is enough to pin down what's being claimed.

UnimplementedStarkVerifier

Every call reverts. Exists so ProofOrchestrator has a default verifier that fails closed rather than silently accepting anything — "no real on-chain STARK verifier exists yet" is a compileable, testable fact, not just a line in documentation.

AttestedVerifier

Checks an ECDSA signature from one designated attester key over the claimed proof result — not the STARK proof itself. See the Threat Model page for the exact trust assumption this creates, and what a real verifier would require instead.

ProofOrchestrator: the 8 real tests

Access-control and state-machine coverage for "who can trigger a payment, and when" — not the cryptography, which is zkvm-stark's job and is tested separately in Rust.

test_submitProof_alwaysRevertsWithoutARealVerifier

Payment without a real verifier configured -- the default state is "pays nothing," not "pays on faith."

test_paysOutOnlyAfterAttestation

A prover collecting a reward before the attester has actually attested.

test_rejectsProofBytesThatDontMatchTheAttestation

Submitting different proof bytes than the ones the attester actually attested to.

test_onlyAttesterCanAttest

Anyone other than the configured attester address calling attest().

test_cannotDoubleFulfill

Claiming the same reward twice for one task.

test_onlyTheClaimingProverCanSubmit

A different address than the one that claimed the task submitting a proof for it.

test_cannotClaimAnAlreadyClaimedTask

Two provers racing to claim the same task and both succeeding.

test_cannotClaimOrSubmitForAnUnknownTask

Referencing a task ID that was never created.

Source: contracts/src/, tests: contracts/test/ProofOrchestrator.t.sol. Run them: cd contracts && forge test. Checked in CI: the CI page.