math

the whole thing, written out

There is one operation and one comparison. The operation is a modulo. The comparison sorts the result into a band. Everything on this site is one of those two things applied to a number the chain already published, so the entire specification fits on this page with room left over.

The function is pure. It reads state, it writes nothing, it costs nothing to call, and it returns the same answer to every caller in the same block. It has no access control because there is nothing to control: calling it cannot change what it will return next time.

The constant and the modulus appear in the code as immutable values set in the constructor. Immutable values are written into the contract's bytecode at deployment rather than into storage, which means there is no slot holding them and no path, including a storage write from a delegate call, that could alter one later.

The function is pure in the strict sense: it reads, it returns, and it writes nothing. It has no access control because there is nothing to control, no reentrancy surface because it makes no external calls, and no gas cost to the caller because it is never sent as a transaction. Two people calling it in the same block cannot get different answers, and calling it a thousand times leaves the contract in the state it started in.

What is absent matters as much as what is present. There is no owner, no pause, no admin role, no proxy, no initialiser, no emergency withdrawal, and no event whose absence would hide anything, because every value the site displays can be derived by anyone from public state without trusting a log.

The code below is the whole program. It is reproduced here so that this page and the deployed bytecode can be checked against each other rather than trusted.

uint256 immutable K;      // the constant, set once
uint256 immutable M;      // the modulus, set once

function residue(uint256 q) public view returns (uint256) {
    return (q + K) % M;
}

function class(uint256 r) public view returns (Class) {
    if (r == 0)         return Class.ZERO;
    if (r == 1)         return Class.UNIT;
    if (r == M - 1)     return Class.EDGE;
    if (r <  M / 3)     return Class.LOW;
    if (r <  2 * M / 3) return Class.MIDDLE;
    return Class.HIGH;
}
zerounitlowmiddlehighedge0modulus
symbolis
Kthe constant, written at genesis, immutable
Mthe modulus, written at genesis, immutable
qa quantity published by the chain this block
rthe residue, always less than M
classthe band r falls in, derived, never stored