Reference
QuarnOracle
Ratings other contracts can read onchain.
Gate a contract
QuarnOracle records each rating on Elysium with a hash of the inputs behind it. It holds no funds and cannot be upgraded. Any contract can gate on isHealthy(token, minScore, maxAge):
interface IQuarnOracle {
function isHealthy(address token, uint8 minScore, uint64 maxAge)
external view returns (bool);
}
// refuse to touch dying tokens
require(
IQuarnOracle(ORACLE).isHealthy(token, 55, 1 hours),
"quarn: not healthy"
);Write and check ratings
quarn_attest_token writes the current rating; identical inputs already onchain send no transaction. quarn_scan_token returns an onchain field that tells you whether the recorded rating matches the scan you just got.
Verify a rating
- Scan
quarn_scan_token returns the score and the exact inputs it used.
- Hash
keccak256 of the canonical inputs: same data, same hash.
- Read onchain
ratingOf(token) on QuarnOracle returns score, label and inputsHash.
- Match
Equal hashes mean the onchain rating is this exact rating.
Contract address
QuarnOracle is written and tested; it is not deployed yet. The address will be announced only on quarn.xyz and the official X account. Any address you see elsewhere is not ours.