Contract
0x85ebf3c638e94084ba2876ea24c576cfbe51ac38
- Address
- 0x85ebf3c638e94084ba2876ea24c576cfbe51ac38
- Kind
- verified contract FinalIntentLog
- Balance
- 0 vETH
- Nonce
- 1
- Code
- 12,995 bytes codehash 0xd37a808c6f547a51f20dc5c533cc0e36523a9af1aca69a4213c02a63937dfd2b
account tree
- Tree
- 1 · accounts
- Present
- no leaf
- Key
- 0xc040b8f69a69d3514d4f7873954c4ebffa6c7a6e0193ea2366717020d102b214
- Live root
- 0x18f30182962d8af79e7ab628ce200be69d28f54119890d737c7e736de62e703c
This address holds no leaf in the account tree. Every Final Wallet — service identities included — has one, so an absent leaf means an ordinary account rather than a wallet.
source verified
- Contract
- FinalIntentLog exact match · immutables masked
- Compiler
- v0.8.33+commit.64118f21
- Optimizer
- enabled · 200 runs
- EVM version
- prague
- Verified
- 2026-09-06T09:34:54.217Z
- Provenance
- preverify-final-chain (forge artifact, bytecode compared against live code)
contracts/finalchain/FinalCertificate.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
// Licensed under the Business Source License 1.1 (the "License")
//
// Change Date: 2029-01-01
// Change License: GPL-2.0-or-later
//
// @author Final DeFi
// @version 1.0.0
pragma solidity ^0.8.20;
import {FinalChainPrecompiles} from "./FinalChainPrecompiles.sol";
import {FinalChainTime} from "./FinalChainTime.sol";
/**
* @title FinalCertificate
* @notice Reads a Final Certificate (`.fcert`, schema v3) on chain.
*
* @dev Final Chain only — it needs the SHA3-256 precompile, because the schema
* hashes with FIPS-202 SHA3 and the EVM has `keccak256`, which is a different
* function.
*
* ## Why the chain parses this at all
*
* `FinalIdentityRegistry.registerWithCertificate` used to take the TBS bytes
* AND the public keys as separate arguments. It derived `certHash` from the
* bytes, which sounds like verification and is not: nothing compared the keys
* to the certificate, so a registrar could bind any certificate to any keypair.
* The registry would then hold a key the certificate does not contain, and every
* signature that key produced would verify against a certificate that never
* authorised it.
*
* So the keys are read OUT of the certificate. There is one input and no way for
* two arguments to disagree.
*
* ## The SubjectKeyId check
*
* The schema defines `SubjectKeyId` as SHA3-256 of the `PublicKeyBlock`. Having
* parsed the block, this recomputes that digest and compares. The field is
* inside the TBS, so it is covered by the CA's signatures — which makes the
* check a statement about what the CA attested, not merely about internal
* consistency of bytes the caller supplied.
*
* ## What this does NOT do
*
* It does not verify the CA's signatures over the TBS, and it does not walk the
* chain to the root. Both are possible here — the precompiles verify ML-DSA-87
* and SLH-DSA-SHAKE-256s — and both are deliberately out of scope for the
* registry's bootstrap path, where the registrar is the party that issued the
* certificate in the first place. `verifyIssuerSignatures` below is provided for
* callers that need it, and the identity registry uses it once a CA is itself
* registered.
*/
library FinalCertificate {
/// `"PQCF"`.
uint32 internal constant MAGIC = 0x50514346;
/// The current wire generation — v5's `Version = 2` (chain-attested
/// issuance; ruled 2026-09-01). The v4 wire (`Version = 1`) stays
/// PARSEABLE so pre-cutover artifacts still read; encoders write 2.
/// fails to parse rather than being reinterpreted: `pqKeysHash` and every
/// wallet address derive from this exact layout.
uint32 internal constant VERSION = 2;
/// The v4 generation, accepted on parse for pre-cutover artifacts.
uint32 internal constant VERSION_V4 = 1;
/// @notice The 0x0102 Institution identity extension (issuer profile).
uint16 internal constant EXT_INSTITUTION = 0x0102;
/// Algorithm ids ARE the FIPS numbers, in one space for signatures and KEMs
/// — the same ids the quorum wire format and the backend registry use, and
/// the numbers the precompile addresses end in.
/// ML-KEM-1024 (FIPS 203), the lattice half of the encapsulation pair.
uint16 internal constant ALG_ML_KEM_1024 = 0x0003;
/// ML-DSA-87 (FIPS 204). Transaction class.
uint16 internal constant ALG_ML_DSA_87 = 0x0004;
/// SLH-DSA-SHAKE-256s (FIPS 205). Access class, and the seal.
uint16 internal constant ALG_SLH_DSA_SHAKE_256S = 0x0005;
/// FN-DSA (FIPS 206). Reserved: no implementation, never accepted.
uint16 internal constant ALG_FN_DSA = 0x0006;
/// HQC-5 (FIPS 207), the code-based half of the encapsulation pair.
uint16 internal constant ALG_HQC_5 = 0x0007;
/// Certificate signing. Says which key to verify WITH; it grants nothing —
/// that comes from `Depth` and `MaxDelegationDepth`.
uint16 internal constant PURPOSE_CERT_SIGNING = 0x0004;
/// The wallet's four slots, in two stages of two.
///
/// A certificate carries ONE stage, never all four. The stage is what gets
/// issued, rotated and revoked as a unit, and a holder presenting a live
/// certificate presents both of that stage's keys or neither — splitting
/// them per slot would let half a stage be presented as if it were whole.
///
/// This applies to services exactly as it applies to a user's wallet.
/// A co-signer is a Final Wallet: same four slots, same split, same
/// algorithms. There is no second kind of identity in this system.
uint16 internal constant PURPOSE_ACTIVE_TX = 0x0010;
uint16 internal constant PURPOSE_ACTIVE_ACCESS = 0x0011;
uint16 internal constant PURPOSE_RECOVERY_TX = 0x0012;
uint16 internal constant PURPOSE_RECOVERY_ACCESS = 0x0013;
/// @dev v4's encapsulation purposes. Parsed, and each stage's pair is
/// resolved alongside its signing pair — `FinalIdentityRegistry` then
/// stores them so a sender can encapsulate to a registered party
/// without a second lookup somewhere less authoritative.
///
/// They were declared and skipped for one release, which is how the
/// registry's four encapsulation-key mappings ended up read in three
/// places and written in none: `kemCommitments` hashed the empty
/// string for every account and `kemKeysOf` returned nothing.
uint16 internal constant PURPOSE_ACTIVE_KEM = 0x0014;
uint16 internal constant PURPOSE_RECOVERY_KEM = 0x0015;
/// @dev The seal: a second SLH-DSA-SHAKE-256s key, distinct from the access
/// key, that co-signs execution-class quorum decisions. Carried by
/// SERVICE certificates only — a user's wallet never seals — and
/// optional in the schema, so a certificate without it parses
/// unchanged. Outside `keysHash`: a seal is operational, rotated by
/// issuing a new live certificate, and it must not move a wallet
/// address it plays no part in.
uint16 internal constant PURPOSE_ACTIVE_SEAL = 0x0016;
/// @dev A purpose no certificate can carry, so `parse` can be told "this
/// stage has no encapsulation slot" without a second boolean. `0xffff`
/// is outside the registry and reserved by being used here.
uint16 internal constant NO_KEM_PURPOSE = 0xffff;
/// Nanoseconds per second. The schema's validity fields are nanoseconds and
/// `block.timestamp` is seconds; a comparison across the two units is a bug
/// waiting for the first certificate anybody actually checks.
/// @dev The schema stamps validity in NANOseconds and this chain's clock is
/// MILLIseconds, so a certificate converts down by 1e6 rather than by
/// 1e9. It was 1e9 — seconds — which made every `notBefore` look 1000x
/// too small against `block.timestamp` and every certificate
/// permanently "already valid", including one issued for the future.
uint64 internal constant NS_PER_MILLISECOND = FinalChainTime.NS_PER_MILLISECOND;
/// @notice What the chain keeps out of one certificate.
struct Parsed {
bytes32 certHash;
bytes32 serial;
/// keccak256 of the IssuerDN bytes, for the chain-issuer pin: a
/// chain-attested certificate carries the ruled constant DN and the
/// registry compares hashes rather than strings.
bytes32 issuerDnHash;
/// The SubjectDN bytes verbatim — the jurisdiction rule reads its
/// `C=` component at issuer registration.
bytes subjectDn;
/// The 0x0102 Institution extension VALUE, when present; empty
/// otherwise. Issuer registration parses jurisdiction out of it.
bytes institutionExt;
/// SHA3-256 of the ISSUER's public key block. Zero-length — and so
/// `bytes32(0)` here — for exactly one certificate in the hierarchy,
/// which is what terminates chain validation.
bytes32 authorityKeyId;
/// SHA3-256 of this certificate's own public key block. The child's
/// `authorityKeyId` must equal it, which is what links the two.
bytes32 subjectKeyId;
uint8 depth;
uint8 maxDelegationDepth;
/// MILLISECONDS, converted from the schema's nanoseconds — this chain's clock.
uint64 notBefore;
/// Milliseconds. Zero means never expires, which the schema allows.
uint64 notAfter;
/// The stage's transaction-class key. ML-DSA-87 — spending, and every
/// high-cadence protocol action.
bytes transactionKey;
/// The stage's access-class key. SLH-DSA-SHAKE-256s — identity,
/// rotation, recovery-pair promotion. A different hardness assumption,
/// so a lattice break leaves the key that governs identity standing.
bytes accessKey;
/// The stage's ML-KEM-1024 encapsulation key. Empty on a CA, which has
/// no encapsulation stage, and on any v4 certificate issued without
/// one — see `parse` for why that is tolerated rather than refused.
bytes kemMlKem;
/// The stage's HQC-5 encapsulation key. Carried under the SAME purpose
/// as the lattice half and distinguished only by algorithm, which is
/// why the parser matches on the `(purpose, algorithm)` pair.
bytes kemHqc;
/// The service's seal key (`PURPOSE_ACTIVE_SEAL`, SLH-DSA-SHAKE-256s).
/// Empty on every certificate that does not carry one — a user wallet,
/// a recovery stage, a CA.
bytes sealKey;
/// Where the TBS ends, so a caller holding the whole certificate can
/// find the `SignatureBlock` without parsing forward again.
uint256 tbsLength;
}
error BadMagic(uint32 got);
error BadVersion(uint32 got);
error Truncated(uint256 needed, uint256 got);
error SubjectKeyIdMismatch(bytes32 derived, bytes32 declared);
error MissingSlot(uint16 purpose);
error WrongAlgorithmForSlot(uint16 purpose, uint16 algorithm);
error DuplicateKey(uint16 purpose, uint16 algorithm);
error KeysNotSorted();
error BadKeyLength(uint16 algorithm, uint256 length);
error InvalidDepth(uint8 depth, uint8 maxDelegationDepth);
error ValidityInverted(uint64 notBefore, uint64 notAfter);
/**
* @notice Parse and self-check a `TBSCertificate`.
* @param tbs the TBS bytes, verbatim. Not the whole certificate.
* @param txPurpose the transaction-class purpose this stage should carry.
* @param accessPurpose the access-class purpose for the same stage.
*
* @dev Checking for a CAPABILITY rather than a type is the schema's own
* rule, and the reason there is no type field to check instead. Passing the
* LIVE purposes to a recovery certificate finds neither key and reverts —
* which is what stops a recovery certificate being registered as a live one
* and handing the recovery pair everyday authority.
*/
function parse(bytes calldata tbs, uint16 txPurpose, uint16 accessPurpose, uint16 kemPurpose)
internal
view
returns (Parsed memory out)
{
_need(tbs, 58);
if (uint32(bytes4(tbs[0:4])) != MAGIC) revert BadMagic(uint32(bytes4(tbs[0:4])));
// Both live generations. v4 artifacts predate chain-attested issuance
// and still parse — supersession is handled at admission (PoP and the
// chain-issuer pins), not by refusing to read history.
uint32 wireVersion = uint32(bytes4(tbs[4:8]));
if (wireVersion != VERSION && wireVersion != VERSION_V4) revert BadVersion(wireVersion);
out.certHash = FinalChainPrecompiles.sha3_256(tbs);
out.serial = bytes32(tbs[8:40]);
out.depth = uint8(tbs[40]);
out.maxDelegationDepth = uint8(tbs[41]);
uint64 notBeforeNs = uint64(bytes8(tbs[42:50]));
uint64 notAfterNs = uint64(bytes8(tbs[50:58]));
if (out.maxDelegationDepth < out.depth) {
revert InvalidDepth(out.depth, out.maxDelegationDepth);
}
if (notAfterNs != 0 && notAfterNs <= notBeforeNs) {
revert ValidityInverted(notBeforeNs, notAfterNs);
}
out.notBefore = notBeforeNs / NS_PER_MILLISECOND;
out.notAfter = notAfterNs == 0 ? 0 : notAfterNs / NS_PER_MILLISECOND;
// Four length-prefixed fields: IssuerDN, SubjectDN, AuthorityKeyId,
// SubjectKeyId. Every field before them is fixed width, which is the
// whole reason the schema orders them this way.
uint256 p = 58;
uint256 issuerDnLen;
(p, issuerDnLen) = _skipLengthPrefixed(tbs, p);
out.issuerDnHash = keccak256(tbs[p - issuerDnLen:p]);
uint256 subjectDnLen;
(p, subjectDnLen) = _skipLengthPrefixed(tbs, p);
out.subjectDn = tbs[p - subjectDnLen:p];
uint256 akidLen;
(p, akidLen) = _skipLengthPrefixed(tbs, p);
out.authorityKeyId = _bytes32At(tbs, p - akidLen, akidLen);
uint256 skidLen;
(p, skidLen) = _skipLengthPrefixed(tbs, p);
uint256 skidStart = p - skidLen;
_need(tbs, p + 2);
uint16 keyCount = uint16(bytes2(tbs[p:p + 2]));
p += 2;
// AFTER the count word. `SubjectKeyId` is SHA3-256 of the KeyEntry
// array alone — `encodeTbs` writes `PublicKeyCount` as its own field and
// `encodePublicKeyBlock` returns only the entries. Hashing the count in
// produces a digest that is self-consistent and matches no certificate
// any issuer ever wrote.
uint256 blockStart = p;
uint32 previousSort = 0;
for (uint256 i = 0; i < keyCount; i++) {
_need(tbs, p + 8);
uint16 alg = uint16(bytes2(tbs[p:p + 2]));
uint16 purpose = uint16(bytes2(tbs[p + 2:p + 4]));
uint32 keyLen = uint32(bytes4(tbs[p + 4:p + 8]));
p += 8;
_need(tbs, p + keyLen);
// Ascending by (purpose, algorithm), duplicates invalid. The schema
// requires the order so `certHash` is reproducible across
// implementations; enforcing it here also means a second entry for
// one slot cannot quietly shadow the first.
uint32 sortKey = (uint32(purpose) << 16) | uint32(alg);
if (i > 0) {
if (sortKey == previousSort) revert DuplicateKey(purpose, alg);
if (sortKey < previousSort) revert KeysNotSorted();
}
previousSort = sortKey;
// The algorithm is pinned per CLASS, not merely recorded. A
// transaction slot carrying an access-class key would verify
// cryptographically and mean something entirely different — an
// identity key must never authorize a transaction, or splitting the
// classes buys nothing.
// Matched on the PAIR, not on the purpose alone. A CA carries two
// keys under one purpose (`0x0004`) distinguished only by
// algorithm, so matching on purpose first would find the first of
// them twice and the second never.
if (purpose == txPurpose && alg == ALG_ML_DSA_87) {
if (keyLen != FinalChainPrecompiles.ML_DSA_87_PUBLIC_KEY_LEN) {
revert BadKeyLength(alg, keyLen);
}
out.transactionKey = tbs[p:p + keyLen];
} else if (purpose == accessPurpose && alg == ALG_SLH_DSA_SHAKE_256S) {
if (keyLen != FinalChainPrecompiles.SLH_DSA_SHAKE_256S_PUBLIC_KEY_LEN) {
revert BadKeyLength(alg, keyLen);
}
out.accessKey = tbs[p:p + keyLen];
} else if (purpose == kemPurpose && alg == ALG_ML_KEM_1024) {
out.kemMlKem = tbs[p:p + keyLen];
} else if (purpose == kemPurpose && alg == ALG_HQC_5) {
out.kemHqc = tbs[p:p + keyLen];
} else if (purpose == PURPOSE_ACTIVE_SEAL && alg == ALG_SLH_DSA_SHAKE_256S) {
if (keyLen != FinalChainPrecompiles.SLH_DSA_SHAKE_256S_PUBLIC_KEY_LEN) {
revert BadKeyLength(alg, keyLen);
}
out.sealKey = tbs[p:p + keyLen];
} else if (purpose == PURPOSE_ACTIVE_SEAL) {
// The seal is hash-based by definition — it exists to stand on
// the OTHER assumption from the transaction key it co-signs
// with. A lattice seal would be two signatures on one bet.
revert WrongAlgorithmForSlot(purpose, alg);
} else if (purpose == txPurpose || purpose == accessPurpose) {
// A slot the caller asked for, carrying the wrong scheme. It
// would verify cryptographically and mean something else
// entirely — an identity key must never authorize a
// transaction, or splitting the classes buys nothing.
revert WrongAlgorithmForSlot(purpose, alg);
} else if (purpose == kemPurpose) {
// Same rule for the encapsulation slot. A third KEM appearing
// under this purpose is a hybrid whose second family nobody
// agreed on, and admitting it silently is how a pair becomes a
// trio that one reader honours and another ignores.
revert WrongAlgorithmForSlot(purpose, alg);
}
// NO length check on the KEM keys here, and that is deliberate.
// The signing slots are checked against a constant because the
// parser's own callers depend on the length; an encapsulation key
// is checked by `0x0203` / `0x0207` at the moment it is REGISTERED,
// where the answer is a well-formedness verdict rather than a
// parse failure. Two checks of the same thing in two shapes is how
// one of them ends up weaker and nobody notices which.
p += keyLen;
}
// `SubjectKeyId` is SHA3-256 of the KeyEntry array, count word
// EXCLUDED — `blockStart` is taken after the count is consumed, for the
// reason given where it is set. Recomputing it is what turns "these
// bytes decode" into "the CA signed these exact keys"; the field is
// inside the TBS, so it is covered by the signatures.
out.subjectKeyId = FinalChainPrecompiles.sha3_256(tbs[blockStart:p]);
bytes32 declared = _bytes32At(tbs, skidStart, skidLen);
if (out.subjectKeyId != declared) revert SubjectKeyIdMismatch(out.subjectKeyId, declared);
// Both or neither. A stage is issued as a unit, so a certificate
// carrying one of its two keys is not a partial certificate — it is a
// certificate for a stage that does not exist.
if (out.transactionKey.length == 0) revert MissingSlot(txPurpose);
if (out.accessKey.length == 0) revert MissingSlot(accessPurpose);
// The encapsulation pair is both-or-neither for the same reason, and
// the reason is louder here: a hybrid quietly reduced to one family is
// identical on the wire, so a certificate carrying only the lattice
// half would seal successfully and silently drop the code-based hedge.
// Neither is the CA case and the pre-v4 case, both legitimate.
if ((out.kemMlKem.length == 0) != (out.kemHqc.length == 0)) {
revert MissingSlot(kemPurpose);
}
_need(tbs, p + 2);
uint16 extCount = uint16(bytes2(tbs[p:p + 2]));
p += 2;
for (uint256 i = 0; i < extCount; i++) {
_need(tbs, p + 7);
uint16 extType = uint16(bytes2(tbs[p:p + 2]));
uint32 valueLen = uint32(bytes4(tbs[p + 3:p + 7]));
p += 7;
_need(tbs, p + valueLen);
// The Institution extension's VALUE, kept for the issuer
// profile's jurisdiction rule. Everything else is skipped as
// before — extensions are structural to certHash, semantic to
// whichever consumer knows them.
if (extType == EXT_INSTITUTION) out.institutionExt = tbs[p:p + valueLen];
p += valueLen;
}
out.tbsLength = p;
}
/// @notice Parse a LIVE-stage certificate: `activeTransaction` + `activeAccess`.
/// @dev `external`, like the other three entry points below: the registry
/// sits against the EIP-170 ceiling and the TBS parser is its single
/// largest inlined dependency, so the four doors it actually calls are
/// DEPLOY-LINKED — the library is one more contract in the plane's fixed
/// nonce-0 deploy order (doctrine §2 of `arch/final-chain-regenesis.md`),
/// its address baked immutably into the registry's bytecode. A linked
/// library is code, not a key: nothing can repoint it after deployment.
function parseLive(bytes calldata tbs) external view returns (Parsed memory) {
return parse(tbs, PURPOSE_ACTIVE_TX, PURPOSE_ACTIVE_ACCESS, PURPOSE_ACTIVE_KEM);
}
/// @notice Parse a RECOVERY-stage certificate.
/// @dev The recovery pair authorizes rotating the wallet's own credentials
/// and NOTHING else — acting as a guardian, an ordinary action for that
/// account, uses the live access key. Keeping the two stages in separate
/// certificates is what makes that boundary something a verifier can see.
function parseRecovery(bytes calldata tbs) external view returns (Parsed memory) {
return parse(tbs, PURPOSE_RECOVERY_TX, PURPOSE_RECOVERY_ACCESS, PURPOSE_RECOVERY_KEM);
}
/// @notice Parse a CA certificate, whose two keys are both cert-signing.
/// @dev No encapsulation purpose: a CA signs and is never sealed to, so
/// `PURPOSE_ACTIVE_KEM` is passed as a value the loop can never match. A
/// CA certificate carrying encapsulation keys would parse them into slots
/// `_write` then discards, which is a shape worth refusing to have.
function parseCa(bytes calldata tbs) external view returns (Parsed memory) {
return parse(tbs, PURPOSE_CERT_SIGNING, PURPOSE_CERT_SIGNING, NO_KEM_PURPOSE);
}
/**
* @notice Verify a CA's dual signature over `tbs`.
* @dev Both must verify, not either. Two signatures under two different
* hardness assumptions is the entire reason the schema carries two, and
* accepting one would collapse that to whichever family breaks first.
*/
function verifyIssuerSignatures(
bytes memory tbs,
bytes memory issuerMlDsaKey,
bytes memory issuerSlhDsaKey,
bytes memory mlDsaSignature,
bytes memory slhDsaSignature
) external view returns (bool) {
return FinalChainPrecompiles.verifyMlDsa87(issuerMlDsaKey, tbs, mlDsaSignature)
&& FinalChainPrecompiles.verifySlhDsa(issuerSlhDsaKey, tbs, slhDsaSignature);
}
function _need(bytes calldata tbs, uint256 upto) private pure {
if (tbs.length < upto) revert Truncated(upto, tbs.length);
}
function _skipLengthPrefixed(bytes calldata tbs, uint256 p)
private
pure
returns (uint256 next, uint256 length)
{
_need(tbs, p + 4);
length = uint32(bytes4(tbs[p:p + 4]));
next = p + 4 + length;
_need(tbs, next);
}
function _bytes32At(bytes calldata tbs, uint256 start, uint256 length)
private
pure
returns (bytes32)
{
// A SubjectKeyId that is not 32 bytes is not a SHA3-256 digest, so it
// cannot match and the comparison will fail — which is the correct
// outcome and needs no separate error.
if (length != 32) return bytes32(0);
return bytes32(tbs[start:start + 32]);
}
}
contracts/finalchain/FinalChainPrecompiles.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
// Licensed under the Business Source License 1.1 (the "License")
//
// Change Date: 2029-01-01
// Change License: GPL-2.0-or-later
//
// @author Final DeFi
// @version 1.0.0
pragma solidity ^0.8.20;
/**
* @title FinalChainPrecompiles
* @notice The three primitives Final Chain adds to the EVM, and the only
* supported way to reach them.
*
* @dev **These exist ONLY on Final Chain (chain id 48359).** They are provided
* by `final-reth`, the node binary in `FinalBackend/vendor/reth/final/`, and
* nothing at these addresses on Ethereum, Optimism or any other chain will
* answer. A contract that calls them must be one that only ever runs here;
* `assertAvailable` below is the cheap way to fail loudly rather than treat an
* empty return as a verified signature.
*
* The addresses are the FIPS numbers, which is the whole allocation rule —
* there is no local registry to consult and no way for two implementations to
* disagree about where a primitive lives:
*
* | address | primitive | FIPS |
* |---|---|---|
* | `0x…0202` | SHA3-256 | 202 |
* | `0x…0203` | ML-KEM-1024 key validation | 203 |
* | `0x…0204` | ML-DSA-87 verify | 204 |
* | `0x…0205` | SLH-DSA-SHAKE-256s verify | 205 |
* | `0x…0207` | HQC-5 key validation | 207 |
*
* The two KEM addresses VALIDATE keys and do nothing else, for one reason:
* encapsulation is a SENDER operation and decapsulation needs the secret key,
* so neither belongs on a chain at all. Checking that a registered public key
* is well-formed is hardening rather than a dependency, and nothing in this
* system waits on it.
*
* HQC's number is 207. It had none when the KEM pair was chosen, which was the
* one thing separating it from ML-KEM here — a primitive with no standard
* number has no address under this rule, and inventing one would have been a
* local convention masquerading as the global one.
*
* **No AEAD precompile, at any number.** The chain must never be able to
* decrypt an intent, and checking a revealed body against its commitment is a
* hash compare that `0x0202` already serves.
*
* ## Why this library refuses to take a public key from its caller
*
* It does take one — the primitives are pure functions and cannot do otherwise.
* The rule lives one level up, in `FinalPqQuorum`: a key passed as an argument
* proves nothing, because anyone holding a keypair can produce a valid
* signature under it. Only a key read from `FinalIdentityRegistry` is evidence
* about WHO signed. Every call site here must be able to answer "where did this
* key come from" with "storage", never "calldata".
*
* ## `success` is not the answer
*
* A `staticcall` to a verifier returns two things and both matter. `success`
* false means the call was malformed — usually a length bug in the caller — and
* `success` true with a zero word means the signature did not verify. The
* helpers below collapse both to `false` for the caller's convenience, which is
* safe in that direction and only in that direction: treating a failed call as
* a valid signature would be the whole security of the system.
*/
library FinalChainPrecompiles {
/// @notice SHA3-256 (FIPS 202). NOT `keccak256`, which is the
/// pre-standardisation padding and produces a different digest.
address internal constant SHA3_256 = address(0x0202);
/// @notice ML-DSA-87 verification (FIPS 204). Transaction-class keys.
address internal constant ML_DSA_87 = address(0x0204);
/// @notice SLH-DSA-SHAKE-256s verification (FIPS 205). Access-class keys.
address internal constant SLH_DSA_SHAKE_256S = address(0x0205);
/// @notice ML-KEM-1024 encapsulation-key validation (FIPS 203).
/// @dev VALIDATES; it does not encapsulate. Runs FIPS 203 §7.2's own
/// encapsulation-key check — the type check and the modulus check — and
/// nothing else. Encapsulation is a sender operation and decapsulation
/// needs the secret key, so neither belongs on a chain.
address internal constant ML_KEM_1024 = address(0x0203);
/// @notice HQC-5 public-key validation (FIPS 207).
/// @dev Structural only: the length, and the three padding bits the
/// encoding leaves beyond `n = 57637`. HQC has no cheap key-validity
/// predicate and this does not pretend to one.
address internal constant HQC_5 = address(0x0207);
/// @notice ML-DSA-87 public key length. Round-3 Dilithium5 shares it.
uint256 internal constant ML_DSA_87_PUBLIC_KEY_LEN = 2592;
/// @notice ML-DSA-87 signature length. Round-3 Dilithium5 is 4595.
uint256 internal constant ML_DSA_87_SIGNATURE_LEN = 4627;
/// @notice SLH-DSA-SHAKE-256s public key length (`PK.seed ‖ PK.root`).
uint256 internal constant SLH_DSA_SHAKE_256S_PUBLIC_KEY_LEN = 64;
/// @notice SLH-DSA-SHAKE-256s signature length. The `f` set is 49,856.
uint256 internal constant SLH_DSA_SHAKE_256S_SIGNATURE_LEN = 29792;
/// @notice Thrown when a precompile is absent, i.e. this is not Final Chain
/// or the node is stock reth rather than `final-reth`.
error PrecompileUnavailable(address precompile);
/**
* @notice Reverts unless all five precompiles answer.
* @dev Call this from a constructor. A contract whose security rests on PQ
* verification must not deploy onto a chain that cannot perform it — the
* failure mode otherwise is a quorum that reaches threshold with zero valid
* signatures, discovered at the worst possible moment.
*
* The probe is SHA3-256 of the empty string, whose value is a published
* FIPS 202 constant. It cannot be produced by an address with no code
* (which returns empty) nor by `keccak256` (which gives a different digest
* for the same input), so it distinguishes "the right precompile" from both
* "nothing here" and "the wrong hash function".
*/
function assertAvailable() internal view {
bytes32 expected = 0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a;
(bool ok, bytes memory out) = SHA3_256.staticcall("");
if (!ok || out.length != 32 || bytes32(out) != expected) {
revert PrecompileUnavailable(SHA3_256);
}
// The two signature verifiers are probed by shape rather than by a
// known-answer vector: a KAT here would put a 29,792-byte signature in
// this contract's bytecode. A deliberately short input is a
// *precompile error* by contract, so a FAILED call is the pass and a
// silent success would mean something else is answering at the address.
_probeRejectsShortInput(ML_DSA_87);
_probeRejectsShortInput(SLH_DSA_SHAKE_256S);
// The two KEM validators are probed the other way round, because they
// are total by contract: a wrong length is a malformed KEY, which is
// the question being asked, so they ANSWER rather than error. A
// one-byte input must therefore come back as a well-formed `false`, and
// a failed call means nothing is there.
_probeAnswersFalse(ML_KEM_1024);
_probeAnswersFalse(HQC_5);
}
/**
* @dev A short input must make the precompile ERROR. The gas budget is the
* whole subtlety.
*
* A reverting CONTRACT refunds the gas it did not use. A precompile that
* returns an error consumes **everything forwarded to it** — and Solidity
* forwards 63/64 of what is left by default. Two such probes in a
* constructor therefore burn all but 1/4096 of the deployment's gas, and
* the deploy fails with no revert data at all.
*
* That is not hypothetical: it is what happened the first time this ran
* against a real `final-reth`, and no Foundry test could have caught it.
* A mocked precompile is a contract, and a contract's `require` hands the
* gas back.
*
* 5,000 is generous for a call that fails on a length check before any
* cryptography runs, and small enough that both probes together are noise
* against a deployment.
*/
function _probeRejectsShortInput(address precompile) private view {
bool ok;
assembly ("memory-safe") {
let ptr := mload(0x40)
mstore8(ptr, 0x00)
ok := staticcall(5000, precompile, ptr, 0x01, 0x00, 0x00)
}
if (ok) revert PrecompileUnavailable(precompile);
}
/**
* @dev A one-byte input must come back as a well-formed zero word.
*
* The inverse of `_probeRejectsShortInput`, and the inversion is the point:
* these two precompiles are TOTAL. Every byte string has an answer to "is
* this a well-formed key", and for one byte the answer is no. A precompile
* that errored here would be one that treats a malformed key as a caller
* bug, which is the opposite of what a registry wants.
*
* Gas is bounded for the same reason as the other probe — an erroring
* precompile consumes everything forwarded — even though the pass case
* returns normally and refunds.
*/
function _probeAnswersFalse(address precompile) private view {
bool ok;
bytes32 answer;
assembly ("memory-safe") {
let ptr := mload(0x40)
mstore8(ptr, 0x00)
ok := staticcall(5000, precompile, ptr, 0x01, ptr, 0x20)
answer := mload(ptr)
}
if (!ok || answer != bytes32(0)) revert PrecompileUnavailable(precompile);
}
/**
* @notice Is `encapsulationKey` a well-formed ML-KEM-1024 key?
*
* @dev The check a registry owes a sender. A malformed encapsulation key
* stored on chain is an account whose intents cannot be sealed, and the
* discovery happens at the first attempt to seal one — on the hybrid path,
* as a pair silently reduced to one family, which is the failure with no
* error attached.
*
* False rather than reverting on any shape, including the wrong length,
* because the caller is asking a question and every input has an answer.
*/
function isWellFormedMlKem1024(bytes memory encapsulationKey) internal view returns (bool) {
return _validatesKey(ML_KEM_1024, encapsulationKey);
}
/// @notice Is `publicKey` a well-formed HQC-5 key?
/// @dev Structural, and honestly partial — see the precompile. It catches a
/// truncated key, a key from the wrong parameter set, and a tail carrying
/// smuggled bytes, which are the three ways this goes wrong in practice.
function isWellFormedHqc5(bytes memory publicKey) internal view returns (bool) {
return _validatesKey(HQC_5, publicKey);
}
/// @dev A failed CALL is not a false answer. It means nothing is at the
/// address — this is not Final Chain, or the node is stock reth — and
/// reading it as "the key is malformed" would silently disable the check on
/// exactly the deployment where it cannot run.
function _validatesKey(address precompile, bytes memory key) private view returns (bool) {
(bool ok, bytes memory out) = precompile.staticcall(key);
if (!ok || out.length != 32) revert PrecompileUnavailable(precompile);
return bytes32(out) != bytes32(0);
}
/// @notice FIPS 202 SHA3-256 over `data`.
/// @dev The certificate schema hashes `TBSCertificate`, `SubjectKeyId` and
/// `AuthorityKeyId` with this, so it is the only function that can check a
/// `certHash` against the bytes it claims to summarise.
function sha3_256(bytes memory data) internal view returns (bytes32 digest) {
(bool ok, bytes memory out) = SHA3_256.staticcall(data);
if (!ok || out.length != 32) revert PrecompileUnavailable(SHA3_256);
digest = bytes32(out);
}
/// @notice Verify an ML-DSA-87 signature. False on any failure, including
/// a malformed call.
function verifyMlDsa87(bytes memory publicKey, bytes memory message, bytes memory signature)
internal
view
returns (bool)
{
if (
publicKey.length != ML_DSA_87_PUBLIC_KEY_LEN
|| signature.length != ML_DSA_87_SIGNATURE_LEN
) return false;
return _verify(ML_DSA_87, publicKey, signature, message);
}
/// @notice Verify an SLH-DSA-SHAKE-256s signature. False on any failure.
function verifySlhDsa(bytes memory publicKey, bytes memory message, bytes memory signature)
internal
view
returns (bool)
{
if (
publicKey.length != SLH_DSA_SHAKE_256S_PUBLIC_KEY_LEN
|| signature.length != SLH_DSA_SHAKE_256S_SIGNATURE_LEN
) return false;
return _verify(SLH_DSA_SHAKE_256S, publicKey, signature, message);
}
/// @dev `publicKey ‖ signature ‖ message`, in that order. Both fixed-length
/// fields come first so the message is unambiguously the remainder — the
/// same reason the precompile takes no length prefix.
function _verify(
address precompile,
bytes memory publicKey,
bytes memory signature,
bytes memory message
) private view returns (bool) {
(bool ok, bytes memory out) =
precompile.staticcall(abi.encodePacked(publicKey, signature, message));
return ok && out.length == 32 && bytes32(out) != bytes32(0);
}
}
contracts/finalchain/FinalChainTime.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
pragma solidity ^0.8.20;
/**
* @title FinalChainTime
* @notice **On Final Chain, `block.timestamp` is MILLISECONDS.**
*
* @dev Every other EVM chain stamps seconds. This one cannot: it mints a block
* every 100 ms and Ethereum requires block timestamps to strictly increase, so
* a second-denominated clock would run out of distinct values ten times over
* per second. Milliseconds is the deliberate choice, and it is a property of
* the CHAIN — `final-reth` — not of any contract here.
*
* Every duration on this chain is therefore in milliseconds, and this library
* exists so that is stated in one place instead of assumed in fifteen.
*
* ## How this was found, which is the reason for the naming rules below
*
* It was not found by the test suite. Foundry's `block.timestamp` is seconds,
* so all 1249 tests agreed with the contracts and every one of them was wrong
* about the chain they deploy to. It was found the first time anything
* exercised a deadline against the real chain — a posted intent, which reverted
* `DeadlinePassed` against a header whose deadline had been computed from wall
* time.
*
* What was actually broken was worse than a posting. `rotationInitiatedAt` is
* written from `block.timestamp` and compared against `rotationInitiatedAt +
* delaySeconds`: a millisecond clock plus a second-denominated delay. The
* 24-hour default recovery delay elapsed in **86 seconds**, and the two-year
* dormancy threshold in about seventeen hours. That delay is the thing standing
* between a stolen recovery key and an account.
*
* Nothing had noticed because nothing time-dependent had ever run: `walletCount`
* is 0, `FinalBundleLog.size` is 0, and no intent had been posted.
*
* ## The naming rule
*
* A field or constant carrying a duration or an instant on this chain ends in
* `Ms`. Not decoration — the bug was a field named `delaySeconds` that held
* milliseconds, and a name that lies is how the next reader reintroduces it.
* `SECONDS` names are gone from `contracts/finalchain/` and must not come back.
*
* Solidity's `hours` / `days` suffixes are still the clearest way to write a
* duration, so they are written as `24 hours * MS_PER_SECOND` rather than as a
* literal: the intent stays readable and the unit stays explicit.
*/
library FinalChainTime {
/// @notice Milliseconds per second. The whole conversion, named once.
uint64 internal constant MS_PER_SECOND = 1_000;
/// @notice Milliseconds per nanosecond divisor — the certificate schema
/// stamps validity in NANOseconds, so a certificate converts down to this
/// chain's clock rather than up.
uint64 internal constant NS_PER_MILLISECOND = 1_000_000;
/// @notice This chain's clock, stated as a function so a caller reads the
/// unit rather than remembering it.
/// @dev No arithmetic. It exists to make `FinalChainTime.nowMs()` the thing
/// people write, which is self-describing where `block.timestamp` is not.
function nowMs() internal view returns (uint64) {
return uint64(block.timestamp);
}
}
contracts/finalchain/FinalIdentityRegistry.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
// Licensed under the Business Source License 1.1 (the "License")
//
// Change Date: 2029-01-01
// Change License: GPL-2.0-or-later
//
// @author Final DeFi
// @version 1.0.0
pragma solidity ^0.8.20;
import {FinalCertificate} from "./FinalCertificate.sol";
import {FinalChainTime} from "./FinalChainTime.sol";
import {FinalChainPrecompiles} from "./FinalChainPrecompiles.sol";
import {FinalPqQuorum} from "./FinalPqQuorum.sol";
/**
* @title FinalIdentityRegistry
* @notice Who every party in the system IS, on chain, with its certificate.
*
* @dev Final Chain only. Every service, every co-signer, every certificate
* authority and every operator has one record here, and that record carries the
* party's actual public keys — not commitments to them.
*
* ## Why the full key and not a hash
*
* A commitment would be a quarter of the storage and would be enough to *check*
* a key someone hands you. It is not enough to VERIFY A SIGNATURE, because
* verification needs the key itself, and a key that arrives in calldata proves
* nothing: anyone holding a keypair can produce a valid signature under it. A
* quorum built on caller-supplied keys is a quorum of one — whoever built the
* calldata.
*
* So the keys live here in full, `FinalPqQuorum` reads them from storage, and
* "which key is co-signer 3" has exactly one answer. That question previously
* had three: an environment variable, an on-chain roster, and a Secret Manager
* entry, with nothing comparing them. Every configuration failure in this
* program has been those three disagreeing.
*
* ## The certificate is the record, not a pointer to one
*
* `certHash` is `SHA3-256(TBSCertificate)` — the certificate's own identity per
* the v3 schema, and the handle revocation is keyed on. The schema says
* revocation exists "on Final Chain only"; this is that place.
*
`registerWithCertificate` takes the TBS bytes and **reads everything out of
* them**: the digest, the serial, the key identifiers, the depth pair, the
* validity window and both public keys. It takes no key arguments at all.
*
* That is a correction, and the version it replaces is worth naming because it
* looked right. It took the TBS *and* the keys, derived `certHash` from the
* TBS, and never compared the two — so a registrar could bind any certificate
* to any keypair, and the registry would hold a key the certificate does not
* contain. Every signature that key produced would then verify against a
* certificate that never authorised it.
*
* ## The root is the first record on this chain, not a file somewhere
*
* The schema says Final Chain is the only root CA and that "the root is pinned,
* not distributed" — chain validation terminates at Final Chain **by identity**,
* never by finding a self-signed certificate in a local store.
*
* `registerRoot` is that pin, and it is the only entry point that accepts a
* certificate without checking an issuer's signature. It takes a depth-0,
* self-issued certificate from the bootstrap admin, once. Everything after it
* is `registerWithCertificate`, which **verifies the issuer's ML-DSA and
* SLH-DSA signatures on chain, through the precompiles**, against the issuer's
* own registered keys, and checks that the child's `AuthorityKeyId` is the
* issuer's `SubjectKeyId` and that the issuer's depth admits it.
*
* So there is no path by which a key enters this registry unattested. Not
* "a registrar should only register certified keys" — a registrar *cannot*
* register anything else.
*
* ## Roles are a bitmask
*
* One party is legitimately several things — a co-signer that is also a
* publisher, an operator that is also a guardian. A single enum would force
* either duplicate records for one key (two sources of truth about one party)
* or a role hierarchy nobody agrees on. A mask has neither problem, and a
* quorum asks "does this account carry ROLE_X" rather than "is this account an
* X", which is the same distinction the certificate schema draws when it says
* verifiers check for capabilities and never for types.
*
* ## Membership is hybrid-gated
*
* Who is in this registry, and with which roles, is the root of every quorum on
* the chain — so it is the one thing no single key may decide. Once bootstrap
* is sealed, every membership mutation (register, roles, revoke, an LMS key,
* the registrar threshold itself) and every state-plane configuration change
* that routes through {requireRegistrarQuorum} takes a `ROLE_REGISTRAR` quorum
* whose approvals carry BOTH families: the ML-DSA-87 vote and the SLH-DSA
* seal. A lattice break cannot then rewrite the roster, and neither can a
* hash-function break; only both at once.
*
* The bootstrap window is the exception, and it is the only one: while it is
* open the bootstrap admin writes alone, because every roster has to be
* installed by someone before it can install itself.
*
* ## The sender is not the account
*
* Final Chain transactions are type 0x46, signed by ML-DSA-87, and the node
* derives `msg.sender` from the key: `keccak256(0x04 ‖ publicKey)[12:]`. That
* address pays gas and holds no authority. {accountOfSender} binds it to the
* identity whose `activeTransaction` key it derives from, so a `msg.sender`
* gate anywhere on this chain asks {senderHasRole} and resolves to the
* identity — and a key rotation moves the binding rather than the roster.
*/
/// @dev Domain for a stage's encapsulation commitment. Byte-equal to
/// `FinalWalletFactory.DOMAIN_KEM_BUNDLE` and to `DOMAIN_KEM_BUNDLE_PREIMAGE` in
/// the issuer; three derivations of one word, and a mismatch in any of them is a
/// certificate that verifies nowhere.
bytes32 constant DOMAIN_KEM_BUNDLE = keccak256("FINAL_KEM_BUNDLE_v01");
/// @dev Tree 8's leaf domain — byte-equal to
/// `IdentityRootModule.DOMAIN_IDENTITY_LEAF` on every execution chain.
/// Restated rather than imported because the module lives on other chains and
/// there is no import that would make them one value; the cross-contract
/// parity test pins the pair. The `_PQ_` spelling is historical and FROZEN:
/// the premined vanity certificates were mined against this exact constant,
/// and the leaf it derives is the `certHash` inside every wallet's CREATE2
/// derivation.
bytes32 constant DOMAIN_IDENTITY_LEAF = keccak256("FINAL_IDENTITY_LEAF_PQ_v01");
/// @dev D7 (ruled 2026-09-01): ISSUER records project into tree 8 under their
/// own domain — `DOMAIN_ISSUER_LEAF ‖ certHash ‖ version ‖ issuerTreeRoot` —
/// so an issuer is stapleable for offline licence verification while the
/// distinct domain keeps its leaf out of wallet admission (the gateway folds
/// with the wallet domain, so an issuer leaf can never satisfy
/// `verifyIdentityCert`). `issuerTreeRoot` is a RESERVED word, zero until an
/// issuer's own certificate-tree anchor is wired — the only clean path to
/// offline licence revocation, since the fixed-depth insertion-ordered state
/// trees cannot prove non-inclusion.
bytes32 constant DOMAIN_ISSUER_LEAF = keccak256("FINAL_ISSUER_LEAF_v01");
/// @dev Chain-issuer constants (ruled 2026-09-01, amended same day: C-less).
/// The chain is the issuer but holds no keypair, so every chain-attested
/// certificate carries these two NAMED values in its issuer fields — required
/// by the wire format, verifying nothing, covered by `certHash`. The DN is
/// deliberately env-agnostic AND jurisdiction-silent: the issuer is the
/// worldwide network, not a legal entity, and an env-specific DN would fork
/// `certHash` per environment. Reference implementation:
/// `dashboard/public/fcert.js` (`CHAIN_ISSUER_DN`, `CHAIN_AUTHORITY_KEY_ID`);
/// `docs/developers/certificate-schema.md` § Chain-issuer constants.
bytes32 constant CHAIN_ISSUER_DN_HASH = keccak256("CN=Final Chain,O=Final DeFi");
/// @dev `SHA3-256(utf8("FINAL_CHAIN_AUTHORITY_v01"))` — a DOMAIN constant, not
/// a key digest (the chain has no PublicKeyBlock). Precomputed because the
/// mock SHA3 precompile under Foundry is deliberately not the real function;
/// pinned against `hashlib.sha3_256` and the dashboard's value by test.
/// Zero-length AuthorityKeyId stays reserved for the retired genesis root
/// alone and is admitted nowhere.
bytes32 constant CHAIN_AUTHORITY_KEY_ID =
0x9a6a5d8139ad2d28957698330aaa691017dba7dc80eb7cbec585239fb680bbab;
/// @notice The identity tree's projection door on `FinalStateTrees`. A narrow
/// interface rather than an import, because the trees contract imports this
/// file — the dependency runs that way and this is the one call that runs the
/// other. Same pattern as `IChainSource` on the trees side.
interface IIdentityLeafSink {
function syncIdentityLeaves(address[] calldata accounts) external;
}
/// @notice `FinalRevocationLog`'s recording door, same narrow-interface
/// reasoning. `recorded` is read first so a fingerprint someone already
/// recorded permissionlessly cannot revert the registry mutation feeding it.
interface IRevocationRecorder {
function record(bytes32 signerId) external;
function recorded(bytes32 signerId) external view returns (bool);
}
contract FinalIdentityRegistry {
// ---------------------------------------------------------------- roles
/// @notice May co-sign account-state rounds (tree 1).
uint256 public constant ROLE_ACCOUNT_COSIGNER = 1 << 0;
/// @notice May co-sign MMR / bundle-log advances.
uint256 public constant ROLE_MMR_COSIGNER = 1 << 1;
/// @notice May publish PHI ledger state (tree 2).
uint256 public constant ROLE_PHI_PUBLISHER = 1 << 2;
/// @notice May publish vAsset state (tree 3).
uint256 public constant ROLE_VASSET_PUBLISHER = 1 << 3;
/// @notice May publish oracle data (tree 4).
uint256 public constant ROLE_ORACLE_PUBLISHER = 1 << 4;
/// @notice May publish settlement / asset registry roots (trees 5 and 6).
uint256 public constant ROLE_REGISTRY_PUBLISHER = 1 << 5;
/// @notice May act as a wallet guardian.
uint256 public constant ROLE_GUARDIAN = 1 << 6;
/// @notice May submit transactions on behalf of the protocol.
uint256 public constant ROLE_RELAYER = 1 << 7;
/// @notice May register and revoke identities once bootstrap is sealed.
uint256 public constant ROLE_REGISTRAR = 1 << 8;
/// @notice A certificate authority — the root, or an intermediate under it.
uint256 public constant ROLE_CERTIFICATE_AUTHORITY = 1 << 9;
/// @notice May co-sign `FinalSettlementLog` appends — the cross-chain
/// settlement quorum, the same members whose LMS keys satisfy the
/// execution chains' settlement set. A role of its own rather than a
/// second use of `ROLE_REGISTRY_PUBLISHER`: the registries (trees 5/6)
/// change on listing cadence and settlement leaves release custody, and
/// one role for both would put the value plane behind the listing roster.
uint256 public constant ROLE_SETTLEMENT_COSIGNER = 1 << 10;
// ----------------------------------------------------- action domains
/// @dev One per membership mutation, so an approval to grant a role can
/// never be replayed as one to revoke. The registry is its own verifying
/// contract for these.
bytes32 public constant DOMAIN_REGISTER_WALLET = keccak256("FINAL_REGISTRY_REGISTER_WALLET_v01");
bytes32 public constant DOMAIN_REGISTER_ISSUER = keccak256("FINAL_REGISTRY_REGISTER_ISSUER_v01");
/// @notice The admission proof-of-possession digest domain (schema §v5).
/// The HOLDER signs `keccak256(abi.encode(domain, chainid, registry,
/// certHash, recoveryCertHash, gateNonce))` with the live transaction key
/// (ML-DSA-87) AND the live access key (SLH-DSA-SHAKE-256s) — both
/// families, in the admission transaction, verified by the precompiles.
/// Possession lives in the TRANSACTION, never in the artifact.
bytes32 public constant DOMAIN_IDENTITY_ADMISSION = keccak256("FINAL_IDENTITY_ADMISSION_v01");
/// @notice Root-plane global certificate revocation (D5).
bytes32 public constant DOMAIN_REVOKE_CERTIFICATE =
keccak256("FINAL_REGISTRY_REVOKE_CERTIFICATE_v01");
/// @notice The ISSUING identity's certificate-revocation digest domain.
bytes32 public constant DOMAIN_ISSUER_CERT_REVOCATION =
keccak256("FINAL_ISSUER_CERT_REVOCATION_v01");
bytes32 public constant DOMAIN_REGISTER_LMS_KEY = keccak256("FINAL_REGISTRY_REGISTER_LMS_KEY_v01");
bytes32 public constant DOMAIN_SET_ROLES = keccak256("FINAL_REGISTRY_SET_ROLES_v01");
bytes32 public constant DOMAIN_REVOKE = keccak256("FINAL_REGISTRY_REVOKE_v01");
bytes32 public constant DOMAIN_SET_REGISTRAR_THRESHOLD =
keccak256("FINAL_REGISTRY_SET_REGISTRAR_THRESHOLD_v01");
/// @dev The algorithm id the sender derivation is domain-separated by:
/// ML-DSA-87, FIPS 204, the only algorithm the transaction envelope admits.
uint8 private constant ENVELOPE_ALG_ML_DSA_87 = 4;
// ------------------------------------------------------------- storage
/**
* @notice One party's on-chain identity.
* @dev `version` increments on every mutation and is what a rotation is:
* the record is replaced, not appended to, and the version is how a reader
* on another chain knows which of two copies it saw is newer.
*/
struct Identity {
/// SHA3-256 of the LIVE certificate's TBS bytes. The revocation handle.
bytes32 certHash;
/// SHA3-256 of the RECOVERY certificate's TBS bytes.
bytes32 recoveryCertHash;
/// The certificate's 32-byte serial, `16 B entropy ‖ 16 B counter`.
bytes32 serial;
/// SHA3-256 of this certificate's public key block. A child names it in
/// its own `AuthorityKeyId`, which is how the chain links the two.
bytes32 subjectKeyId;
/// Capability bitmask. Zero for a registered-but-idle party.
uint256 roles;
/// Position on the delegation axis; 0 is the Final Chain root.
uint8 depth;
/// Deepest level this key may issue to. `== depth` means it signs no
/// certificates at all, which is every end entity.
uint8 maxDelegationDepth;
/// Seconds since epoch. The schema's TBS is nanoseconds; the conversion
/// happens off chain because block timestamps are seconds and a
/// comparison across units is a bug waiting for a leap.
/// @dev MILLISECONDS — this chain's clock. See `FinalChainTime`.
uint64 notBefore;
/// Seconds since epoch, or 0 for "never expires" — which the schema
/// allows and personal identity certificates use.
uint64 notAfter;
/// Monotonic. A rotation that does not advance it is refused.
uint64 version;
/// Set by `revoke`. Never unset: a revoked certificate is finished, and
/// an un-revoke would make every past verification re-openable.
bool revoked;
/// Distinguishes "no record" from "a record whose fields are all zero".
bool registered;
}
/**
* @notice A hash-based (LMS) signing key held by a registered account.
*
* The protocol plane's quorums verify LMS, not ML-DSA: an execution chain
* has no PQ precompiles, so `FinalRootAuthority` checks a keccak hash loop
* instead (`arch/hash-based-authority.md`). Those keys are the authority
* over `masterRoot`, and therefore over PQ execution — which makes "who
* holds signer 0x39bb…?" a question the state plane has to be able to
* answer, exactly as it answers it for every other key.
*
* Recorded against an account that is ALREADY registered, so an LMS key is
* a capability of a known identity rather than a standalone credential. It
* inherits that identity's revocation: a revoked account's signer is a
* revoked signer, with nothing extra to remember to do.
*/
struct LmsKey {
/// `I`, hashed into every step of the signature.
bytes16 keyId;
/// Merkle tree height. Bound into the fingerprint, because the leaf
/// commits to node `2^h + q` and a signer who could vary it could vary
/// the numbering.
uint8 height;
/// `T[1]`, the LMS public key.
bytes32 root;
/// Monotonic. A rotation that does not advance it is refused, so a
/// replayed registration cannot reinstate a superseded key.
uint64 version;
/// Distinguishes "no key" from "a key whose fields are all zero".
bool registered;
}
/// @notice The LMS signing key for an account, if it holds one.
/// @dev One slot per (account, chain) — LMS-01. `nextLeaf` on an
/// authority is a complete single-use counter only while the key it names
/// signs for ONE chain, so the roster is stored the way it is armed:
/// the same operator is a different signer on every chain.
mapping(address account => mapping(uint64 chainId => LmsKey)) private _lmsKey;
/// @notice Which account a signer fingerprint belongs to. This is the
/// lookup the whole record exists for: a gateway roster names fingerprints
/// and nothing else, so without it the keys are unattributable.
/// @dev What a fingerprint is bound to: the account that holds it and the
/// chain it signs for — one slot, written once at registration and left in
/// place when superseded (attribution is history). The chain names the
/// (account, chain) slot `lmsSignerIsLive` resolves against.
// NOTE: this contract sits ~13 bytes under EIP-170 (24,563 of 24,576 at
// the pinned optimizer settings). The next feature here pays for itself
// in bytecode first — see the LMS-binding merge and the off-chain
// zero-chain check for what that looks like.
struct LmsBinding {
address account;
uint64 chainId;
}
mapping(bytes32 signerId => LmsBinding) private _lmsBinding;
/// @notice The identity record for an account.
mapping(address account => Identity) private _identity;
/// The four slots, verbatim. All four are stored in full because the
/// precompiles verify against a KEY, not a commitment — and a key that
/// arrived in calldata proves nothing about who signed.
///
/// A CA has two keys, not four, and they live in the two ACTIVE slots. One
/// storage shape rather than two, because every reader would otherwise have
/// to know which kind of party it was looking at before it could look.
mapping(address account => bytes) private _activeTransactionKey;
mapping(address account => bytes) private _activeAccessKey;
mapping(address account => bytes) private _recoveryTransactionKey;
mapping(address account => bytes) private _recoveryAccessKey;
/// @notice The seal key — a service's second SLH-DSA-SHAKE-256s key, which
/// co-signs execution-class quorum decisions. Empty for every identity
/// whose certificate carries no `PURPOSE_ACTIVE_SEAL` entry: users, CAs.
mapping(address account => bytes) private _activeSealKey;
/// @notice Encapsulation keys, per stage. Two algorithms each — ML-KEM-1024
/// (lattice) and HQC-5 (code-based) — so a break in either family leaves the
/// other standing, the same reasoning that pairs ML-DSA with SLH-DSA above.
/// @dev Stored as the RAW keys, like the signing keys, because a registry
/// that held only commitments could not answer "encapsulate to this party"
/// without a second lookup somewhere less authoritative.
mapping(address account => bytes) private _activeKemMlKem;
mapping(address account => bytes) private _activeKemHqc;
mapping(address account => bytes) private _recoveryKemMlKem;
mapping(address account => bytes) private _recoveryKemHqc;
/// @notice Reverse index. A certificate identifies exactly one account, so
/// presenting a `certHash` is enough to find who it belongs to.
mapping(bytes32 certHash => address account) public accountOfCertificate;
/// @notice Revocation by certificate, independent of the account record.
/// A certificate stays revoked even if its account is later re-registered
/// under a new one.
mapping(bytes32 certHash => bool) public certificateRevoked;
/// @notice Who revoked a certificate through the ISSUER half of the lane.
/// Scoped by the verifier: the entry binds only when the recorded revoker
/// is the certificate's own issuer. Never gates registration.
mapping(bytes32 certHash => address) public certificateRevokedBy;
/// @notice Every registered account, in registration order. Small by
/// construction — this is services and co-signers, not wallets.
address[] private _accounts;
/// @notice Bootstrap authority. Zero once `sealBootstrap` has run.
address public bootstrapAdmin;
/// @notice Whether registration still accepts the bootstrap admin.
bool public bootstrapSealed;
/// @notice Where identity mutations project the tree-8 leaf, same-tx.
/// Zero only before {wireStatePlane} — the deploy tooling wires it before
/// the first registration, and the projection is skipped while unset so
/// the wiring transaction itself can be ordered freely in the bootstrap
/// window.
address public stateTrees;
/// @notice Where the PERMANENT standing losses — revocation and LMS-key
/// supersession — are recorded, same-tx. Zero only before {wireStatePlane}.
address public revocationLog;
/// @notice Sealed `ROLE_REGISTRAR` approvals a membership mutation needs.
/// @dev Zero until set, and bootstrap cannot be sealed while it is zero or
/// unreachable: a registry sealed behind a threshold nobody can meet is a
/// registry nobody can ever write to again.
uint256 public registrarThreshold;
/// @notice Replay counter per verifying contract — this registry for its
/// own mutations, each state-plane contract for its configuration. Bound
/// into every registrar digest, so an approval is for exactly one action.
mapping(address caller => uint64) private _gateNonce;
/// @notice The identity a Final Chain sender belongs to. See the contract
/// notes: a sender is derived from the `activeTransaction` key and is not
/// the account.
mapping(address sender => address account) public accountOfSender;
// -------------------------------------------------------------- events
event IdentityRegistered(
address indexed account, bytes32 indexed certHash, uint256 roles, uint64 version
);
event IdentityRolesChanged(address indexed account, uint256 previousRoles, uint256 newRoles);
event LmsKeyRegistered(
address indexed account,
bytes32 indexed signerId,
uint64 indexed chainId,
bytes16 keyId,
uint8 height,
bytes32 root,
uint64 version
);
event IdentityRevoked(address indexed account, bytes32 indexed certHash);
/// @notice One revocation-lane entry: `revoker` is `address(0)` for the
/// root plane, the issuing identity otherwise.
event CertificateRevoked(bytes32 indexed certHash, address indexed revoker);
event BootstrapSealed(address indexed sealedBy);
/// @notice The one-shot state-plane wiring landed.
event StatePlaneWired(address stateTrees, address revocationLog);
event RegistrarThresholdSet(uint256 threshold);
/// @notice A registrar quorum authorized an action. `nonce` is the value
/// the approvals were made over; the next action needs the next one.
event RegistrarQuorumApproved(
address indexed verifyingContract, bytes32 indexed actionDomain, uint64 nonce, uint256 valid
);
// -------------------------------------------------------------- errors
error NotAuthorized(address caller);
error BootstrapAlreadySealed();
error UnknownAccount(address account);
/// @notice A certificate's encapsulation key failed the chain's own
/// well-formedness check. Names the algorithm, because the pair is stored
/// together and "one of these two" is not an actionable answer.
error MalformedEncapsulationKey(address account, uint16 algorithmId);
error CertificateAlreadyBound(bytes32 certHash, address boundTo);
error CertificateIsRevoked(bytes32 certHash);
error VersionNotNewer(uint64 current, uint64 offered);
error IssuerNotACertificateAuthority(address issuer);
error IssuerMayNotSign(address issuer, uint8 depth, uint8 maxDelegationDepth);
error WrongDepth(uint8 got, uint8 want);
error DelegationWidened(uint8 child, uint8 issuer);
error AuthorityKeyIdMismatch(bytes32 got, bytes32 want);
error StagesDisagree(bytes32 liveSerial, bytes32 recoverySerial);
/// @notice `height` outside 1..24. See `FinalLms.MAX_HEIGHT`.
error LmsHeightOutOfRange(uint8 height);
/// @notice A zero root commits to no tree.
error LmsRootIsZero();
/// @notice This fingerprint already belongs to a different account.
error LmsKeyAlreadyBound(bytes32 signerId, address boundTo);
/// @notice Two identities cannot share a transaction key: the sender it
/// derives would be attributable to both.
error SenderAlreadyBound(address sender, address boundTo);
/// @notice Fewer registrars able to seal than the threshold asks for.
error RegistrarThresholdUnreachable(uint256 sealable, uint256 threshold);
error RegistrarThresholdIsZero();
/// @notice {wireStatePlane} ran already, or was handed a zero address.
error StatePlaneAlreadyWired();
error ZeroStatePlane();
/// @notice The holder's admission proof of possession did not verify —
/// one family failed, or the digest was built over the wrong nonce.
error AdmissionProofInvalid(address account);
/// @notice The certificate does not carry the ruled chain-issuer
/// AuthorityKeyId — it is not a chain-attested certificate.
error NotChainAttested(bytes32 authorityKeyId);
/// @notice The certificate's IssuerDN is not the ruled constant.
error WrongIssuerDn(bytes32 issuerDnHash);
/// @notice A chain-attested end entity sits at depth 1 with
/// `maxDelegationDepth == depth`; anything else is not an end entity.
error NotAnEndEntity(uint8 depth, uint8 maxDelegationDepth);
/// @notice An issuer that cannot sign is an end entity wearing a profile.
error IssuerCannotSign(uint8 depth, uint8 maxDelegationDepth);
/// @notice Third-party issuers carry a real `NotAfter` (ruling 3) —
/// expiry is the passive half of their lifecycle.
error IssuerMustExpire();
/// @notice An issuer validity window past the ~2-year ceiling (ruling 3).
error IssuerValidityTooLong(uint64 notBefore, uint64 notAfter);
/// @notice An institution registration without a real ISO 3166 `C=` in
/// its subject DN, or with a jurisdiction that does not match its
/// Institution extension. Only the trust root is jurisdiction-silent.
error JurisdictionMissing();
error JurisdictionMismatch();
// --------------------------------------------------------- constructor
/**
* @param admin The bootstrap registrar. Genesis names the chain deployer.
* @dev The precompile probe is the point of the constructor. This contract
* is meaningless on a chain that cannot verify PQ signatures, and deploying
* it there would produce a registry full of keys nothing can check.
*/
constructor(address admin) {
FinalChainPrecompiles.assertAvailable();
bootstrapAdmin = admin;
}
// ----------------------------------------------------------- authority
/**
* @dev Bootstrap is a real window, not a formality: every roster in this
* system has to be installed by someone before it can install itself, and
* pretending otherwise produced the one roster that could not be
* bootstrapped in `FinalRootAuthority`. It is closed by
* `sealBootstrap`, which is irreversible.
*
* While it is open the admin writes alone. Once it is closed there is no
* single-caller path left — not for a registrar, not for anyone — and
* every mutation goes through the sealed registrar quorum.
*/
function _requireMembershipAuthority(
bytes32 actionDomain,
bytes32 payloadDigest,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) private {
if (!bootstrapSealed && msg.sender == bootstrapAdmin) return;
_requireRegistrarQuorum(address(this), actionDomain, payloadDigest, anchorBlock, approvals);
}
/**
* @notice The sealed registrar quorum, for the other state-plane contracts.
* @dev `msg.sender` — the calling contract — is the verifying contract the
* digest binds and the counter it burns, so an approval collected for the
* trees' configuration cannot be spent on the bundle log's. The caller
* decides its own bootstrap exemption before calling; this function knows
* no caller's admin and applies none.
*
* Anyone may SUBMIT such a transaction. Authority is the approvals, not the
* sender, which is the whole point of the quorum.
*/
function requireRegistrarQuorum(
bytes32 actionDomain,
bytes32 payloadDigest,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireRegistrarQuorum(msg.sender, actionDomain, payloadDigest, anchorBlock, approvals);
}
/// @dev The digest is `FinalPqQuorum.digest(verifyingContract, actionDomain,
/// anchorBlock, keccak256(abi.encode(nonce, payloadDigest)))`; the seal is
/// required — membership is the hybrid class.
function _requireRegistrarQuorum(
address verifyingContract,
bytes32 actionDomain,
bytes32 payloadDigest,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) private {
if (registrarThreshold == 0) revert RegistrarThresholdIsZero();
uint64 nonce = _gateNonce[verifyingContract];
_gateNonce[verifyingContract] = nonce + 1;
bytes32 quorumDigest = FinalPqQuorum.digest(
verifyingContract, actionDomain, anchorBlock, keccak256(abi.encode(nonce, payloadDigest))
);
uint256 valid = FinalPqQuorum.require_(
this,
approvals,
quorumDigest,
ROLE_REGISTRAR,
registrarThreshold,
FinalPqQuorum.ALG_ML_DSA_87,
anchorBlock,
true
);
emit RegistrarQuorumApproved(verifyingContract, actionDomain, nonce, valid);
}
/**
* @notice Set how many sealed registrar approvals a membership mutation needs.
* @dev Bootstrap admin while the window is open; the current registrar
* quorum afterwards, so a registrar set that grows or shrinks can move it.
* Refuses a threshold the sealable registrars cannot meet, and refuses zero:
* both are a registry that can never be written to again.
*/
function setRegistrarThreshold(
uint256 threshold,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireMembershipAuthority(
DOMAIN_SET_REGISTRAR_THRESHOLD, keccak256(abi.encode(threshold)), anchorBlock, approvals
);
if (threshold == 0) revert RegistrarThresholdIsZero();
uint256 sealable = sealableMemberCount(ROLE_REGISTRAR);
if (sealable < threshold) revert RegistrarThresholdUnreachable(sealable, threshold);
registrarThreshold = threshold;
emit RegistrarThresholdSet(threshold);
}
/// @notice The replay counter the next registrar approval for `caller`
/// must be made over.
function gateNonceOf(address caller) external view returns (uint64) {
return _gateNonce[caller];
}
// -------------------------------------------------------- LMS signers
/**
* @notice The roster identity of an LMS public key.
* @dev Byte-identical to `FinalRootAuthority.signerId`. Restated rather
* than imported because the two live on different chains and there is no
* import that would make them one value — which is precisely why a test
* pins them together. A drift here would make every lookup miss while
* looking perfectly well-formed.
*/
function lmsSignerId(bytes16 keyId, uint8 height, bytes32 root) public pure returns (bytes32) {
return keccak256(abi.encode(keyId, height, root));
}
/**
* @notice Record the LMS signing key an already-registered account holds.
* @dev Membership-gated, same as every other write here.
*
* Deliberately NOT a certificate: an LMS key is a capability of an existing
* identity, not an identity of its own. Binding it to an account means it
* inherits that account's revocation, so retiring a compromised operator is
* one action rather than one-per-key-they-hold.
*
* @param account Must already be registered and not revoked.
* @param version Strictly increasing. A rotation that does not advance it
* is refused, so a replayed registration cannot reinstate a key the
* operator has moved off.
* @param anchorBlock The block the registrars read the roster at; see
* `FinalPqQuorum`. Ignored while bootstrap is open.
* @param approvals The sealed registrar quorum. Empty while bootstrap is open.
*/
function registerLmsKey(
address account,
uint64 chainId,
bytes16 keyId,
uint8 height,
bytes32 root,
uint64 version,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireMembershipAuthority(
DOMAIN_REGISTER_LMS_KEY,
keccak256(abi.encode(account, chainId, keyId, height, root, version)),
anchorBlock,
approvals
);
Identity storage id = _identity[account];
if (!id.registered) revert UnknownAccount(account);
if (id.revoked) revert CertificateIsRevoked(id.certHash);
// A zero chain id is a tooling mistake, not an attack: the slot it
// would occupy is self-consistent and no authority consults it. The
// publisher refuses it; EIP-170 pressure keeps the check off-chain.
if (height == 0 || height > 24) revert LmsHeightOutOfRange(height);
if (root == bytes32(0)) revert LmsRootIsZero();
// Version lineage is PER (account, chain) — LMS-01 made the same
// operator a different signer on every chain, so chain B starting at
// version 1 says nothing about chain A being at version 3.
LmsKey storage existing = _lmsKey[account][chainId];
// An empty slot holds version 0, so this alone also refuses a version-0
// registration — versions start at 1.
if (version <= existing.version) {
revert VersionNotNewer(existing.version, version);
}
bytes32 signerId = lmsSignerId(keyId, height, root);
address boundTo = _lmsBinding[signerId].account;
if (boundTo != address(0) && boundTo != account) {
revert LmsKeyAlreadyBound(signerId, boundTo);
}
// The fingerprint being superseded, captured before the slot moves —
// `existing` is a storage pointer and reads the NEW key afterwards.
bytes32 superseded = existing.registered
? lmsSignerId(existing.keyId, existing.height, existing.root)
: bytes32(0);
// The superseded fingerprint is left bound to this account rather than
// cleared. It is history: a signature made under the old key was made
// by this operator, and a lookup that stopped resolving would make that
// unprovable after the fact.
_lmsKey[account][chainId] = LmsKey(keyId, height, root, version, true);
_lmsBinding[signerId] = LmsBinding(account, chainId);
emit LmsKeyRegistered(account, signerId, chainId, keyId, height, root, version);
// Supersession is a PERMANENT transition — the old fingerprint stops
// being this slot's current key and nothing re-registers it (a
// re-registration of the same material is the same fingerprint, which
// the guard below leaves alone). Recorded same-tx so the execution
// chains' suspension lane never depends on someone noticing.
if (superseded != bytes32(0) && superseded != signerId) {
_recordRevokedSigner(superseded);
}
_projectIdentity(account);
}
/// @notice The LMS key an account holds for one chain, if any.
function lmsKeyOf(address account, uint64 chainId) external view returns (LmsKey memory) {
return _lmsKey[account][chainId];
}
/// @notice What a fingerprint is bound to: the account that registered it
/// and the chain it signs for. Zeroes for a fingerprint never registered.
/// @dev The revocation log's permanence gate reads this to find the
/// (account, chain) SLOT a fingerprint belongs to — the slot's current key
/// is what separates a superseded fingerprint (permanent, recordable) from
/// a merely lapsed one (expiry, temporary, refused). Attribution is
/// history: the binding survives supersession, exactly as the mapping
/// behind {lmsSignerIsLive} does, because it IS that mapping.
function lmsBindingOf(bytes32 signerId) external view returns (address account, uint64 chainId) {
LmsBinding storage binding = _lmsBinding[signerId];
return (binding.account, binding.chainId);
}
/**
* @notice Is this signer fingerprint held by a live, unrevoked account?
* @dev The question a verifier actually has. A gateway roster names
* fingerprints and nothing else, so "is 0x39bb… still good?" is otherwise
* unanswerable from the state plane.
*/
function lmsSignerIsLive(bytes32 signerId) external view returns (bool live, address account) {
LmsBinding storage binding = _lmsBinding[signerId];
account = binding.account;
if (account == address(0)) return (false, address(0));
// `isActive`, not a registered/revoked pair spelled out here. The
// certificate validity window is part of standing: an expired identity
// already holds no role, and a signer lookup that disagreed would leave
// a roster satisfiable by an operator the rest of the registry has
// stopped honouring. Spelling the condition out a second time is how
// the two drift apart.
if (!isActive(account)) return (false, account);
// The CURRENT key of the fingerprint's own (account, chain) slot, not
// merely one this account ever held: a superseded fingerprint stays
// attributable but stops being live, and a rotation on one chain says
// nothing about the same operator's key on another.
LmsKey storage k = _lmsKey[account][binding.chainId];
live = k.registered && lmsSignerId(k.keyId, k.height, k.root) == signerId;
}
/// @notice Close the bootstrap window. Irreversible.
/// @dev Refuses while the registrar quorum is unset or unreachable, because
/// sealing then would leave a registry nobody can ever write to again. The
/// count is of registrars that can SEAL — a certificate authority carrying
/// the role has no seal key and can never contribute an approval.
function sealBootstrap() external {
if (msg.sender != bootstrapAdmin) revert NotAuthorized(msg.sender);
if (bootstrapSealed) revert BootstrapAlreadySealed();
if (registrarThreshold == 0) revert RegistrarThresholdIsZero();
uint256 sealable = sealableMemberCount(ROLE_REGISTRAR);
if (sealable < registrarThreshold) {
revert RegistrarThresholdUnreachable(sealable, registrarThreshold);
}
bootstrapSealed = true;
bootstrapAdmin = address(0);
emit BootstrapSealed(msg.sender);
}
// ------------------------------------------------- state-plane wiring
/**
* @notice Wire the trees and the revocation log, once, inside the
* bootstrap window.
* @dev One-shot because both pointers are TRUST TOPOLOGY: the trees
* pointer decides where the wallet-creation admission set is written, and
* the log pointer decides where permanent standing losses are recorded. A
* re-wireable pointer would be a key over both. It cannot be a constructor
* argument — both contracts take THIS registry as one — so the deploy
* tooling calls it in the same nonce-fixed block that deploys them, before
* any identity is registered.
*/
function wireStatePlane(address stateTrees_, address revocationLog_) external {
if (bootstrapSealed || msg.sender != bootstrapAdmin) revert NotAuthorized(msg.sender);
if (stateTrees != address(0) || revocationLog != address(0)) revert StatePlaneAlreadyWired();
if (stateTrees_ == address(0) || revocationLog_ == address(0)) revert ZeroStatePlane();
stateTrees = stateTrees_;
revocationLog = revocationLog_;
emit StatePlaneWired(stateTrees_, revocationLog_);
}
/// @dev Project `account`'s tree-8 leaf, same-tx. Skipped while the plane
/// is unwired — the bootstrap-window state the deploy tooling closes
/// before the first registration — and never otherwise: the leaf value is
/// derived by the trees contract from THIS registry's post-mutation state,
/// so there is nothing here to get wrong besides forgetting to call it.
function _projectIdentity(address account) private {
address trees = stateTrees;
if (trees == address(0)) return;
address[] memory one = new address[](1);
one[0] = account;
IIdentityLeafSink(trees).syncIdentityLeaves(one);
}
/// @dev Record a PERMANENTLY retired fingerprint, same-tx, unless the log
/// is unwired or someone already recorded it permissionlessly.
function _recordRevokedSigner(bytes32 signerId) private {
address log = revocationLog;
if (log == address(0)) return;
if (IRevocationRecorder(log).recorded(signerId)) return;
IRevocationRecorder(log).record(signerId);
}
// -------------------------------------------------------- registration
/// @notice The holder's admission proof of possession: both live-stage
/// families over the admission digest (schema §v5). There is no root
/// keypair and no CA signature any more — the chain admits, and the
/// "2 signatures at creation" are the HOLDER's, verified by the
/// precompiles inside this very transaction.
struct AdmissionProof {
bytes mlDsaSignature;
bytes slhDsaSignature;
}
/**
* @notice Register or rotate a Final Wallet identity from its two public
* certificates — CHAIN-ATTESTED (schema §v5, ruled 2026-09-01).
*
* @param account The wallet address the certificate set derives.
* @param liveTbs `live.pub.fcert` TBS — `activeTransaction` + `activeAccess`.
* @param recoveryTbs `recovery.pub.fcert` TBS — the pre-committed recovery pair.
* @param proof The HOLDER's two signatures over the admission digest —
* the live transaction key (ML-DSA-87) and the live access key
* (SLH-DSA-SHAKE-256s), verified in the precompiles inside this
* transaction. This replaced the CA signature: issuance authority
* is the registrar quorum, possession is this proof, and there is
* no root keypair anywhere.
* @param roles Capability bitmask. The one thing the certificates do not
* say, because capability is this system's decision.
* @param version Monotonic. A rotation that does not advance it is refused.
* @param anchorBlock The block the registrars read the roster at. Ignored
* while bootstrap is open.
* @param approvals The sealed registrar quorum. Empty while bootstrap is
* open. The digest binds the account, both certificates' bytes,
* the roles and the version.
*
* @dev **Both stages, together.** A wallet has four keys in two stages and
* the recovery pair is PRE-COMMITTED — written at `initialize` from the same
* certificate set that determined the address, which is why PQ migration
* takes no key arguments. The two must share a `SerialNumber`: a serial is
* per certificate SET, so two stages disagreeing are two different wallets.
*
* **Chain-attested means pinned, per stage:** the ruled IssuerDN and
* AuthorityKeyId constants, depth exactly 1 (directly under the chain),
* and `maxDelegationDepth == depth` (an end entity signs nothing — the
* same immutable pair `identityTreeLeafOf` discriminates records by).
*/
function registerWallet(
address account,
bytes calldata liveTbs,
bytes calldata recoveryTbs,
AdmissionProof calldata proof,
uint256 roles,
uint64 version,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external returns (bytes32 certHash) {
// Read BEFORE the authority check: the quorum path burns this counter
// inside `_requireRegistrarQuorum`, and the proof must bind the value
// the round was built over. The bootstrap path burns it explicitly in
// `_requireAdmissionProof`, so an admission is one-shot in both regimes.
uint64 admissionNonce = _gateNonce[address(this)];
_requireMembershipAuthority(
DOMAIN_REGISTER_WALLET,
keccak256(
abi.encode(account, keccak256(liveTbs), keccak256(recoveryTbs), roles, version)
),
anchorBlock,
approvals
);
FinalCertificate.Parsed memory l = FinalCertificate.parseLive(liveTbs);
FinalCertificate.Parsed memory r = FinalCertificate.parseRecovery(recoveryTbs);
if (l.serial != r.serial) revert StagesDisagree(l.serial, r.serial);
_requireChainAttestedEndEntity(l);
_requireChainAttestedEndEntity(r);
_requireAdmissionProof(account, l, r.certHash, proof, admissionNonce);
certHash = l.certHash;
_write(account, l, r, roles, version, false);
}
/**
* @notice Register or rotate an ISSUER — a third party (or our own
* intermediate) that signs certificates OFF-chain with the keys
* registered here (D2: the superCA).
*
* @param account The issuer's account on this chain.
* @param tbs The single issuer certificate's TBS: two CERT_SIGNING keys
* (ML-DSA-87 + SLH-DSA-SHAKE-256s), no recovery stage — renewing an
* issuer is re-issuing, a governance act rather than a key rotation.
* @param parent The registered parent issuer for a nested intermediate;
* `address(0)` for an issuer hanging directly under the chain.
* @param proof The issuer's OWN two cert-signing keys over the admission
* digest (`recoveryCertHash` slot is zero — there is no recovery
* stage to bind).
*
* @dev Admission is chain-native like any identity: registrar quorum plus
* the holder's PoP. What the v4 delegation rules said survives verbatim as
* LINEAGE — a nested issuer's depth, delegation bound and AuthorityKeyId
* must chain to its registered parent — but no parent SIGNS anything; the
* chain's admission is the issuance.
*
* Ruling 3: a registered issuer always expires (`NotAfter` real, window
* bounded ~2 years) — the passive liveness touchpoint; renewal re-issues
* under the same registered keys with a version bump.
*
* The jurisdiction rule (ruled 2026-09-01, amended): only the trust root
* is jurisdiction-silent. An institution MUST carry its real ISO 3166
* `C=` in its subject DN, matching the `jurisdiction` field of its
* `0x0102` Institution extension — CA/Browser-Forum practice, enforced at
* the door because a verifier's legal recourse starts with knowing where
* an issuer answers for itself.
*/
function registerIssuer(
address account,
bytes calldata tbs,
address parent,
AdmissionProof calldata proof,
uint256 roles,
uint64 version,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external returns (bytes32 certHash) {
uint64 admissionNonce = _gateNonce[address(this)];
_requireMembershipAuthority(
DOMAIN_REGISTER_ISSUER,
keccak256(abi.encode(account, keccak256(tbs), parent, roles, version)),
anchorBlock,
approvals
);
FinalCertificate.Parsed memory c = FinalCertificate.parseCa(tbs);
// An issuer that cannot sign is an end entity wearing a profile —
// and an end entity belongs in `registerWallet`.
if (c.depth == 0 || c.maxDelegationDepth <= c.depth) {
revert IssuerCannotSign(c.depth, c.maxDelegationDepth);
}
if (c.notAfter == 0) revert IssuerMustExpire();
if (c.notAfter - c.notBefore > MAX_ISSUER_VALIDITY_MS) {
revert IssuerValidityTooLong(c.notBefore, c.notAfter);
}
if (c.issuerDnHash != CHAIN_ISSUER_DN_HASH) revert WrongIssuerDn(c.issuerDnHash);
_requireLineage(parent, c);
_requireJurisdiction(c);
_requireAdmissionProof(account, c, bytes32(0), proof, admissionNonce);
certHash = c.certHash;
_write(account, c, c, roles | ROLE_CERTIFICATE_AUTHORITY, version, true);
}
/// @notice Ruling 3's validity ceiling for registered issuers, in this
/// chain's milliseconds: two 366-day years.
uint64 public constant MAX_ISSUER_VALIDITY_MS = 2 * 366 days * 1000;
/// @dev The chain-attested end-entity pins, run once per stage.
function _requireChainAttestedEndEntity(FinalCertificate.Parsed memory c) private pure {
if (c.authorityKeyId != CHAIN_AUTHORITY_KEY_ID) revert NotChainAttested(c.authorityKeyId);
if (c.issuerDnHash != CHAIN_ISSUER_DN_HASH) revert WrongIssuerDn(c.issuerDnHash);
if (c.depth != 1 || c.maxDelegationDepth != c.depth) {
revert NotAnEndEntity(c.depth, c.maxDelegationDepth);
}
}
/// @dev The v4 delegation rules, surviving as lineage: a nested issuer
/// chains to a registered, signing-capable parent one level up; a direct
/// issuer hangs under the chain at depth 1.
function _requireLineage(address parent, FinalCertificate.Parsed memory c) private view {
if (parent == address(0)) {
if (c.authorityKeyId != CHAIN_AUTHORITY_KEY_ID) {
revert NotChainAttested(c.authorityKeyId);
}
if (c.depth != 1) revert WrongDepth(c.depth, 1);
return;
}
Identity storage ca = _identity[parent];
if (!hasRole(parent, ROLE_CERTIFICATE_AUTHORITY)) {
revert IssuerNotACertificateAuthority(parent);
}
// Delegation is governed by depth, not by a boolean. `Depth <
// MaxDelegationDepth` permits signing, and a child sits exactly one
// level down — an issuer cannot skip levels to escape its own bound.
if (ca.depth >= ca.maxDelegationDepth) {
revert IssuerMayNotSign(parent, ca.depth, ca.maxDelegationDepth);
}
if (c.depth != ca.depth + 1) revert WrongDepth(c.depth, ca.depth + 1);
if (c.maxDelegationDepth > ca.maxDelegationDepth) {
revert DelegationWidened(c.maxDelegationDepth, ca.maxDelegationDepth);
}
if (c.authorityKeyId != ca.subjectKeyId) {
revert AuthorityKeyIdMismatch(c.authorityKeyId, ca.subjectKeyId);
}
}
/// @dev The jurisdiction rule: a real ISO 3166 alpha-2 `C=` in the subject
/// DN, equal to the Institution extension's `jurisdiction` field. The DN
/// is canonical comma-separated form, so `C=` matches at the start or
/// right after a comma; the component value is exactly two bytes.
function _requireJurisdiction(FinalCertificate.Parsed memory c) private pure {
bytes memory dn = c.subjectDn;
bytes2 country;
bool found = false;
for (uint256 i = 0; i + 4 <= dn.length; i++) {
if ((i == 0 || dn[i - 1] == ",") && dn[i] == "C" && dn[i + 1] == "=") {
// Exactly two bytes, then end-of-DN or the next component.
if (i + 4 < dn.length && dn[i + 4] != ",") revert JurisdictionMissing();
country = bytes2(bytes.concat(dn[i + 2], dn[i + 3]));
found = true;
break;
}
}
if (!found) revert JurisdictionMissing();
// Institution extension: legalNameLength ‖ legalName ‖
// registrationNoLength ‖ registrationNo ‖ jurisdictionLength ‖
// jurisdiction. The jurisdiction must EQUAL the DN's country.
bytes memory ext = c.institutionExt;
if (ext.length < 6) revert JurisdictionMissing();
uint256 q = 2 + (uint256(uint8(ext[0])) << 8 | uint256(uint8(ext[1])));
if (ext.length < q + 2) revert JurisdictionMissing();
q += 2 + (uint256(uint8(ext[q])) << 8 | uint256(uint8(ext[q + 1])));
if (ext.length < q + 2) revert JurisdictionMissing();
uint256 jLen = uint256(uint8(ext[q])) << 8 | uint256(uint8(ext[q + 1]));
q += 2;
if (jLen != 2 || ext.length < q + 2) revert JurisdictionMismatch();
if (bytes2(bytes.concat(ext[q], ext[q + 1])) != country) revert JurisdictionMismatch();
}
/// @dev Verify the holder's PoP: both live-stage families over the
/// admission digest, in the precompiles, inside this transaction. Burns
/// the gate nonce on the bootstrap path (the quorum path burned it in
/// `_requireRegistrarQuorum` already), so an admission is one-shot in
/// both regimes.
function _requireAdmissionProof(
address account,
FinalCertificate.Parsed memory live,
bytes32 recoveryCertHash,
AdmissionProof calldata proof,
uint64 admissionNonce
) private {
bytes memory message = abi.encodePacked(
keccak256(
abi.encode(
DOMAIN_IDENTITY_ADMISSION,
block.chainid,
address(this),
live.certHash,
recoveryCertHash,
admissionNonce
)
)
);
if (
!FinalChainPrecompiles.verifyMlDsa87(live.transactionKey, message, proof.mlDsaSignature)
|| !FinalChainPrecompiles.verifySlhDsa(live.accessKey, message, proof.slhDsaSignature)
) revert AdmissionProofInvalid(account);
if (_gateNonce[address(this)] == admissionNonce) {
_gateNonce[address(this)] = admissionNonce + 1;
}
}
function _write(
address account,
FinalCertificate.Parsed memory live,
FinalCertificate.Parsed memory recovery,
uint256 roles,
uint64 version,
bool isCa
) private {
if (account == address(0)) revert UnknownAccount(account);
if (certificateRevoked[live.certHash]) revert CertificateIsRevoked(live.certHash);
address boundTo = accountOfCertificate[live.certHash];
if (boundTo != address(0) && boundTo != account) {
revert CertificateAlreadyBound(live.certHash, boundTo);
}
Identity storage id = _identity[account];
if (!id.registered) {
_accounts.push(account);
id.registered = true;
} else {
if (version <= id.version) revert VersionNotNewer(id.version, version);
if (id.revoked) revert CertificateIsRevoked(id.certHash);
// A rotation releases the previous certificate's binding. It is NOT
// revoked — a superseded certificate and a compromised one are
// different facts and revocation is the louder of the two.
if (id.certHash != live.certHash) delete accountOfCertificate[id.certHash];
}
id.certHash = live.certHash;
id.recoveryCertHash = recovery.certHash;
id.serial = live.serial;
id.subjectKeyId = live.subjectKeyId;
id.roles = roles;
id.depth = live.depth;
id.maxDelegationDepth = live.maxDelegationDepth;
id.notBefore = live.notBefore;
id.notAfter = live.notAfter;
id.version = version;
// The sender binding moves with the transaction key. The old sender is
// released rather than kept: a rotation is the account disowning that
// key, and a gate that still resolved it would honour a retired key.
address sender = senderFor(live.transactionKey);
address senderBoundTo = accountOfSender[sender];
if (senderBoundTo != address(0) && senderBoundTo != account) {
revert SenderAlreadyBound(sender, senderBoundTo);
}
if (_activeTransactionKey[account].length != 0) {
address previousSender = senderFor(_activeTransactionKey[account]);
if (previousSender != sender) delete accountOfSender[previousSender];
}
accountOfSender[sender] = account;
_activeTransactionKey[account] = live.transactionKey;
_activeAccessKey[account] = live.accessKey;
// A CA has no recovery pair; the two active slots are all it has.
_recoveryTransactionKey[account] = isCa ? bytes("") : recovery.transactionKey;
_recoveryAccessKey[account] = isCa ? bytes("") : recovery.accessKey;
// Cleared on a rotation to a certificate without one, for the same
// reason the encapsulation pair is: a stale seal surviving a rotation
// would let a retired key keep co-signing execution.
_activeSealKey[account] = isCa ? bytes("") : live.sealKey;
// The encapsulation pair, validated before it is stored.
//
// **The registry is where a sender looks up "encapsulate to this
// party", so a malformed key here is not a bad record — it is an
// account nobody can seal an intent to.** The discovery would happen at
// the first attempt, and on the hybrid path it would happen as a pair
// silently reduced to one family, which is identical on the wire. The
// precompiles make it a refusal at registration instead.
//
// Neither is a re-implementation of the KEM: `0x0203` runs FIPS 203
// §7.2's own encapsulation-key check and `0x0207` runs the structural
// check HQC-5's encoding admits. Encapsulation is a sender operation
// and decapsulation needs the secret key, so nothing more belongs here.
//
// A CA is sealed to by nobody and carries no encapsulation stage, so
// its slots are cleared rather than checked.
_storeKemPair(account, isCa, live.kemMlKem, live.kemHqc, true);
_storeKemPair(account, isCa, recovery.kemMlKem, recovery.kemHqc, false);
accountOfCertificate[live.certHash] = account;
emit IdentityRegistered(account, live.certHash, roles, version);
// Same-tx: a registration or rotation is visible to every execution
// chain's admission set the moment it is visible here.
_projectIdentity(account);
}
/**
* @dev Store one stage's encapsulation pair, or clear it.
*
* Empty is legitimate and is not the same as absent-and-wrong: a CA has no
* encapsulation stage, and a certificate issued before v4 carries none.
* `FinalCertificate.parse` has already refused the half-populated case, so
* by here the pair is both or neither.
*
* Cleared rather than left alone on a rotation to an empty pair. A stale
* key surviving a rotation is a sender encapsulating to a credential the
* account has disowned, and the intent then never decrypts — the failure
* mode with no error attached, and the one this whole pairing exists to
* avoid.
*/
function _storeKemPair(address account, bool isCa, bytes memory mlKem, bytes memory hqc, bool isLive)
private
{
if (isCa || mlKem.length == 0) {
delete (isLive ? _activeKemMlKem : _recoveryKemMlKem)[account];
delete (isLive ? _activeKemHqc : _recoveryKemHqc)[account];
return;
}
if (!FinalChainPrecompiles.isWellFormedMlKem1024(mlKem)) {
revert MalformedEncapsulationKey(account, FinalCertificate.ALG_ML_KEM_1024);
}
if (!FinalChainPrecompiles.isWellFormedHqc5(hqc)) {
revert MalformedEncapsulationKey(account, FinalCertificate.ALG_HQC_5);
}
if (isLive) {
_activeKemMlKem[account] = mlKem;
_activeKemHqc[account] = hqc;
} else {
_recoveryKemMlKem[account] = mlKem;
_recoveryKemHqc[account] = hqc;
}
}
/// @notice Grant or withdraw capabilities without rotating keys.
/// @dev Separate from registration because the two have different
/// cadences: a role changes when a service's job changes, a key changes
/// when it is compromised or aged out. Folding them together would force a
/// key rotation to express a role change.
function setRoles(
address account,
uint256 roles,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireMembershipAuthority(
DOMAIN_SET_ROLES, keccak256(abi.encode(account, roles)), anchorBlock, approvals
);
Identity storage id = _identity[account];
if (!id.registered) revert UnknownAccount(account);
if (id.revoked) revert CertificateIsRevoked(id.certHash);
uint256 previous = id.roles;
id.roles = roles;
_requireRegistrarQuorumReachable();
emit IdentityRolesChanged(account, previous, roles);
// Roles are not in the tree-8 leaf, so this rewrites the same value —
// kept anyway so "every identity mutation projects" has no exceptions
// to remember.
_projectIdentity(account);
}
/// @dev Once sealed, no mutation may leave the registrar quorum unreachable
/// — that is the one change nothing could ever undo. Checked after the
/// write so the count reflects it.
function _requireRegistrarQuorumReachable() private view {
if (!bootstrapSealed) return;
uint256 sealable = sealableMemberCount(ROLE_REGISTRAR);
if (sealable < registrarThreshold) {
revert RegistrarThresholdUnreachable(sealable, registrarThreshold);
}
}
/// @notice Revoke an identity and its certificate. Irreversible.
/// @param chainIds The chains whose LMS-key slots this account holds — the
/// registrars supply the list (the digest binds it) because a mapping
/// cannot enumerate its own keys. Each named slot's current fingerprint is
/// recorded into the revocation log same-tx; a chain with no slot is
/// skipped, and a fingerprint missed by an incomplete list stays
/// permanently recordable through the log's permissionless door, since a
/// revoked account never regains standing.
/// @dev Clears the roles as well as setting the flag. Both are checked
/// everywhere, but leaving a revoked record carrying roles invites a future
/// reader that checks only one of them.
function revoke(
address account,
uint64[] calldata chainIds,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireMembershipAuthority(
DOMAIN_REVOKE, keccak256(abi.encode(account, chainIds)), anchorBlock, approvals
);
Identity storage id = _identity[account];
if (!id.registered) revert UnknownAccount(account);
id.revoked = true;
id.roles = 0;
certificateRevoked[id.certHash] = true;
_requireRegistrarQuorumReachable();
emit IdentityRevoked(account, id.certHash);
// AFTER the flag lands, so the log's own gate sees the permanent
// transition it requires.
for (uint256 i = 0; i < chainIds.length; i++) {
LmsKey storage k = _lmsKey[account][chainIds[i]];
if (k.registered) _recordRevokedSigner(lmsSignerId(k.keyId, k.height, k.root));
}
_projectIdentity(account);
}
/**
* @notice Root-plane GLOBAL certificate revocation, by `certHash` (D5).
*
* @dev The half of the one revocation lane that gates registration and
* covers break-glass: any certificate — registered, off-chain-issued, or
* never seen — can be killed by handle under the registrar quorum. When
* the handle is a registered identity's CURRENT certificate the identity
* falls with it (flag, roles, same-tx projection), so a break-glass by
* handle is never weaker than {revoke} — it only skips the LMS-slot
* enumeration, which stays permanently recordable through the revocation
* log's permissionless door.
*/
function revokeCertificate(
bytes32 certHash,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireMembershipAuthority(
DOMAIN_REVOKE_CERTIFICATE, keccak256(abi.encode(certHash)), anchorBlock, approvals
);
certificateRevoked[certHash] = true;
address bound = accountOfCertificate[certHash];
if (bound != address(0)) {
Identity storage id = _identity[bound];
if (!id.revoked) {
id.revoked = true;
id.roles = 0;
_requireRegistrarQuorumReachable();
emit IdentityRevoked(bound, certHash);
_projectIdentity(bound);
}
}
emit CertificateRevoked(certHash, address(0));
}
/**
* @notice The ISSUING identity's half of the revocation lane: a registered
* issuer revokes a certificate it signed OFF-chain, by `certHash`.
*
* @dev "Sub-issuer and us alike" (D5) — but SCOPED: this records WHO
* revoked, and a verifier honours the entry only when the revoker is the
* certificate's own issuer (which the verifier knows — it holds the
* cert). It deliberately does NOT set the global `certificateRevoked`
* flag: that flag gates registration, and letting any registered issuer
* set it for an arbitrary handle would be a griefing lane over other
* people's certificates.
*
* Anyone may SUBMIT; authority is the two signatures — the issuer's
* registered cert-signing keys over a digest binding this registry, the
* chain, the handle and the issuer's own gate nonce. One-way: the first
* revoker of a handle is recorded and a second write is refused, because
* "revoked twice by two parties" is two facts where the lane models one.
*/
function revokeIssuedCertificate(
address issuer,
bytes32 certHash,
AdmissionProof calldata proof
) external {
if (!hasRole(issuer, ROLE_CERTIFICATE_AUTHORITY)) {
revert IssuerNotACertificateAuthority(issuer);
}
if (certificateRevokedBy[certHash] != address(0)) revert CertificateIsRevoked(certHash);
uint64 nonce = _gateNonce[issuer];
_gateNonce[issuer] = nonce + 1;
bytes memory message = abi.encodePacked(
keccak256(
abi.encode(
DOMAIN_ISSUER_CERT_REVOCATION,
block.chainid,
address(this),
issuer,
certHash,
nonce
)
)
);
if (
!FinalChainPrecompiles.verifyMlDsa87(
_activeTransactionKey[issuer], message, proof.mlDsaSignature
)
|| !FinalChainPrecompiles.verifySlhDsa(
_activeAccessKey[issuer], message, proof.slhDsaSignature
)
) revert AdmissionProofInvalid(issuer);
certificateRevokedBy[certHash] = issuer;
emit CertificateRevoked(certHash, issuer);
}
// ---------------------------------------------------------------- views
/// @notice The full identity record. `registered` is the field to branch on.
function identityOf(address account) external view returns (Identity memory) {
return _identity[account];
}
/// @notice `activeTransaction` — ML-DSA-87. What a quorum verifies against.
function activeTransactionKeyOf(address account) external view returns (bytes memory) {
return _activeTransactionKey[account];
}
/// @notice `activeAccess` — SLH-DSA-SHAKE-256s. Identity, and guardianship.
function activeAccessKeyOf(address account) external view returns (bytes memory) {
return _activeAccessKey[account];
}
/// @notice `activeSeal` — SLH-DSA-SHAKE-256s. What `FinalPqQuorum` verifies
/// an execution-class approval's `seal` against. Empty when the identity
/// carries no seal, in which case it cannot take part in a sealed quorum.
function activeSealKeyOf(address account) external view returns (bytes memory) {
return _activeSealKey[account];
}
/// @notice `recoveryTransaction`. Authorizes rotating this account's own
/// credentials and nothing else. Empty for a CA.
function recoveryTransactionKeyOf(address account) external view returns (bytes memory) {
return _recoveryTransactionKey[account];
}
/// @notice `recoveryAccess`. Empty for a CA.
function recoveryAccessKeyOf(address account) external view returns (bytes memory) {
return _recoveryAccessKey[account];
}
/// @notice The four commitments, in the order tree 1's leaf wants them.
/// @dev keccak, not SHA3 — these feed `FinalWalletFactory.accountStateLeafHash`,
/// which every other chain verifies with, and that one hashes with keccak.
function keyCommitments(address account)
external
view
returns (
bytes32 liveAccess,
bytes32 liveTransaction,
bytes32 recoveryAccess,
bytes32 recoveryTransaction
)
{
liveAccess = keccak256(_activeAccessKey[account]);
liveTransaction = keccak256(_activeTransactionKey[account]);
recoveryAccess = keccak256(_recoveryAccessKey[account]);
recoveryTransaction = keccak256(_recoveryTransactionKey[account]);
}
/**
* @notice The tree-8 leaf `account` currently earns: the execution
* chains' identity leaf while the identity stands, zero once it
* does not.
*
* @dev The leaf VALUE is `keccak256(DOMAIN_IDENTITY_LEAF ‖ serial ‖
* keysHash)` — byte-identical to `IdentityRootModule.identityLeafHash`,
* which is also the `certHash` inside the wallet's CREATE2 derivation —
* with `keysHash` folded exactly as the certificate issuer folds it:
* `keccak256(activeAccess ‖ activeTransaction ‖ recoveryAccess ‖
* recoveryTransaction ‖ activeKem ‖ recoveryKem)`, six commitment words
* packed in slot order (`minePqVanityCerts.cjs` is the reference encoder;
* the parity test pins this function against the premined fixtures).
*
* Zero — the empty slot's own value, unprovable as a leaf because no
* certificate hashes to it — for anything that must not admit a wallet
* creation: a revoked identity, one outside its validity window, and any
* CA. The CA exclusion is structural, not a role read: an end entity has
* `depth == maxDelegationDepth` (it issues nothing), a CA never does, and
* the depth pair is immutable per version where roles are not.
*
* Lives HERE rather than on `FinalStateTrees` (whose tree 8 consumes it)
* because every input is this contract's storage and the trees contract
* sits against EIP-170.
*/
function identityTreeLeafOf(address account) external view returns (bytes32) {
Identity storage id = _identity[account];
if (!id.registered) revert UnknownAccount(account);
if (id.revoked || !_withinValidity(id)) return bytes32(0);
if (id.depth != id.maxDelegationDepth) {
// D7 (ruled 2026-09-01): an ISSUER exists in tree 8 under its own
// domain, so its record is stapleable for offline licence
// verification. `certHash` suffices (it covers the whole TBS and
// the verifier holds the cert), `version` makes supersession move
// the leaf, and the third word RESERVES the issuer's own
// certificate-tree anchor — zero until wired. The distinct domain
// does the wallet-admission exclusion the zero projection used to
// do; zero-on-revoke above is now load-bearing for both record
// kinds (a fresh staple is an unrevoked statement).
return keccak256(
abi.encodePacked(DOMAIN_ISSUER_LEAF, id.certHash, uint64(id.version), bytes32(0))
);
}
bytes32 liveKem = keccak256(
abi.encodePacked(DOMAIN_KEM_BUNDLE, _activeKemMlKem[account], _activeKemHqc[account]));
bytes32 recoveryKem = keccak256(
abi.encodePacked(DOMAIN_KEM_BUNDLE, _recoveryKemMlKem[account], _recoveryKemHqc[account]));
bytes32 keysHash = keccak256(
abi.encodePacked(
keccak256(_activeAccessKey[account]),
keccak256(_activeTransactionKey[account]),
keccak256(_recoveryAccessKey[account]),
keccak256(_recoveryTransactionKey[account]),
liveKem,
recoveryKem
)
);
return keccak256(abi.encodePacked(DOMAIN_IDENTITY_LEAF, id.serial, keysHash));
}
/// @notice Per-stage encapsulation commitments, in `AccountStateLeaf` order.
/// @dev One word per STAGE, over both of that stage's KEM public keys. The
/// pair is the unit — an account holds both or neither — so committing them
/// separately would model a state the protocol does not recognise, and every
/// downstream record would carry two words where one says the same thing.
///
/// An account registered before the encapsulation slots existed hashes the
/// empty string here rather than reverting: `syncIdentities` must keep
/// projecting it, and a leaf that cannot be built is a party that cannot be
/// revoked.
function kemCommitments(address account)
external
view
returns (bytes32 liveKem, bytes32 recoveryKem)
{
liveKem = keccak256(
abi.encodePacked(DOMAIN_KEM_BUNDLE, _activeKemMlKem[account], _activeKemHqc[account]));
recoveryKem = keccak256(
abi.encodePacked(DOMAIN_KEM_BUNDLE, _recoveryKemMlKem[account], _recoveryKemHqc[account]));
}
/// @notice The encapsulation keys themselves, for a party composing a message.
function kemKeysOf(address account)
external
view
returns (bytes memory activeMlKem, bytes memory activeHqc)
{
return (_activeKemMlKem[account], _activeKemHqc[account]);
}
// ------------------------------------------------------------- senders
/**
* @notice The Final Chain sender a transaction key produces.
* @dev `keccak256(uint8(4) ‖ publicKey)[12:]` — byte-identical to what the
* node derives from a type-0x46 envelope and to the backend's
* `pqTransaction.senderOf`. Pure, so a client can compute it from a
* certificate before the identity is registered.
*/
function senderFor(bytes memory transactionKey) public pure returns (address) {
return address(uint160(uint256(keccak256(abi.encodePacked(ENVELOPE_ALG_ML_DSA_87, transactionKey)))));
}
/// @notice The sender `account`'s transactions arrive from, or zero for an
/// account with no transaction key on record.
function senderOf(address account) external view returns (address) {
bytes storage key = _activeTransactionKey[account];
if (key.length == 0) return address(0);
return senderFor(key);
}
/// @notice `hasRole` for a `msg.sender`: resolves the sender to its identity
/// first. False for a sender no identity claims.
function senderHasRole(address sender, uint256 roleMask) external view returns (bool) {
address account = accountOfSender[sender];
return account != address(0) && hasRole(account, roleMask);
}
/// @notice How many accounts carrying `roleMask` also hold a seal key —
/// the members that can take part in a sealed quorum.
function sealableMemberCount(uint256 roleMask) public view returns (uint256 sealable) {
uint256 n = _accounts.length;
for (uint256 i = 0; i < n; i++) {
address a = _accounts[i];
if (hasRole(a, roleMask) && _activeSealKey[a].length != 0) sealable++;
}
}
/// @notice Number of registered accounts.
function accountCount() external view returns (uint256) {
return _accounts.length;
}
/// @notice Registered account by index, in registration order.
function accountAt(uint256 index) external view returns (address) {
return _accounts[index];
}
/// @notice Every account carrying every bit in `roleMask`.
/// @dev A view, so the O(n) scan costs nothing. Callers that need this in a
/// transaction should pass the member list explicitly instead — see
/// `FinalPqQuorum`, which takes signers rather than searching for them.
function accountsWithRole(uint256 roleMask) external view returns (address[] memory found) {
uint256 n = _accounts.length;
address[] memory buf = new address[](n);
uint256 count;
for (uint256 i = 0; i < n; i++) {
if (hasRole(_accounts[i], roleMask)) {
buf[count++] = _accounts[i];
}
}
found = new address[](count);
for (uint256 i = 0; i < count; i++) {
found[i] = buf[i];
}
}
/**
* @notice How many accounts could satisfy a quorum for `roleMask` right now.
* @dev The number a threshold has to be reachable against. A threshold above
* it is not a strict quorum, it is a quorum that cannot be met — and the way
* that presents is an operation that reverts forever with nothing naming the
* roster as the cause.
*/
function liveMemberCount(uint256 roleMask) public view returns (uint256 live) {
uint256 n = _accounts.length;
for (uint256 i = 0; i < n; i++) {
if (hasRole(_accounts[i], roleMask)) live++;
}
}
/**
* @notice Whether `account` currently carries every bit in `roleMask`.
* @dev Every gate in this system asks this one question, so every gate gets
* the same answer: registered, not revoked, inside its validity window, and
* holding the capability. A caller that checked only the role bit would
* accept an expired certificate.
*
* `roleMask == 0` is false. A zero mask asks nothing and must not read as
* "yes" — that is the shape of an uninitialised configuration variable, and
* the one reading it should not be a universal pass.
*/
function hasRole(address account, uint256 roleMask) public view returns (bool) {
if (roleMask == 0) return false;
Identity storage id = _identity[account];
if (!id.registered || id.revoked) return false;
if (id.roles & roleMask != roleMask) return false;
return _withinValidity(id);
}
/// @notice Whether `account` is registered, unrevoked and in date,
/// regardless of capability.
function isActive(address account) public view returns (bool) {
Identity storage id = _identity[account];
return id.registered && !id.revoked && _withinValidity(id);
}
function _withinValidity(Identity storage id) private view returns (bool) {
if (id.notBefore != 0 && FinalChainTime.nowMs() < id.notBefore) return false;
if (id.notAfter != 0 && FinalChainTime.nowMs() >= id.notAfter) return false;
return true;
}
}
contracts/finalchain/FinalIntentLog.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;
import {FinalChainPrecompiles} from "./FinalChainPrecompiles.sol";
import {FinalChainTime} from "./FinalChainTime.sol";
import {FinalIdentityRegistry} from "./FinalIdentityRegistry.sol";
import {FinalPqQuorum} from "./FinalPqQuorum.sol";
import {FinalStateTrees} from "./FinalStateTrees.sol";
/**
* @title FinalIntentLog
* @notice Every intent is posted here before it may be anchored. Ordering is
* block order.
*
* @dev ## Why this is a log and not a tree
*
* Final Chain carries six trees, and they publish in ROUNDS — every root
* together, one version bump each. That structure is for state that changes
* slowly and must be proven elsewhere. An intent is neither: it is high
* cadence, it lives 180 seconds, and putting it in a round-published tree would
* bump a version on every transaction and age every outstanding proof — the
* same objection that kept a liveness timestamp out of the tree-1 account leaf.
*
* It is not an MMR either. `FinalBundleLog`'s payload already IS the bundle's
* intent-Merkle root, so a second append-only log over the same leaves would
* prove, one level earlier, a fact the bundle anchor already proves.
*
* What an intent actually needs is ordering, public availability, and a
* presence check the anchoring quorum can run objectively. Block order gives
* the first, calldata gives the second, and a mapping gives the third. That is
* the whole contract.
*
* ## What it buys
*
* `FinalBundleLog.append` consumes from here, so a bundle cannot be anchored
* unless every intent in it was posted first — and the execution chains'
* authorization is that anchor. Final-Chain-first admission stops being a
* quorum policy and becomes bytecode. Replay protection falls out of the same
* mapping: a leaf is consumed exactly once, ever.
*
* For the user it closes substitution. The intent they composed is ordered
* publicly before anything executes, so a relayer or a frontend cannot swap it
* for another — the anchor will only carry what this log holds.
*
* ## The body is encrypted and this contract cannot read it
*
* `header` is routing metadata: a chain reference, a deadline, KEM ciphertexts,
* a commitment to the body, and the intent leaf. Account, destination, fee and
* calldata are all inside `ciphertext`. That is what closes content-based
* front-running — an operator watching this log sees a chain id and a deadline
* and cannot build a profitable order from either.
*
* There is deliberately no decryption path on chain and no AEAD precompile. The
* chain checks a hash and nothing else.
*
* ## The envelope is STORED, not left in the event log
*
* A two-KEM envelope is ~16 KB and keeping it in state is not free. It is kept
* anyway, for the reason `FinalBundleLog` keeps its payloads: this chain caps a
* `getLogs` range at 100,000 blocks and mints one every 100 ms, so the log is
* reachable for **2.8 hours**. A forced-path intent lives **48**.
*
* An event-only envelope would therefore be unreadable long before it expired —
* precisely for the guardians who are meant to review a forced intent, and
* precisely in the window the forced path exists to cover. That is not a
* degraded read, it is the escape hatch not working.
*
* So the event is for DISCOVERY and carries no bytes; state is for retrieval,
* over one `eth_call` and no range. Emitting the envelope as well would be
* ~128k gas of duplication for data the same transaction already stored.
*
* Measured in `FinalIntentLog.t.sol`: **11,517,049 gas** for a 16,426-byte
* envelope, which at a 60M block gas limit is **5 intents per block** — 50 a
* second at 100 ms. That is the throughput ceiling on this path, and it is
* dominated by HQC-5's 14,421-byte ciphertext.
*
* Two levers if it ever binds. SSTORE2-style data contracts are ~3x cheaper per
* byte, and would need chunking because a two-recipient envelope exceeds
* EIP-170's 24,576. Pruning consumed envelopes is the other, and it trades the
* record for the space — a decision, not a cleanup.
*
* **The bond becomes load-bearing when the RPC opens, not before.** Posting is
* permissionless in this contract and the base fee is 1 wei, so the only thing
* standing between an attacker and 60M gas a block of permanent state is that
* Final Chain's RPC is fronted by a default-deny Cloud Armor allowlist and
* reaches operators only. That is a perimeter, not a mechanism, and it is the
* one that has to be removed for users to post their own intents. Nothing here
* rate-limits; the bond is what is supposed to, and this is why it cannot ship
* after the RPC does.
*
* ## Approve and cancel, without naming an account
*
* An approval-gated intent executes only after a second on-chain act, made
* after the user decrypts the posted envelope and reads what the CHAIN holds —
* the read-back that closes execution of what the user has not seen. Who may
* approve is a **per-intent, wallet-generated ML-DSA-87 key**, committed in the
* plaintext header: the commitment names a key, never an account, which is what
* answers "a per-intent veto has to say who may veto, and the account is
* encrypted". A substituted commitment strands the intent — the execution
* signature bound into the leaf still authorizes every field — and cancel is
* the same key, any time before consumption.
*
* `approve` also DELIVERS the executor section: the content key and the
* account's KEM public keys, sealed to the executor set. Before approval the
* executor holds ciphertext it cannot open; that is cryptography, not policy.
* An AUTO_APPROVE posting (header flag, bit 0) skips the gate for automation
* and scheduling and carries its executor section at posting — flipping the
* flag skips the second look and can never change what executes.
*
* The account-wide veto stays `FinalAccountLedger`'s freeze; auto-approved
* intents have no per-intent cancel because they commit to no approval key.
*
* ## Tree 7 is the search structure; the MMR is the record
*
* Every transition — posted, approved, cancelled, consumed — is mirrored into
* `FinalStateTrees.TREE_INTENTS` through `treeWriter[7]`, keyed by a RING over
* the posting sequence (`seq mod 2^20`), so slots recycle and the tree is an
* index with a ~1M-posting retention window rather than a permanent record.
* Backends enumerate it instead of scanning logs; proofs against it are proofs
* about the current window.
*/
contract FinalIntentLog {
/// @notice Where roles are resolved. Immutable.
///
/// @dev The only thing this log needs a registry for is authorizing
/// `setConsumer`, and that could have been a deployer check. It is the
/// registry instead so the wiring falls under the SAME bootstrap window
/// as `FinalStateTrees.setTreeWriter` and `FinalBundleLog.configure` —
/// one rule for who may wire Final Chain together, rather than three.
FinalIdentityRegistry public immutable registry;
/// @notice Where every status transition is mirrored (tree 7). Immutable:
/// a movable index would be an index whose history can be swapped.
FinalStateTrees public immutable trees;
/// @dev Header layout, fixed offsets. Must match `encodeHeader` in
/// `FinalBackend/src/intents/intentEnvelope.js` — the cross-repo parity
/// suite pins it. Length-prefixed and canonical precisely so these
/// offsets exist: a JSON header would have no stable position to read.
///
/// 0 version uint8 = 2 | 3 (v3 salts recipientsHash; offsets identical)
/// 1 flags uint8 bit0 AUTO_APPROVE; rest zero
/// 2..33 targetChainRef bytes32
/// 34..41 executeNotBefore uint64 ms; 0 = immediate
/// 42..49 deadline uint64 ms
/// 50..81 bodyCommitment bytes32
/// 82..113 intentLeaf bytes32
/// 114..145 approvalKeyCommit bytes32 zero iff AUTO_APPROVE
/// 146..147 kemSet uint16
/// 148..149 kemKeyVersion uint16
/// 150..181 recipientsHash bytes32
/// 182.. recipients, executorSection, bond
uint256 private constant OFF_FLAGS = 1;
uint256 private constant OFF_TARGET_CHAIN_REF = 2;
uint256 private constant OFF_EXECUTE_NOT_BEFORE = 34;
uint256 private constant OFF_DEADLINE = 42;
uint256 private constant OFF_BODY_COMMITMENT = 50;
uint256 private constant OFF_INTENT_LEAF = 82;
uint256 private constant OFF_APPROVAL_KEY_COMMIT = 114;
/// @dev The whole fixed prefix, including `recipientsHash` — which this
/// contract never reads. Requiring it anyway is the cheap half of
/// "well-formed": a header truncated after the leaf would parse
/// perfectly here and then fail to decrypt for its recipient. The
/// contract reads nothing past offset 145.
uint256 private constant HEADER_MIN_BYTES = 182;
/// @notice The oldest envelope wire version this contract reads.
uint8 public constant HEADER_VERSION = 2;
/// @notice The newest. v3 (B6) keeps every offset and salts `recipientsHash`
/// — a field this contract never reads — with a holder-derived value,
/// so a wallet's postings stop sharing a fingerprint in the clear.
/// Both versions parse identically here; the header's own AAD is what
/// tells them apart for the recipients.
uint8 public constant HEADER_VERSION_MAX = 3;
/// @notice Header flag bit 0: skip the approval gate.
/// @dev Poster-controlled routing, honestly scoped: flipping it skips the
/// user's second look and can never change what executes — the user's own
/// signature over the intent fields, bound into the leaf, remains the only
/// execution authorization.
uint8 public constant FLAG_AUTO_APPROVE = 0x01;
// ---------------------------------------------------- approval domains
/// @dev Distinct per action, so an approval can never be replayed as a
/// cancellation or vice versa. Both digests bind this chain and this log.
bytes32 public constant DOMAIN_INTENT_APPROVE = keccak256("FINAL_INTENT_APPROVE_v01");
bytes32 public constant DOMAIN_INTENT_CANCEL = keccak256("FINAL_INTENT_CANCEL_v01");
// ------------------------------------------------------ tree-7 mirror
/// @dev The ring key's domain. Named in `FinalStateTrees`' key.* family
/// because that is the space it lives in; computed HERE because the log is
/// the writer and the backend mirrors this function, not the tree.
bytes32 public constant DOMAIN_INTENT_KEY = keccak256("FinalStateTrees.key.intent.v01");
/// @dev The status leaf's domain.
bytes32 public constant DOMAIN_INTENT_STATUS_LEAF = keccak256("FINAL_INTENT_STATUS_LEAF_v01");
/// @notice Ring size: keys recycle at `CAPACITY`, so the tree can never
/// fill however long the chain runs. Pinned equal to
/// `FinalStateTrees.CAPACITY` by test.
uint64 public constant INTENT_SLOT_RING = uint64(1) << 20;
/// @notice The tree this log writes. Restated from `FinalStateTrees`
/// because a contract-type constant is not reachable here; pinned equal to
/// `trees.TREE_INTENTS()` by test.
uint8 public constant TREE_INTENTS_ID = 7;
/// @notice The branch the intent ring lives in — `FinalStateTrees.BRANCH_MAIN`,
/// pinned by test. Branch 0 of tree 7 is the log's configuration.
uint8 public constant BRANCH_MAIN_ID = 1;
/// @notice Tree-7 status values.
uint8 public constant STATUS_POSTED = 1;
uint8 public constant STATUS_APPROVED = 2;
uint8 public constant STATUS_CONSUMED = 3;
uint8 public constant STATUS_CANCELLED = 4;
/// @dev Registrar-quorum actions, verified by the registry with this log as
/// the verifying contract.
bytes32 public constant ACTION_SET_CONSUMER = keccak256("FINAL_INTENT_LOG_SET_CONSUMER_v01");
bytes32 public constant ACTION_SEED_SEQUENCE = keccak256("FINAL_INTENT_LOG_SEED_SEQUENCE_v01");
bytes32 public constant ACTION_SET_BOND_POLICY = keccak256("FINAL_INTENT_LOG_SET_BOND_POLICY_v01");
/**
* @notice The longest an intent may stay consumable past its earliest
* execution moment.
*
* @dev A cap rather than an exact value because every lane shares this log,
* and an uncapped deadline would let a posting sit consumable forever —
* which is a replay window dressed as a long-lived intent. An immediate
* intent (`executeNotBefore == 0`) gets exactly this from `now`; a
* scheduled one gets it from its own start.
*/
/// @dev MILLISECONDS, like every duration on this chain. Its predecessor
/// was once 48 hours read against a millisecond clock — 48 SECONDS —
/// so a header whose deadline a client computed from wall time was
/// refused before it could ever be posted.
uint64 public constant EXECUTION_WINDOW = 48 hours * FinalChainTime.MS_PER_SECOND;
/// @notice How far ahead `executeNotBefore` may sit. The scheduling
/// horizon: chosen at signing, because the deadline is inside the signed
/// intent and cannot be extended afterwards.
uint64 public constant MAX_SCHEDULE_HORIZON = 30 days * FinalChainTime.MS_PER_SECOND;
/// @notice How far ahead of `executeNotBefore` a scheduled posting may be
/// CONSUMED when its target chain has no lead of its own (W1, ruled
/// 2026-09-03: 90 seconds, per target chain). Admission — the
/// co-signer round and the append that consumes the leaf — runs
/// before T, so the fleet can compose and broadcast the wrapper to
/// land in the first target-chain block at or after T rather than
/// minutes late. The holder's veto (`cancel`) closes at consume,
/// i.e. no earlier than T − lead: the lead is the last call for a
/// cancel. An immediate posting (`executeNotBefore == 0`) has no
/// lead. Per chain: a row in tree 7's CONFIGURATION branch
/// (`FinalStateTrees.setConfig`, key `configKey(CONFIG_SCHEDULE_LEAD_MS,
/// targetChainRef)`) overrides this default (`scheduleLeadMsOf`),
/// explicit zero included — the first tenant of the config branch.
uint64 public constant DEFAULT_SCHEDULE_LEAD_MS = 90 * FinalChainTime.MS_PER_SECOND;
/// @notice The config-row NAME of a target chain's schedule lead, in
/// milliseconds: `trees.configKey(CONFIG_SCHEDULE_LEAD_MS, targetChainRef)`
/// → one word holding the lead. Written under the configuration
/// authority (bootstrap admin, then the registrar quorum) — an
/// operational parameter, not a trust boundary — and PROVABLE like
/// every other row of the plane, which a table here was not.
bytes32 public constant CONFIG_SCHEDULE_LEAD_MS = keccak256("FinalIntentLog.config.scheduleLeadMs.v01");
struct Posted {
/// @dev Zero means never posted. Non-zero and `consumedAt == 0` means open.
uint64 postedAt;
/// @dev From the header, in MILLISECONDS. Before this, `consume` refuses.
uint64 executeNotBefore;
/// @dev From the header, in MILLISECONDS. After this, `consume` refuses.
uint64 deadline;
/// @dev Block timestamp of the anchoring append. Non-zero means spent.
uint64 consumedAt;
/// @dev `keccak256(body)` — the leaf↔body binding. With the reveal
/// schema gone it is checked OFF-chain: the execution chain's
/// public calldata against this word.
bytes32 bodyCommitment;
/// @dev `keccak256` of the per-intent approval public key; zero iff
/// AUTO_APPROVE. Names a key, never an account.
bytes32 approvalKeyCommit;
/// @dev From the header; kept for the tree-7 status leaf.
bytes32 targetChainRef;
/// @dev When `approve` verified. Non-zero means approved.
uint64 approvedAt;
/// @dev When `cancel` verified. Non-zero means dead: `consume` refuses.
uint64 cancelledAt;
/// @dev Posting sequence — the tree-7 ring position (`seq mod 2^20`).
uint64 seq;
/// @dev Header flags, verbatim.
uint8 flags;
}
/// @dev The bytes, kept apart from `Posted` on purpose. `consume` runs on
/// the anchoring path and reads only the packed record; it must never
/// pay to walk 16 KB it does not look at.
struct Envelope {
/// @dev Canonical header, exactly as posted.
bytes header;
/// @dev The sealed body. This contract cannot read it and never tries.
bytes ciphertext;
/// @dev The content key and the account's KEM public keys, sealed to
/// the executor set. Delivered by `approve` — so before approval
/// the executor holds ciphertext it cannot open — or present from
/// posting on an AUTO_APPROVE intent. Opaque here: this contract
/// stores it and never parses it.
bytes executorSection;
}
/// @notice Keyed by the intent LEAF, not by an envelope id.
///
/// @dev The leaf is what `FinalBundleLog` folds and what the execution
/// chain's gateway recomputes, so keying on it makes the presence check
/// exact. It also makes duplicate protection land on the right thing: a
/// second header carrying a leaf already posted is the same intent
/// offered twice, and is refused.
mapping(bytes32 leaf => Posted) public postedOf;
/// @notice The full envelope, retrievable for as long as the chain exists.
mapping(bytes32 leaf => Envelope) private _envelopeOf;
/// @notice Postings ever made. The next intent takes this as its `seq`.
uint64 public postSeq;
/// @notice The leaf posted at sequence `seq` — the enumeration the backend
/// walks (`postSeq` is the count) instead of a `getLogs` range.
mapping(uint64 => bytes32) public leafAt;
// ─────────────────────────── the per-vertex bond ───────────────────────────
//
// **Encrypting the account removes attribution, and attribution is what
// rate-limiting runs on.** Posting is permissionless at a 1 wei base fee and
// state spam does not age out the way calldata spam does, so the thing
// holding it off today is the default-deny allowlist on this chain's RPC —
// a perimeter, and precisely the one that has to come down for users to post
// their own intents. A bond charges the spammer regardless of identity,
// needs no new cryptography, and is the natural unit for operators paid per
// unit of work.
//
// Refunded on valid execution, forfeited on a vertex that was never
// anchored. Both are PULL: `consume` runs inside the anchoring append and
// must not be able to fail, or be delayed, because of where a refund was
// going.
//
// **Not in the header.** The header's `<authenticator>` field stays a
// free-form reference for off-chain accounting and is deliberately not the
// bond itself. Moving the bond into the header would be an encoding change
// rippling through every reader and the cross-repo offset parity, and a
// bond is not worth one when native value keyed by leaf says the same
// thing.
//
// **Zero is the shipped state**, which is today's behaviour exactly. Arming
// it is the step that must precede opening the RPC, not follow it.
struct Bond {
/// @dev Who paid, and who a refund goes back to. Not the intent's
/// account — that is encrypted and this contract cannot know it — which
/// is the whole reason a bond works here and a per-account quota does
/// not.
address payer;
/// @dev Wei paid. Stored rather than re-read from `bondWei`, because the
/// rate can move between posting and settlement and a refund of
/// something other than what was paid is a fee nobody agreed to.
/// `uint88` covers 309 million ether and packs the struct into one slot.
uint88 amount;
/// @dev Paid out or forfeited. Set before the transfer.
bool settled;
}
/// @notice The bond posted with each intent, if any.
mapping(bytes32 leaf => Bond) public bondOf;
/// @notice What `post` requires. Zero disables the bond entirely.
uint256 public bondWei;
/// @notice Where a forfeited bond goes.
/// @dev Zero means BURN — the value stays in this contract and nothing can
/// move it. That is the safe default rather than an oversight: a forfeit
/// destination is a revenue stream, and one set by accident is worse than
/// one that does not exist. Arming a bond without naming a destination is
/// refused, so this can never be reached by forgetting.
address public bondForfeitTo;
/// @notice The bond rate, or its destination, changed.
event BondPolicySet(uint256 bondWei, address forfeitTo);
/// @notice A bond was posted alongside an intent.
event BondPosted(bytes32 indexed leaf, address indexed payer, uint256 amount);
/// @notice A bond was returned after the intent was anchored.
event BondRefunded(bytes32 indexed leaf, address indexed payer, uint256 amount);
/// @notice A bond was forfeited: the intent expired without being anchored.
event BondForfeited(bytes32 indexed leaf, address indexed payer, uint256 amount);
error BondMismatch(uint256 required, uint256 supplied);
error NoBond(bytes32 leaf);
error BondAlreadySettled(bytes32 leaf);
error BondNotRefundable(bytes32 leaf);
error BondNotForfeitable(bytes32 leaf, uint64 deadline);
error BondTransferFailed(address to, uint256 amount);
error BondNeedsAForfeitDestination();
/// @notice The one contract allowed to consume. Set once.
address public consumer;
/// @notice Discovery only. The envelope itself is in state — read it with
/// `envelopeOf`, which needs no `getLogs` range.
event IntentPosted(
bytes32 indexed leaf,
bytes32 indexed targetChainRef,
uint64 executeNotBefore,
uint64 deadline,
uint8 flags,
uint256 headerBytes,
uint256 ciphertextBytes
);
/// @notice The user read the posted intent back and approved it. Carries
/// the executor section's size — the bytes that let the executor
/// decrypt from here on.
event IntentApproved(bytes32 indexed leaf, uint256 executorSectionBytes);
/// @notice The approval key revoked the intent. Terminal.
event IntentCancelled(bytes32 indexed leaf);
/// @notice Consumed by an anchoring append.
event IntentConsumed(bytes32 indexed leaf, address indexed by);
event ConsumerSet(address indexed consumer);
/// @notice A target chain's schedule lead was configured (W1).
error HeaderTooShort(uint256 length);
error UnsupportedHeaderVersion(uint8 version);
error DeadlinePassed(uint64 deadline, uint64 nowMs);
error DeadlineTooFar(uint64 deadline, uint64 limit);
error ZeroLeaf();
error AlreadyPosted(bytes32 leaf);
error NotPosted(bytes32 leaf);
error AlreadyConsumed(bytes32 leaf, uint64 at);
error Expired(bytes32 leaf, uint64 deadline);
/// @notice Header flag bits beyond the ones this version defines.
error UnsupportedFlags(uint8 flags);
/// @notice An AUTO_APPROVE header must commit to no approval key.
error AutoApproveTakesNoCommitment(bytes32 approvalKeyCommit);
/// @notice An approval-gated header must commit to one.
error ApprovalKeyCommitRequired();
/// @notice `executeNotBefore` sits beyond the scheduling horizon.
error ScheduleTooFar(uint64 executeNotBefore, uint64 limit);
/// @notice The presented key does not hash to the header's commitment.
error WrongApprovalKey(bytes32 expected, bytes32 got);
/// @notice The signature did not verify under the committed key.
error ApprovalSignatureInvalid(bytes32 leaf);
error AlreadyApproved(bytes32 leaf, uint64 at);
/// @notice AUTO_APPROVE intents commit to no key: nothing to approve or
/// cancel per-intent. Their veto is the account-wide freeze.
error NoApprovalKey(bytes32 leaf);
error IntentIsCancelled(bytes32 leaf, uint64 at);
/// @notice `executeNotBefore` has not arrived. Scheduling is a chain rule.
error TooEarly(bytes32 leaf, uint64 executeNotBefore, uint64 nowMs);
/// @notice Neither approved nor AUTO_APPROVE: the user has not read it back.
error NotApproved(bytes32 leaf);
error NotConsumer(address caller);
error ConsumerUnset();
error ConsumerAlreadySet(address current);
error ZeroConsumer();
error NotAuthorized(address caller);
/**
* @dev No precompile of its own to call — this contract verifies no
* signature and reads no PQ key, it hashes and compares. The probe is
* still here because the claim "these deploy to Final Chain and nowhere
* else" should be enforced rather than documented, and a posting log on
* an execution chain would be a place intents could be posted that no
* anchor will ever read.
*/
constructor(FinalIdentityRegistry registry_, FinalStateTrees trees_) {
FinalChainPrecompiles.assertAvailable();
registry = registry_;
trees = trees_;
}
/// @notice A fresh log took over the previous log's sequence.
event SequenceSeeded(uint64 postSeq);
/// @notice The sequence can be seeded only into a log that holds nothing.
error NotFresh();
/**
* @notice Take over the previous log's `postSeq`, so every walker's cursor
* (`postSeq` is the count; the fleet walks it, never a `getLogs`
* range) stays ahead of nothing and behind everything new. Slots
* below the seed are the old log's. NO-WIPE redeploy, ruled
* 2026-09-03. Configuration authority; only while empty.
*/
function seedSequence(
uint64 postSeq_,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SEED_SEQUENCE, keccak256(abi.encode(postSeq_)), anchorBlock, approvals
);
if (postSeq != 0) revert NotFresh();
postSeq = postSeq_;
emit SequenceSeeded(postSeq_);
}
/**
* @dev The configuration gate: the registry's bootstrap admin alone while
* its window is open, the sealed `ROLE_REGISTRAR` quorum afterwards — the
* same window and quorum the registry and the trees use. `approvals` is
* empty during bootstrap.
*/
function _requireConfigurationAuthority(
bytes32 actionDomain,
bytes32 payloadDigest,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) private {
if (!registry.bootstrapSealed() && msg.sender == registry.bootstrapAdmin()) return;
registry.requireRegistrarQuorum(actionDomain, payloadDigest, anchorBlock, approvals);
}
/**
* @notice Name the contract allowed to consume postings.
*
* @dev One-way and one-shot, like `FinalStateTrees.treeWriter`. Deployment
* is circular — the bundle log needs this address in its constructor —
* so this is set afterwards, and it can never be moved: a consumer that
* could be repointed would be a consumer that could be replaced with
* one that does not check.
*
* Authorized, and it has to be. Left open it would be a front-run away
* from permanent: an attacker naming their own contract first would
* brick the PQ lane with no recovery, because one-shot cuts both ways.
*/
function setConsumer(
address newConsumer,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_CONSUMER, keccak256(abi.encode(newConsumer)), anchorBlock, approvals
);
if (consumer != address(0)) revert ConsumerAlreadySet(consumer);
if (newConsumer == address(0)) revert ZeroConsumer();
consumer = newConsumer;
emit ConsumerSet(newConsumer);
}
/// @notice The lead a scheduled posting for `targetChainRef` gets: the
/// config-branch row when one exists (explicit zero included),
/// else `DEFAULT_SCHEDULE_LEAD_MS`. Capped at the schedule horizon:
/// a longer lead would make every scheduled posting consumable at
/// post time. The fleet reads this so the watch and the contract
/// agree on when an attempt may begin.
function scheduleLeadMsOf(bytes32 targetChainRef) public view returns (uint64) {
(bytes32 value, bool present) =
trees.configValue(TREE_INTENTS_ID, trees.configKey(CONFIG_SCHEDULE_LEAD_MS, targetChainRef));
if (!present) return DEFAULT_SCHEDULE_LEAD_MS;
uint256 lead = uint256(value);
return lead > MAX_SCHEDULE_HORIZON ? MAX_SCHEDULE_HORIZON : uint64(lead);
}
/**
* @notice Post an intent. Permissionless.
*
* @dev Permissionless on purpose. Gating posting on an identity would
* reintroduce exactly the attribution the encryption removes, so what
* bounds a spammer is the BOND rather than a quota: `msg.value` must
* equal `bondWei`, and it comes back only if the intent is anchored.
*
* While `bondWei` is zero — the shipped state — this is what it has
* always been, and `msg.value` must then be zero too. Accepting a
* payment the contract has no rule for would be accepting value it
* cannot refund.
*
* @param header Canonical envelope header. Parsed, never stored.
* @param ciphertext The sealed body. Emitted, never stored, never read.
* @return leaf The intent leaf this posting is keyed on.
*/
function post(bytes calldata header, bytes calldata ciphertext)
external
payable
returns (bytes32 leaf)
{
if (header.length < HEADER_MIN_BYTES) revert HeaderTooShort(header.length);
uint8 version = uint8(header[0]);
if (version < HEADER_VERSION || version > HEADER_VERSION_MAX) {
revert UnsupportedHeaderVersion(version);
}
uint8 flags = uint8(header[OFF_FLAGS]);
if (flags & ~FLAG_AUTO_APPROVE != 0) revert UnsupportedFlags(flags);
bytes32 targetChainRef = bytes32(header[OFF_TARGET_CHAIN_REF:OFF_TARGET_CHAIN_REF + 32]);
uint64 executeNotBefore =
uint64(bytes8(header[OFF_EXECUTE_NOT_BEFORE:OFF_EXECUTE_NOT_BEFORE + 8]));
uint64 deadline = uint64(bytes8(header[OFF_DEADLINE:OFF_DEADLINE + 8]));
bytes32 bodyCommitment = bytes32(header[OFF_BODY_COMMITMENT:OFF_BODY_COMMITMENT + 32]);
leaf = bytes32(header[OFF_INTENT_LEAF:OFF_INTENT_LEAF + 32]);
bytes32 approvalKeyCommit =
bytes32(header[OFF_APPROVAL_KEY_COMMIT:OFF_APPROVAL_KEY_COMMIT + 32]);
// The commitment and the flag are one decision stated twice, so the two
// must agree: an auto intent with a commitment would look cancellable
// and not be gated, and a gated one without a commitment could never be
// approved by anyone — dead on arrival, wearing a live intent's shape.
bool auto_ = flags & FLAG_AUTO_APPROVE != 0;
if (auto_ && approvalKeyCommit != bytes32(0)) {
revert AutoApproveTakesNoCommitment(approvalKeyCommit);
}
if (!auto_ && approvalKeyCommit == bytes32(0)) revert ApprovalKeyCommitRequired();
if (leaf == bytes32(0)) revert ZeroLeaf();
if (postedOf[leaf].postedAt != 0) revert AlreadyPosted(leaf);
// Scheduling is a contract rule. An immediate intent gets the window
// from now; a scheduled one gets it from its own start, and the start
// itself is bounded by the horizon — chosen at signing, because the
// deadline is inside the signed intent and cannot be extended after.
uint64 nowMs = FinalChainTime.nowMs();
if (deadline <= nowMs) revert DeadlinePassed(deadline, nowMs);
if (executeNotBefore == 0) {
uint64 limit = nowMs + EXECUTION_WINDOW;
if (deadline > limit) revert DeadlineTooFar(deadline, limit);
} else {
uint64 horizon = nowMs + MAX_SCHEDULE_HORIZON;
if (executeNotBefore > horizon) revert ScheduleTooFar(executeNotBefore, horizon);
uint64 limit = executeNotBefore + EXECUTION_WINDOW;
if (deadline > limit) revert DeadlineTooFar(deadline, limit);
}
// The bond scales with lifetime. A month-long posting occupies state
// and attention a 48-hour one does not, and a flat bond makes
// long-lived spam the cheap kind. Ceiling division, so a single extra
// millisecond of a new window costs a whole unit.
uint256 required = bondWei;
if (required != 0) {
required = required
* ((uint256(deadline) - nowMs + EXECUTION_WINDOW - 1) / EXECUTION_WINDOW);
}
if (required > type(uint88).max) revert BondMismatch(type(uint88).max, required);
if (msg.value != required) revert BondMismatch(required, msg.value);
uint64 seq = postSeq;
postSeq = seq + 1;
leafAt[seq] = leaf;
postedOf[leaf] = Posted({
postedAt: nowMs,
executeNotBefore: executeNotBefore,
deadline: deadline,
consumedAt: 0,
bodyCommitment: bodyCommitment,
approvalKeyCommit: approvalKeyCommit,
targetChainRef: targetChainRef,
approvedAt: 0,
cancelledAt: 0,
seq: seq,
flags: flags
});
_envelopeOf[leaf] = Envelope({header: header, ciphertext: ciphertext, executorSection: ""});
if (required != 0) {
bondOf[leaf] = Bond({payer: msg.sender, amount: uint88(required), settled: false});
emit BondPosted(leaf, msg.sender, required);
}
_writeStatus(leaf, postedOf[leaf], STATUS_POSTED);
emit IntentPosted(
leaf, targetChainRef, executeNotBefore, deadline, flags, header.length, ciphertext.length
);
}
/**
* @notice Set the bond rate and where a forfeit goes.
*
* @dev Same gate as `setConsumer`, and unlike it this is NOT one-shot: a
* bond is a price and a price that could never move would be a parameter
* chosen once, before the traffic it is meant to bound existed.
*
* Arming a non-zero bond without a forfeit destination is refused. Zero
* means burn, which is a real choice — but it has to be made rather than
* arrived at by leaving a field unset, because the difference is an
* accumulating balance nobody can ever move.
*
* Changing the rate does not touch bonds already posted. Each stores what
* was actually paid, so a rate rise cannot retroactively underpay a refund
* and a cut cannot leave one over-funded.
*/
function setBondPolicy(
uint256 newBondWei,
address forfeitTo,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_BOND_POLICY, keccak256(abi.encode(newBondWei, forfeitTo)), anchorBlock, approvals
);
if (newBondWei != 0 && forfeitTo == address(0)) {
// Only when ARMING. Setting the rate back to zero with no
// destination is disarming, which needs no destination.
revert BondNeedsAForfeitDestination();
}
if (newBondWei > type(uint88).max) revert BondMismatch(type(uint88).max, newBondWei);
bondWei = newBondWei;
bondForfeitTo = forfeitTo;
emit BondPolicySet(newBondWei, forfeitTo);
}
/**
* @notice Return a bond whose intent was anchored.
*
* @dev Permissionless to CALL and fixed in destination: the money goes to
* the recorded payer whoever asks. That is what lets a relayer sweep on a
* user's behalf without being able to redirect anything.
*
* A pull rather than a push inside `consume`. `consume` runs in the
* anchoring append, and a refund there would put an arbitrary payer's
* `receive` on the path of every bundle — one contract that reverts, or
* burns the gas, and the anchor fails for reasons that have nothing to do
* with the bundle.
*
* `consumedAt != 0` is the whole test. Consumption means `FinalBundleLog`
* folded this leaf into an anchored bundle, which is exactly "valid
* execution" — there is no later outcome for the chain to wait on, because
* from here the execution chains authorize against the anchor.
*/
function claimBond(bytes32 leaf) external {
Bond storage b = bondOf[leaf];
if (b.payer == address(0)) revert NoBond(leaf);
if (b.settled) revert BondAlreadySettled(leaf);
if (postedOf[leaf].consumedAt == 0) revert BondNotRefundable(leaf);
b.settled = true;
uint256 amount = b.amount;
address payer = b.payer;
emit BondRefunded(leaf, payer, amount);
_send(payer, amount);
}
/**
* @notice Forfeit the bond on an intent that expired without being anchored.
*
* @dev Permissionless, and gated on the DEADLINE rather than on a judgement.
* An intent past its deadline can never be consumed — `consume` refuses one
* — so "expired and unconsumed" is a terminal, objective state, and anyone
* may say so.
*
* That is the half of the bond that actually bounds spam. A refund on
* success only makes an honest posting free; the cost of a vertex that goes
* nowhere is what a spammer pays.
*/
function forfeitBond(bytes32 leaf) external {
Bond storage b = bondOf[leaf];
if (b.payer == address(0)) revert NoBond(leaf);
if (b.settled) revert BondAlreadySettled(leaf);
Posted storage p = postedOf[leaf];
if (p.consumedAt != 0) revert BondNotForfeitable(leaf, p.deadline);
if (FinalChainTime.nowMs() <= p.deadline) revert BondNotForfeitable(leaf, p.deadline);
b.settled = true;
uint256 amount = b.amount;
address to = bondForfeitTo;
emit BondForfeited(leaf, b.payer, amount);
// A zero destination BURNS: the value stays here and nothing can move
// it. Deliberate, and the reason `setBondPolicy` refuses to arm a bond
// without a destination unless somebody chose this one.
if (to != address(0)) _send(to, amount);
}
/// @dev Checks-effects-interactions is done by the caller — `settled` is set
/// before this runs — so a reentrant call finds the bond already spent.
///
/// Full gas rather than a stipend, because a payer may legitimately be a
/// contract. The consequence to accept: a payer whose `receive` reverts
/// cannot be refunded and the bond is stuck. That is their own contract's
/// behaviour, and the alternative — swallowing the failure — would mark the
/// bond settled while the money stayed here.
function _send(address to, uint256 amount) private {
(bool ok,) = to.call{value: amount}("");
if (!ok) revert BondTransferFailed(to, amount);
}
/**
* @notice Approve a posted intent: the read-back that authorizes execution.
*
* @dev Anyone may SUBMIT this — the authority is the signature and the
* sender only pays gas, the same standing the guardian lanes give
* their relay. The key arrives in calldata and proves something only
* because it is checked against the commitment the header made at
* posting: storage-anchored evidence, exactly the rule `FinalPqQuorum`
* states for quorum keys.
*
* The digest binds this chain, this log, the leaf AND the executor
* section, so an approval cannot be replayed here or elsewhere, and
* the section it delivered cannot be swapped for another under the
* same signature.
*
* @param publicKey The per-intent ML-DSA-87 public key (2592 B).
* @param signature Over the 32-byte approval digest, verbatim (4627 B).
* @param executorSection The content key and the account's KEM public
* keys, sealed to the executor set. Stored beside the envelope;
* this contract never parses it.
*/
function approve(
bytes32 leaf,
bytes calldata publicKey,
bytes calldata signature,
bytes calldata executorSection
) external {
Posted storage p = _requireActionable(leaf);
if (p.approvedAt != 0) revert AlreadyApproved(leaf, p.approvedAt);
uint64 nowMs = FinalChainTime.nowMs();
if (nowMs > p.deadline) revert Expired(leaf, p.deadline);
bytes32 digest = keccak256(
abi.encode(
DOMAIN_INTENT_APPROVE, block.chainid, address(this), leaf, keccak256(executorSection)
)
);
_requireApprovalKey(p, publicKey, signature, digest, leaf);
p.approvedAt = nowMs;
_envelopeOf[leaf].executorSection = executorSection;
_writeStatus(leaf, p, STATUS_APPROVED);
emit IntentApproved(leaf, executorSection.length);
}
/**
* @notice Revoke a posted intent. Terminal, and allowed AFTER approval:
* a user may change their mind at any point before execution.
*
* @dev No deadline check — cancelling an expired intent is harmless and
* refusing it would fail a retry for nothing. Only consumption closes
* the door, because consumption is execution.
*/
function cancel(bytes32 leaf, bytes calldata publicKey, bytes calldata signature) external {
Posted storage p = _requireActionable(leaf);
bytes32 digest =
keccak256(abi.encode(DOMAIN_INTENT_CANCEL, block.chainid, address(this), leaf));
_requireApprovalKey(p, publicKey, signature, digest, leaf);
p.cancelledAt = FinalChainTime.nowMs();
_writeStatus(leaf, p, STATUS_CANCELLED);
emit IntentCancelled(leaf);
}
/// @dev Posted, not consumed, not cancelled — the states in which the
/// approval key still has anything to say.
function _requireActionable(bytes32 leaf) private view returns (Posted storage p) {
p = postedOf[leaf];
if (p.postedAt == 0) revert NotPosted(leaf);
if (p.consumedAt != 0) revert AlreadyConsumed(leaf, p.consumedAt);
if (p.cancelledAt != 0) revert IntentIsCancelled(leaf, p.cancelledAt);
}
/// @dev The committed key, and a valid ML-DSA-87 signature under it over
/// the 32-byte digest verbatim — the same convention every quorum approval
/// follows. An AUTO_APPROVE posting committed to nothing and has nothing
/// to approve or cancel; its veto is the account-wide freeze.
function _requireApprovalKey(
Posted storage p,
bytes calldata publicKey,
bytes calldata signature,
bytes32 digest,
bytes32 leaf
) private view {
bytes32 commit = p.approvalKeyCommit;
if (commit == bytes32(0)) revert NoApprovalKey(leaf);
bytes32 got = keccak256(publicKey);
if (got != commit) revert WrongApprovalKey(commit, got);
if (!FinalChainPrecompiles.verifyMlDsa87(publicKey, abi.encodePacked(digest), signature)) {
revert ApprovalSignatureInvalid(leaf);
}
}
// ------------------------------------------------------ tree-7 mirror
/// @notice The tree-7 key for posting sequence `seq` — a RING, so slots
/// recycle at `INTENT_SLOT_RING` and the tree can never fill.
/// @dev Mirrored by the backend byte for byte; pinned cross-repo.
function intentSlotKey(uint64 seq) public pure returns (bytes32) {
return keccak256(
abi.encodePacked(DOMAIN_INTENT_KEY, bytes32(uint256(seq % INTENT_SLOT_RING)))
);
}
/// @notice The tree-7 status leaf. Everything in it is public log state —
/// nothing account-linked, so the tree adds searchability without
/// touching unlinkability. Expiry is derived from `deadline` by the
/// reader, never written.
function intentStatusLeaf(
bytes32 intentLeaf,
uint8 status,
uint64 postedAt,
uint64 executeNotBefore,
uint64 deadline,
bytes32 targetChainRef,
bytes32 bodyCommitment,
uint64 seq
) public pure returns (bytes32) {
return keccak256(
bytes.concat(
DOMAIN_INTENT_STATUS_LEAF,
abi.encode(
intentLeaf,
status,
postedAt,
executeNotBefore,
deadline,
targetChainRef,
bodyCommitment,
seq
)
)
);
}
/// @dev One transition, one write. The log is `treeWriter[7]`, and the
/// tree-1 argument applies verbatim: everything this mirrors was already
/// verified here, so no quorum belongs on top.
function _writeStatus(bytes32 leaf, Posted storage p, uint8 status) private {
bytes32[] memory keys = new bytes32[](1);
bytes32[] memory statusLeaves = new bytes32[](1);
keys[0] = intentSlotKey(p.seq);
statusLeaves[0] = intentStatusLeaf(
leaf,
status,
p.postedAt,
p.executeNotBefore,
p.deadline,
p.targetChainRef,
p.bodyCommitment,
p.seq
);
trees.setLeavesAsWriter(TREE_INTENTS_ID, BRANCH_MAIN_ID, keys, statusLeaves);
}
/**
* @notice Consume a posted intent as part of an anchoring append.
*
* @dev Called by `FinalBundleLog` in the same transaction as the append, so
* there is no window in which a bundle is anchored and its intents are
* not yet spent.
*
* Consumption is permanent and is the replay gate. The execution chain
* keeps its own consumed-seqId set, which covers a bundle being
* re-executed; this covers an intent being re-anchored into a second
* bundle, which that set does not see.
*/
function consume(bytes32 leaf) external {
// Checked before the comparison, not folded into it. An unset consumer
// is `address(0)`, and `msg.sender != consumer` would then be FALSE for
// a caller of `address(0)` — so an unwired log would consume for the one
// caller nobody can be, which is the kind of "unreachable" that stops
// being unreachable the moment something else changes.
address c = consumer;
if (c == address(0)) revert ConsumerUnset();
if (msg.sender != c) revert NotConsumer(msg.sender);
Posted storage p = postedOf[leaf];
if (p.postedAt == 0) revert NotPosted(leaf);
if (p.consumedAt != 0) revert AlreadyConsumed(leaf, p.consumedAt);
if (p.cancelledAt != 0) revert IntentIsCancelled(leaf, p.cancelledAt);
uint64 nowMs = FinalChainTime.nowMs();
if (nowMs > p.deadline) revert Expired(leaf, p.deadline);
// Scheduling is enforced HERE, which is what makes the funding and fee
// re-checks execution-time checks for free: admission cannot happen
// before the moment the intent named — less the lead, so the wrapper
// that follows admission can land AT that moment rather than minutes
// after it (`SCHEDULE_LEAD_MS`).
if (nowMs + _scheduleLeadMs(p) < p.executeNotBefore) {
revert TooEarly(leaf, p.executeNotBefore, nowMs);
}
// The read-back gate. Neither approved nor auto means the user has not
// seen on chain what is about to execute.
if (p.approvedAt == 0 && p.flags & FLAG_AUTO_APPROVE == 0) revert NotApproved(leaf);
p.consumedAt = nowMs;
_writeStatus(leaf, p, STATUS_CONSUMED);
emit IntentConsumed(leaf, msg.sender);
}
/// @notice The stored envelope. One `eth_call`, no range, any age.
///
/// @dev A getter rather than a public mapping so the three parts come back
/// in one call — a caller pairing a header from one read with a
/// ciphertext from another would be pairing across a posting that
/// landed between them.
function envelopeOf(bytes32 leaf)
external
view
returns (bytes memory header, bytes memory ciphertext, bytes memory executorSection)
{
Envelope storage e = _envelopeOf[leaf];
return (e.header, e.ciphertext, e.executorSection);
}
/// @notice Is `leaf` posted, unspent, uncancelled and unexpired right now?
function isOpen(bytes32 leaf) external view returns (bool) {
Posted storage p = postedOf[leaf];
return p.postedAt != 0 && p.consumedAt == 0 && p.cancelledAt == 0
&& FinalChainTime.nowMs() <= p.deadline;
}
/// @notice Would `consume` accept `leaf` right now? Open, due, and either
/// approved or AUTO_APPROVE — the work-queue predicate, so a solver
/// asks the same question the contract answers.
function isConsumable(bytes32 leaf) external view returns (bool) {
Posted storage p = postedOf[leaf];
uint64 nowMs = FinalChainTime.nowMs();
return p.postedAt != 0 && p.consumedAt == 0 && p.cancelledAt == 0 && nowMs <= p.deadline
&& nowMs + _scheduleLeadMs(p) >= p.executeNotBefore
&& (p.approvedAt != 0 || p.flags & FLAG_AUTO_APPROVE != 0);
}
/// @dev The lead `consume` grants a posting: its target chain's
/// (`scheduleLeadMsOf`) for a scheduled one, nothing for an immediate
/// one (there is no moment to lead).
function _scheduleLeadMs(Posted storage p) private view returns (uint64) {
return p.executeNotBefore == 0 ? 0 : scheduleLeadMsOf(p.targetChainRef);
}
}
contracts/finalchain/FinalPqQuorum.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
// Licensed under the Business Source License 1.1 (the "License")
//
// Change Date: 2029-01-01
// Change License: GPL-2.0-or-later
//
// @author Final DeFi
// @version 1.0.0
pragma solidity ^0.8.20;
import {FinalChainPrecompiles} from "./FinalChainPrecompiles.sol";
import {FinalIdentityRegistry} from "./FinalIdentityRegistry.sol";
/**
* @title FinalPqQuorum
* @notice K-of-N approval where the signatures are post-quantum and the chain
* is what checks them.
*
* @dev This library is the reason Final Chain exists in this design.
*
* `FinalBackend/src/pq/credential.js` carries a rule it had to enforce in code
* because nothing else could: **a surface whose signature is verified on chain
* cannot be PQ.** A co-signer approval reaching `FinalRootAuthority` is checked
* by ECDSA/ERC-1271 in Solidity, so a PQ co-signer would produce approvals the
* contract cannot read, and the quorum would stop reaching threshold with
* nothing in any log naming the cause. `PQ_SURFACE` and `assertBackendVerified`
* exist to keep anyone from crossing that line by accident.
*
* Here the line is gone. The precompiles verify ML-DSA-87 and
* SLH-DSA-SHAKE-256s natively, so a quorum can be PQ *and* on chain, and
* "the backend says these four signatures verified" becomes "these four
* signatures verify, and any node re-derives that independently".
*
* ## Three rules, each closing a specific hole
*
* 1. **Keys come from the registry, never from calldata.** A key passed as an
* argument proves nothing — anyone with a keypair can sign under it. This is
* the difference between a 4-of-5 quorum and a 1-of-1 held by whoever built
* the transaction.
*
* 2. **Signers strictly ascending.** One comparison per entry rejects duplicates
* outright, so a single member cannot supply four approvals and satisfy a
* threshold of four. The alternative — an O(n²) seen-check — is the same
* guarantee with more ways to get it wrong.
*
* 3. **The digest binds chain id and verifying contract.** Without both, an
* approval collected for one contract is replayable against another with the
* same payload shape, and an approval from the test chain is replayable on
* the production one. These co-signers hold one key across environments.
*
* ## Which algorithm
*
* The stack splits its keys by hardness assumption, not by convenience:
* ML-DSA-87 (lattice) signs transactions, SLH-DSA-SHAKE-256s (hash-based) signs
* identity. Two families, so one cryptanalytic result cannot take both.
*
* So an action inherits the class of what it authorizes. Advancing a state root
* is operational and high-cadence: transaction class. Registering or revoking
* an identity is the thing the access class exists for. `ALG_ANY` is available
* and should be used sparingly — accepting either means a break in one family
* takes the quorum.
*
* An action that authorizes EXECUTION takes both: the ML-DSA-87 approval and a
* `seal`, an SLH-DSA-SHAKE-256s signature over the same digest by the member's
* `activeSeal` key. Neither family alone can then move funds, and the seal key
* is its own slot — never the access key — so the process that seals cannot
* also rotate the identity it seals for.
*
* Every digest binds an `anchorBlock`: the block at which the members read
* tree 1 to decide who is in the round. Binding it means every approval in a
* round was made against ONE roster view, and the window in `require_` means a
* view older than `ANCHOR_WINDOW` blocks is refused rather than honoured.
*
* The practical cost is worth stating: an SLH-DSA signature is 29,792 bytes, so
* a 4-of-5 access-class quorum is ~119 KB of calldata. That is affordable here
* only because this is our own chain. Do not carry this pattern to a chain
* where it is not.
*/
library FinalPqQuorum {
/// @notice ML-DSA-87 — FIPS 204. Algorithm ids are the FIPS numbers: the
/// same ids `FinalCertificate` and the backend registry use, and the numbers
/// the precompile addresses end in (`0x0204`).
uint8 internal constant ALG_ML_DSA_87 = 4;
/// @notice SLH-DSA-SHAKE-256s — FIPS 205 (`0x0205`).
uint8 internal constant ALG_SLH_DSA_SHAKE_256S = 5;
/// @notice Either scheme is acceptable for this action.
uint8 internal constant ALG_ANY = 0;
/// @notice How far behind the chain head an approval's anchor may sit.
/// @dev Members evaluate roster membership against tree 1 AT the anchor
/// block. 600 blocks is ten minutes at the chain's one-second cadence —
/// generous against a round that takes seconds, and short enough that a
/// roster rotated away is refused rather than counted.
uint64 internal constant ANCHOR_WINDOW = 600;
/// @dev Domain separator for every quorum digest. Distinct from any
/// EIP-712 domain in the stack: these are not typed-data signatures and
/// must not be confusable with one.
bytes32 internal constant DOMAIN_PQ_QUORUM = keccak256("FINAL_CHAIN_PQ_QUORUM_v01");
/// @notice One member's approval.
struct Approval {
/// The member's account, which is also the key it is looked up by.
address signer;
/// `ALG_ML_DSA_87` or `ALG_SLH_DSA_SHAKE_256S`.
uint8 algorithm;
/// Over the 32-byte digest from `digest()`, verbatim. Both schemes
/// hash internally, so the digest is not re-hashed before signing.
bytes signature;
/// SLH-DSA-SHAKE-256s over the same digest, by the member's `activeSeal`
/// key. Required where the action authorizes execution; empty otherwise.
bytes seal;
}
error ThresholdNotMet(uint256 valid, uint256 required);
error SignersNotAscending(address previous, address next);
error SignerLacksRole(address signer, uint256 roleMask);
error WrongAlgorithm(address signer, uint8 got, uint8 required);
error BadSignature(address signer, uint8 algorithm);
error BadSeal(address signer);
error AnchorAhead(uint64 anchorBlock, uint256 blockNumber);
error AnchorStale(uint64 anchorBlock, uint256 blockNumber);
error ThresholdIsZero();
/**
* @notice The message every member of this quorum signs.
* @param verifyingContract The contract consuming the approvals. Binding it
* stops an approval collected for one contract being replayed
* against another with the same payload shape.
* @param actionDomain What is being authorized — a per-action constant, so
* an approval for "advance the accounts tree" cannot be replayed as
* one for "revoke an identity".
* @param anchorBlock The Final Chain block the members read tree 1 at to
* decide the roster. Bound here so every approval in a round names
* the same view; checked against `ANCHOR_WINDOW` by `require_`.
* @param payloadDigest The action's own committed content. Callers MUST
* include a nonce or a monotonic counter in it; nothing here can
* tell a replay of round 7 from a fresh round 7.
*/
function digest(
address verifyingContract,
bytes32 actionDomain,
uint64 anchorBlock,
bytes32 payloadDigest
) internal view returns (bytes32) {
return keccak256(
abi.encode(
DOMAIN_PQ_QUORUM,
block.chainid,
verifyingContract,
actionDomain,
anchorBlock,
payloadDigest
)
);
}
/**
* @notice Reverts unless at least `threshold` distinct members holding
* `roleMask` have signed `quorumDigest`.
* @param registry Where public keys and roles come from. Not a parameter
* for flexibility — a parameter so the caller's own immutable
* registry address is what is used, rather than one from calldata.
* @param requiredAlgorithm `ALG_ANY` to accept either scheme.
* @param anchorBlock The anchor the digest was built over. Refused if it is
* ahead of this block or more than `ANCHOR_WINDOW` behind it.
* @param requireSeal Whether every approval must also carry a valid `seal`
* by the member's `activeSeal` key — the execution class.
* @return valid The number of approvals that verified, which is at least
* `threshold` if this returns at all.
*
* @dev Every failure reverts with the offending signer named. A quorum that
* silently skipped bad approvals and counted the rest would let a
* misconfigured co-signer sit broken indefinitely: the threshold would keep
* being met by the others and nothing would say one member had stopped
* contributing. That is exactly the failure this program has already had,
* in `fanOut`, where a per-chain advance failure was recorded and execution
* continued.
*/
function require_(
FinalIdentityRegistry registry,
Approval[] calldata approvals,
bytes32 quorumDigest,
uint256 roleMask,
uint256 threshold,
uint8 requiredAlgorithm,
uint64 anchorBlock,
bool requireSeal
) internal view returns (uint256 valid) {
if (threshold == 0) revert ThresholdIsZero();
if (anchorBlock > block.number) revert AnchorAhead(anchorBlock, block.number);
if (block.number - anchorBlock > ANCHOR_WINDOW) revert AnchorStale(anchorBlock, block.number);
bytes memory message = abi.encodePacked(quorumDigest);
address previous = address(0);
uint256 n = approvals.length;
for (uint256 i = 0; i < n; i++) {
Approval calldata a = approvals[i];
// Strictly ascending. `address(0)` as the initial value works
// because it can never be a registered signer.
if (a.signer <= previous) revert SignersNotAscending(previous, a.signer);
previous = a.signer;
if (!registry.hasRole(a.signer, roleMask)) revert SignerLacksRole(a.signer, roleMask);
if (requiredAlgorithm != ALG_ANY && a.algorithm != requiredAlgorithm) {
revert WrongAlgorithm(a.signer, a.algorithm, requiredAlgorithm);
}
if (!_verify(registry, a, message)) revert BadSignature(a.signer, a.algorithm);
if (requireSeal && !_verifySeal(registry, a, message)) revert BadSeal(a.signer);
valid++;
}
if (valid < threshold) revert ThresholdNotMet(valid, threshold);
}
/// @notice Non-reverting form, for views and for callers that want to
/// report rather than refuse.
function count(
FinalIdentityRegistry registry,
Approval[] calldata approvals,
bytes32 quorumDigest,
uint256 roleMask,
uint8 requiredAlgorithm,
uint64 anchorBlock,
bool requireSeal
) internal view returns (uint256 valid) {
if (anchorBlock > block.number || block.number - anchorBlock > ANCHOR_WINDOW) return 0;
bytes memory message = abi.encodePacked(quorumDigest);
address previous = address(0);
uint256 n = approvals.length;
for (uint256 i = 0; i < n; i++) {
Approval calldata a = approvals[i];
if (a.signer <= previous) return valid;
previous = a.signer;
if (!registry.hasRole(a.signer, roleMask)) continue;
if (requiredAlgorithm != ALG_ANY && a.algorithm != requiredAlgorithm) continue;
if (!_verify(registry, a, message)) continue;
if (requireSeal && !_verifySeal(registry, a, message)) continue;
valid++;
}
}
/// @dev The seal: SLH-DSA-SHAKE-256s by the member's `activeSeal` key over
/// the same digest. A member with no seal key on record cannot seal, and an
/// approval with no seal bytes is not one.
function _verifySeal(
FinalIdentityRegistry registry,
Approval calldata a,
bytes memory message
) private view returns (bool) {
bytes memory key = registry.activeSealKeyOf(a.signer);
if (key.length == 0 || a.seal.length == 0) return false;
return FinalChainPrecompiles.verifySlhDsa(key, message, a.seal);
}
function _verify(
FinalIdentityRegistry registry,
Approval calldata a,
bytes memory message
) private view returns (bool) {
// The LIVE pair, always. The recovery pair authorizes rotating this
// account's own credentials and NOTHING else — a quorum that accepted
// it would hand the recovery keys everyday authority, which is exactly
// the separation the two stages exist to draw.
if (a.algorithm == ALG_ML_DSA_87) {
return FinalChainPrecompiles.verifyMlDsa87(
registry.activeTransactionKeyOf(a.signer), message, a.signature
);
}
if (a.algorithm == ALG_SLH_DSA_SHAKE_256S) {
return FinalChainPrecompiles.verifySlhDsa(
registry.activeAccessKeyOf(a.signer), message, a.signature
);
}
// Any other id is a refusal, never a default — including the KEM ids
// (3, 7) and the reserved FN-DSA id (6), none of which is a signature
// scheme this quorum verifies.
return false;
}
}
contracts/finalchain/FinalStateTrees.sol
// SPDX-License-Identifier: BUSL-1.1
// Copyright (c) 2024-2026 Final DeFi
// Licensed under the Business Source License 1.1 (the "License")
//
// Change Date: 2029-01-01
// Change License: GPL-2.0-or-later
//
// @author Final DeFi
// @version 1.0.0
pragma solidity ^0.8.20;
import {FinalIdentityRegistry} from "./FinalIdentityRegistry.sol";
import {FinalChainTime} from "./FinalChainTime.sol";
import {FinalPqQuorum} from "./FinalPqQuorum.sol";
/// @notice The one question `syncIdentities` asks the asset registry.
/// @dev An interface rather than an import of `FinalAssetRegistry`, which
/// imports this file: the registry is tree 6's writer and holds the trees
/// as an immutable, so the dependency runs that way and this is the one
/// read that runs the other.
interface IChainSource {
function enabledChainRefs() external view returns (bytes32[] memory);
}
/// @notice The one question {FinalStateTrees.syncSlotKeyLeaves} asks the
/// slot-key registry: the leaf value for one member's slot — the
/// registry's own verdict, zero when the slot holds nothing usable.
interface ISlotKeySource {
function slotKeyLeafOf(address member, uint64 slotIndex) external view returns (bytes32);
}
/// @notice The one question {FinalStateTrees.syncEndpointLeaves} asks the
/// endpoint registry: the leaf value for one tunnel endpoint — the
/// registry's own verdict (certificate hash, status, expiry, region),
/// zero when nothing is registered under the id.
interface IEndpointSource {
function endpointLeafOf(bytes32 endpointId) external view returns (bytes32);
}
/**
* @title FinalStateTrees
* @notice The eight trees. Final Chain's state plane, and the source of truth
* every other chain projects from.
*
* @dev One tree per domain, because they change at unrelated cadences and a
* combined tree invalidates every outstanding proof on every tick:
*
* | # | tree | holds | cadence |
* |---|---|---|---|
* | 1 | accounts | every Final Wallet's public state | per rotation / creation |
* | 2 | phi | the PHI record: per (wallet, chain) balances, the lock, exposures | per publisher round |
* | 3 | vasset | issued vAsset supply and backing, per (asset, chain) | per settlement |
* | 4 | oracle | published prices and their inputs | ~10 s; 1 s for morph and fee assets |
* | 5 | settlement | chain and asset registry roots | rarely |
* | 6 | allowlist | assets, chains, policy, price sources, DEX deployments | rarely |
* | 7 | intents | intent status, ring-keyed over the posting sequence | per posting |
* | 8 | identity | the wallet-creation admission set, projected from the registry | per identity mutation |
*
* ## The hash shape is not a choice
*
* Leaves hash as `keccak256(0x00 ‖ leaf)` and internal nodes as
* `keccak256(0x01 ‖ lo ‖ hi)` with the pair sorted. That is
* `FinalMerkle.verifyTaggedSortedProof`, verbatim, which is what
* `FinalWalletFactory.syncAccountState` and `FinalSettlement` already run on
* every supported chain. A proof produced here is consumed there with no
* translation and no contract change, and tree 1's leaf preimage is exactly
* `FinalWalletFactory.accountStateLeafHash` — same fields, same order, the
* `deployedChains` table `abi.encode`d like every other field.
*
* Getting this wrong is not a compile error anywhere. It is a root every chain
* silently rejects, with nothing pointing at the cause.
*
* ## Positional slots under a sorted-pair tree
*
* Sorted pairs make a proof position-agnostic, which is why it carries no
* direction bits. That does not stop the TREE from being positional, and here
* it is: every key gets a permanent slot, so a single leaf update is `DEPTH`
* hashes instead of a rebuild over every leaf. The verifier neither knows nor
* needs to know that a slot exists.
*
* ## Branches (2026-09-04)
*
* The slot space of every tree is cut into `BRANCH_COUNT` branches by the top
* `BRANCH_BITS` of the slot: a branch is a subtree with a permanent place, its
* root is one internal node, and a leaf's path to the tree root passes through
* it. Branches hold what belongs to the same domain but not to the same rows
* — branch 0 is the owning service's CONFIGURATION on every tree, tree 8 adds
* the owner → wallets index and the co-signers' slot keys beside the admission
* set — and they are chosen over more trees because a branch shares its
* tree's authority doors and writer, while a tree would need its own. A leaf
* proves against its branch root with `BRANCH_DEPTH` siblings, against the
* tree root with `DEPTH`, against the round root with `ROUND_DEPTH`: one path,
* cut at three heights, one verifier.
*
* ## Rounds, and why the live roots are not the product
*
* `setLeaves` moves a tree. It does not publish one. A consumer that fetched
* eight roots one at a time would get a price proof from one moment and a
* roster proof from another, and something delisted in between would still
* verify.
*
* `publishRound` snapshots all eight together, and folds them into ONE round
* root — the tree roots as the level-`DEPTH` nodes of a depth-`ROUND_DEPTH`
* tree, tree `t` at position `t` — so a single word commits to the whole
* plane and any leaf in it proves against that word with four more siblings.
* A round is the unit a consumer pins, and it is the only thing this contract
* promises is contemporaneous. The execution chains keep anchoring per-tree
* roots (identity, account state, registry roots): those must move at their
* own cadence, not at the oracle's.
*/
contract FinalStateTrees {
// ---------------------------------------------------------------- trees
/// @notice Every Final Wallet's public state. The source of truth other
/// chains copy through `syncAccountState`.
uint8 public constant TREE_ACCOUNTS = 1;
/// @notice The PHI record, per `(wallet, chain)`: balances, the lock, its
/// terms, the exposures carved from it and the accrual between reconciliations.
uint8 public constant TREE_PHI = 2;
/// @notice vAsset supply and backing.
uint8 public constant TREE_VASSET = 3;
/// @notice Oracle prices and their inputs.
uint8 public constant TREE_ORACLE = 4;
/// @notice Settlement chain and asset registry roots.
uint8 public constant TREE_SETTLEMENT = 5;
/// @notice Which assets and chains are supported.
uint8 public constant TREE_ALLOWLIST = 6;
/// @notice Intent status, keyed by a RING over the posting sequence.
/// @dev The search structure beside `FinalBundleLog`'s permanent record.
/// Written only by `FinalIntentLog` through `treeWriter[7]` — the tree-1
/// argument verbatim: the log verified the bond, the commitment, the
/// approval and the consume itself, and a service quorum on top would be a
/// censorship point over posting. Slots are permanent and intents are
/// unbounded flow, so the log recycles keys modulo `CAPACITY`: the tree is
/// an index with a ~1M-posting retention window, never the record.
uint8 public constant TREE_INTENTS = 7;
/// @notice The wallet-creation admission set — the identity leaves
/// (`keccak256(DOMAIN_IDENTITY_LEAF ‖ serial ‖ keysHash)`) every execution
/// chain's gateway verifies certificates against.
/// @dev The root the gateways anchor as `currentIdentityRoot` — a
/// CONTINUOUS root over this tree replaces the cold-set snapshot the
/// retired `publishIdentityRoot.cjs` ceremony folded off-chain. Two
/// feeders, one per identity plane, and NO quorum door for either:
///
/// - SERVICE identities: {syncIdentityLeaves}, the permissionless
/// projection of `FinalIdentityRegistry`'s own verdict — the registry
/// calls it same-tx on every identity mutation, and anyone may call it
/// to retire a leaf whose standing lapsed by TIME (expiry moves no
/// registry storage, so only a projection pass can zero it).
/// - USER identities: `treeWriter[8]` — `FinalAccountLedger`, which
/// computes the leaf from the genesis certificate fields it verified
/// under its opener quorum and writes it once at `openAccount`. A user
/// admission leaf is permanent by construction: the certificate IS the
/// address, rotation never changes it, and a post-rotation creation on
/// a new chain reads PUBLISHED account state (WAL-02), never the
/// certificate's genesis keys.
///
/// A quorum of service signatures must not be able to state an identity
/// neither ruler decided, so `setLeaves` refuses this tree outright.
uint8 public constant TREE_IDENTITY = 8;
/// @notice Count, for iteration. Trees are 1-indexed; 0 is not a tree.
uint8 public constant TREE_COUNT = 8;
/// @notice 2^24 slots per tree, laid out as 16 BRANCHES of 2^20: the top
/// `BRANCH_BITS` of a slot name the branch, the rest its position in it.
/// A million rows per branch is far past where this design gets replaced
/// by Final Chain proper. Raising any of this later is a migration, not a
/// parameter change: the depth is in every root.
uint256 public constant DEPTH = 24;
uint256 public constant BRANCH_BITS = 4;
uint8 public constant BRANCH_COUNT = 16;
/// @notice Height of a branch: a leaf proves against its branch root with
/// this many siblings.
uint256 public constant BRANCH_DEPTH = DEPTH - BRANCH_BITS;
/// @notice Slots per branch.
uint256 public constant BRANCH_CAPACITY = 1 << BRANCH_DEPTH;
/// @notice Slots per tree, all branches together.
uint256 public constant CAPACITY = 1 << DEPTH;
/// @notice The round root is a tree over the tree roots — position `t`
/// holds tree `t`'s root, positions 0 and 9..15 the empty tree — folded
/// with the same node hash. It is literally the root of a depth-28 tree
/// whose level-24 nodes are the eight tree roots, which is what lets one
/// path prove a leaf against it.
uint256 public constant FOREST_BITS = 4;
uint256 public constant ROUND_DEPTH = DEPTH + FOREST_BITS;
/// @notice Branch 0 of EVERY tree: the configuration of the service that
/// owns the tree — key → one word, the VALUE stored so a contract on this
/// chain reads it directly (`configValue`), the hash in the tree so it is
/// provable wherever a round root is. Written only by {setConfig} under
/// the configuration authority; every other door refuses the branch.
uint8 public constant BRANCH_CONFIG = 0;
/// @notice Branch 1 of every tree: the domain's own rows — accounts, PHI
/// records, vAssets, prices, registry roots, the allowlist, the intent
/// ring, the identity admission set.
uint8 public constant BRANCH_MAIN = 1;
/// @notice Tree 8, branch 2: the owner → wallets index. Key = the owner
/// (`ownerIndexKeyFor`), leaf = {ownerIndexLeafHash} over the ledger's
/// `walletsByOwner(owner)`. Written by tree 8's writer, the ledger, beside
/// every open and every owner transfer — the tree is the search structure,
/// the ledger holds the readable array it proves.
uint8 public constant BRANCH_OWNER_INDEX = 2;
/// @notice Tree 8, branch 3: the co-signers' per-slot KEM publics — a RING
/// of `SLOT_KEY_RING` positions per member, projected from
/// `slotKeySource` by {syncSlotKeyLeaves} exactly as identities are.
uint8 public constant BRANCH_SLOT_KEYS = 3;
/// @notice Tree 8, branch 4: the tunnel endpoints — the Final Node
/// identities a wallet's FNP session terminates at. Key = the endpoint id
/// (`endpointKeyFor`, the certificate's subject key id), leaf = the
/// endpoint registry's verdict, projected from `endpointSource` by
/// {syncEndpointLeaves} exactly as slot keys are. An execution chain never
/// parses an endpoint certificate; it anchors this tree's root and a client
/// proves the leaf against it (user ruling 2026-09-05).
uint8 public constant BRANCH_ENDPOINTS = 4;
/// @notice Slot-key positions per member. A slot index wraps modulo this,
/// so the branch is an index over the recent slots and never fills; 1024
/// members × 1024 positions is the branch exactly.
uint64 public constant SLOT_KEY_RING = 1024;
/// @dev Must equal `FinalWalletFactory.DOMAIN_ACCOUNT_STATE_LEAF`. Pinned
/// by the cross-repo parity test; a field reordered on one side and not the
/// other is a root every chain rejects.
///
/// `v02`: `deployedChains` became the `(chainRef, account)` table. A v01
/// leaf and a v02 leaf never share a domain, so a proof built against the
/// retired plane cannot verify against this one by accident.
bytes32 public constant DOMAIN_ACCOUNT_STATE_LEAF =
keccak256("FINAL_ACCOUNT_STATE_LEAF_v02");
bytes32 private constant ACTION_SET_LEAVES = keccak256("FinalStateTrees.setLeaves.v01");
/// @dev Registrar-quorum actions, verified by the registry with this
/// contract as the verifying contract. See `FinalIdentityRegistry.requireRegistrarQuorum`.
bytes32 public constant ACTION_CONFIGURE_TREE = keccak256("FINAL_STATE_TREES_CONFIGURE_TREE_v01");
bytes32 public constant ACTION_SET_TREE_WRITER = keccak256("FINAL_STATE_TREES_SET_TREE_WRITER_v01");
bytes32 public constant ACTION_SET_CHAIN_SOURCE = keccak256("FINAL_STATE_TREES_SET_CHAIN_SOURCE_v01");
bytes32 public constant ACTION_SET_SLOT_KEY_SOURCE = keccak256("FINAL_STATE_TREES_SET_SLOT_KEY_SOURCE_v01");
bytes32 public constant ACTION_SET_ENDPOINT_SOURCE = keccak256("FINAL_STATE_TREES_SET_ENDPOINT_SOURCE_v01");
bytes32 public constant ACTION_SEED_COUNTERS = keccak256("FINAL_STATE_TREES_SEED_COUNTERS_v01");
bytes32 public constant ACTION_SET_TYPED_WRITER = keccak256("FINAL_STATE_TREES_SET_TYPED_WRITER_v01");
bytes32 public constant ACTION_SET_CONFIG = keccak256("FINAL_STATE_TREES_SET_CONFIG_v01");
/// @dev Key domains. Both are full-width hashes rather than the packed
/// address they came from, which matters: an address key occupies only the
/// low 160 bits, so a hashed key colliding with one needs ~2^96 work rather
/// than a full collision. That is expensive but not comfortable, and the
/// consequence would be a service identity landing in a wallet's slot.
bytes32 private constant DOMAIN_ACCOUNT_KEY = keccak256("FinalStateTrees.key.account.v01");
bytes32 private constant DOMAIN_IDENTITY_TREE_KEY = keccak256("FinalStateTrees.key.identity.v01");
/// @dev Tree 8, branches 2 and 3, and branch 0 of every tree. Each is its
/// own domain so a key can never land in another branch's slot by
/// construction — `_set` refuses a key whose slot sits in a different
/// branch, and the domain is what makes that refusal unreachable.
bytes32 private constant DOMAIN_OWNER_INDEX_KEY = keccak256("FinalStateTrees.key.ownerIndex.v01");
bytes32 private constant DOMAIN_SLOT_KEY = keccak256("FinalStateTrees.key.slotKey.v01");
bytes32 private constant DOMAIN_ENDPOINT_KEY = keccak256("FinalStateTrees.key.endpoint.v01");
bytes32 private constant DOMAIN_CONFIG_KEY = keccak256("FinalStateTrees.key.config.v01");
/// @notice Leaf domains for the owner index (tree 8, branch 2) and for
/// configuration rows (branch 0 of every tree). The config leaf binds the
/// tree too, so the same row in two trees is two different leaves.
bytes32 public constant DOMAIN_OWNER_INDEX_LEAF = keccak256("FINAL_OWNER_INDEX_LEAF_v01");
bytes32 public constant DOMAIN_CONFIG_LEAF = keccak256("FINAL_CONFIG_LEAF_v01");
// -------------------------------------------------------------- storage
/// @notice The registry every signer is resolved through. Immutable so the
/// quorum can never be pointed at a registry supplied in calldata.
FinalIdentityRegistry public immutable registry;
/// @notice Approvals required per tree.
///
/// @dev Per-tree and not a scalar, because each tree is gated by a
/// DIFFERENT role — account co-signers, PHI, vAsset and oracle
/// publishers, registry publishers — so K is a property of that
/// tree's roster, not of the contract. All six read 2 today; that is
/// a deploy-time default, not an invariant, and collapsing them would
/// put the oracle roster's quorum on the account co-signers'.
///
/// The VALUE is a full word: it is a quantity compared against a live
/// member count, and every other threshold in the system is `uint256`.
/// The KEY is `uint8` because that is what a tree id is here — six
/// `uint8` constants, every parameter, every event, every error,
/// `_assertTree`, and the ten sibling mappings below. Widening it
/// would buy nothing (a narrow key is padded to 32 bytes before
/// hashing, so the slot is identical) and cost the getter's selector
/// on a contract that is live on both Final Chains.
mapping(uint8 treeId => uint256) public threshold;
/// @notice Role a signer must hold to write to a tree.
mapping(uint8 treeId => uint256) public writerRole;
/// Raw (untagged) leaf value by tree and slot.
mapping(uint8 => mapping(uint256 => bytes32)) private _leaf;
/// Internal nodes, levels 1..DEPTH. Level 0 is derived from `_leaf`.
mapping(uint8 => mapping(uint256 => mapping(uint256 => bytes32))) private _node;
/// Empty-subtree hash per level, computed once at construction — up to
/// the round root's height, since the forest's empty positions are empty
/// trees.
bytes32[ROUND_DEPTH + 1] private _zero;
/// Permanent slot for a key, 1-based so 0 means unassigned. The slot's top
/// `BRANCH_BITS` are the branch the key lives in.
mapping(uint8 => mapping(bytes32 => uint256)) private _slotPlusOne;
/// The key a slot was handed to — the reverse of `_slotPlusOne`, so any
/// branch enumerates on chain (`keyAt` over `0 .. branchSlotsUsed`) with
/// no log window. One extra word per NEW key, never per update.
mapping(uint8 => mapping(uint256 => bytes32)) private _keyAt;
/// @notice Slots handed out per tree, all branches together.
mapping(uint8 => uint256) public slotsUsed;
/// Slots handed out per branch — the next position in it.
mapping(uint8 => mapping(uint8 => uint256)) private _branchSlotsUsed;
/// The VALUE behind a configuration row (branch 0), by tree and key.
mapping(uint8 => mapping(bytes32 => bytes32)) private _configValue;
/// @notice Live root per tree. Moves on every `setLeaves`.
mapping(uint8 treeId => bytes32) public liveRoot;
/// @notice Writes applied per tree, for change detection between rounds.
mapping(uint8 treeId => uint64) public treeVersion;
/// @notice A contemporaneous snapshot of all eight roots, and the one
/// round root that folds them.
struct Round {
bytes32[TREE_COUNT + 1] roots;
bytes32 roundRoot;
uint64 blockNumber;
uint64 timestamp;
}
/// @notice Published rounds, 1-indexed. Round 0 is "nothing published".
mapping(uint64 => Round) private _rounds;
/// @notice Highest published round.
uint64 public round;
/// Tree versions as of the last published round.
mapping(uint8 => uint64) private _publishedVersion;
/// @notice Per-tree nonce, bound into every quorum digest.
mapping(uint8 treeId => uint64) public nonce;
/**
* @notice A CONTRACT allowed to write one tree without a quorum.
*
* @dev Exactly one per tree, and today exactly one exists: tree 1's is
* `FinalAccountLedger`.
*
* This looks like a hole and is the opposite. The quorum on `setLeaves`
* exists because a tree's writer is otherwise one key deciding what the
* chain states. A writer contract is not a key — its rules are its
* bytecode, it has no owner and no proxy, and tree 1's writer authorizes
* every change by verifying the ACCOUNT HOLDER'S own post-quantum signature
* in this chain's precompiles. That is strictly stronger evidence than a
* K-of-N of our own services attesting to what they read.
*
* Keeping the quorum on top of it would be actively worse: our fleet could
* then withhold approval from a user rotating a stolen key, which is a
* censorship power over the exact operation the account plane exists to
* make possible.
*
* The writer is set on the same bootstrap window as `configureTree` and can
* be moved by a registrar afterwards — an immutable pointer would mean a
* ledger upgrade abandons the tree it writes.
*/
mapping(uint8 treeId => address) public treeWriter;
/**
* @notice Where `syncIdentities` reads the chain set from — the asset
* registry, which is also tree 6's writer.
*
* @dev A service identity is a Final Wallet whose address is the same on
* every EVM chain, so its tree-1 `deployedChains` table is derivable: one
* `(chainRef, itself)` row per chain the registry has enabled. The table
* is DERIVED from state rather than supplied by the caller precisely so
* that `syncIdentities` can stay permissionless — a caller-chosen table
* would let anyone grant a service identity on a chain of their choosing.
*
* Unset (zero) means services carry an empty table and exist on Final
* Chain alone, which is what a plane looks like before its registry is
* seeded. Same configuration gate as `setTreeWriter`, because pointing this
* at a different contract changes what every service leaf says.
*/
address public chainSource;
/// @notice Where {syncSlotKeyLeaves} reads the co-signers' slot keys from
/// — the slot-key registry, whose verdict tree 8's branch 3
/// projects. Same configuration gate as `chainSource`; unset means
/// the branch cannot be written.
address public slotKeySource;
/// @notice The endpoint registry whose verdict tree 8's branch 4 projects.
address public endpointSource;
/// @notice The one contract admitted to {writeTyped}: `FinalStateRecords`,
/// which holds the preimages behind trees 2, 3 and 4 and computes
/// their keys and hashes. Same configuration gate as `treeWriter`.
address public typedWriter;
// --------------------------------------------------------------- events
event LeavesSet(uint8 indexed treeId, uint256 count, bytes32 newRoot, uint64 treeVersion);
event RoundPublished(uint64 indexed round, uint64 blockNumber, uint64 timestamp);
event TreeConfigured(uint8 indexed treeId, uint256 writerRole, uint256 threshold);
event TreeWriterSet(uint8 indexed treeId, address writer);
event ChainSourceSet(address source);
event SlotKeySourceSet(address source);
event EndpointSourceSet(address source);
/// @notice A fresh plane took over the previous plane's counters.
event CountersSeeded(uint64 round, uint64[] versions);
event TypedWriterSet(address writer);
event ConfigSet(uint8 indexed treeId, bytes32 indexed key, bytes32 value);
// --------------------------------------------------------------- errors
error UnknownTree(uint8 treeId);
error LengthMismatch(uint256 keys, uint256 leaves);
error BranchFull(uint8 treeId, uint8 branch);
error UnknownBranch(uint8 branch);
/// @notice A key already holds a slot in another branch of this tree.
error BranchMismatch(uint8 treeId, bytes32 key, uint8 have, uint8 want);
/// @notice Branch 0 is written by `setConfig` alone.
error ConfigBranchReserved(uint8 treeId);
error SlotKeySourceUnset();
error EndpointSourceUnset();
/// @notice Counters can be seeded only into a plane that has published nothing.
error NotFresh();
error VersionCountMismatch(uint256 given);
error TreeNotConfigured(uint8 treeId);
error NothingToPublish();
error UnknownKey(uint8 treeId, bytes32 key);
error NotAuthorized(address caller);
error NoRounds();
error ThresholdUnreachable(uint8 treeId, uint256 live, uint256 required);
/// @notice Trees 7 and 8 take no quorum writes — only their writer
/// contract (and, for tree 8, the registry projection).
error WriterOnlyTree(uint8 treeId);
/// @notice `setLeaves` was called on a tree that has a typed writer.
/// @dev Trees 2, 3 and 4 keep the leaf's preimage beside its hash so a
/// consumer can read the VALUE. An untyped write sets the hash and
/// cannot set the preimage — the pair would disagree, and the stored
/// value would look authoritative while committing to nothing. The
/// typed entrypoint is not a convenience over this one; it is the
/// only door.
error TypedTreeOnly(uint8 treeId);
/// @notice A `deployedChains` row names the zero chain or the zero account,
/// or repeats a chain. A table with either proves nothing about
/// where the account exists.
error InvalidChainAccount(bytes32 chainRef, bytes32 account);
// ---------------------------------------------------------- constructor
/**
* @param registry_ The identity registry. Every signer, key and role is
* resolved through it.
* @dev The empty-subtree table is built here rather than as constants
* because it depends on the tagging, and a constant table that drifted from
* the tagging would produce roots nothing can verify — silently, since both
* sides would still be self-consistent.
*/
constructor(FinalIdentityRegistry registry_) {
registry = registry_;
// Level 0: the tagged hash of an empty (zero) leaf.
_zero[0] = keccak256(abi.encodePacked(bytes1(0x00), bytes32(0)));
for (uint256 l = 0; l < ROUND_DEPTH; l++) {
// Both children equal, so the sort is a no-op and the order is
// irrelevant — which is the only reason this table is one value per
// level rather than one per position.
_zero[l + 1] = keccak256(abi.encodePacked(bytes1(0x01), _zero[l], _zero[l]));
}
for (uint8 t = 1; t <= TREE_COUNT; t++) {
liveRoot[t] = _zero[DEPTH];
}
}
// ------------------------------------------------------- configuration
/**
* @dev The configuration gate: the registry's bootstrap admin alone while
* its window is open, the sealed `ROLE_REGISTRAR` quorum afterwards. The
* same window the registry uses, for the same reason — every roster has to
* be installed by someone before it can install itself — and the same
* quorum, because a threshold is membership by another name: whoever can
* set K to one owns the tree.
*/
function _requireConfigurationAuthority(
bytes32 actionDomain,
bytes32 payloadDigest,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) private {
if (!registry.bootstrapSealed() && msg.sender == registry.bootstrapAdmin()) return;
registry.requireRegistrarQuorum(actionDomain, payloadDigest, anchorBlock, approvals);
}
/**
* @notice Set which role may write a tree and how many approvals it needs.
* @param k Approvals a write needs; `0` leaves the tree unconfigured.
* @param anchorBlock The registrars' roster anchor. Ignored during bootstrap.
* @param approvals The sealed registrar quorum. Empty during bootstrap.
*/
function configureTree(
uint8 treeId,
uint256 role,
uint256 k,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_assertTree(treeId);
_requireConfigurationAuthority(
ACTION_CONFIGURE_TREE, keccak256(abi.encode(treeId, role, k)), anchorBlock, approvals
);
// Refuse a threshold nobody can meet. Register the members first; that
// ordering is the point, not an inconvenience. A 4-of-5 configured
// against three registered co-signers is a tree that reverts on every
// write, and the revert names the threshold rather than the roster.
if (k != 0) {
uint256 live = registry.liveMemberCount(role);
if (live < k) revert ThresholdUnreachable(treeId, live, k);
}
writerRole[treeId] = role;
threshold[treeId] = k;
emit TreeConfigured(treeId, role, k);
}
/**
* @notice Point a tree at the contract allowed to write it directly.
* @dev Same gate as `configureTree`, for the same reason. Setting it to the
* zero address removes the path entirely and leaves the tree quorum-only.
*/
function setTreeWriter(
uint8 treeId,
address writer,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_assertTree(treeId);
_requireConfigurationAuthority(
ACTION_SET_TREE_WRITER, keccak256(abi.encode(treeId, writer)), anchorBlock, approvals
);
treeWriter[treeId] = writer;
emit TreeWriterSet(treeId, writer);
}
/**
* @notice Point `syncIdentities` at the contract that knows the chain set.
* @dev Same gate as `setTreeWriter`. Zero removes the source, after which
* service leaves carry an empty `deployedChains` table.
*/
function setChainSource(
address source,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_CHAIN_SOURCE, keccak256(abi.encode(source)), anchorBlock, approvals
);
chainSource = source;
emit ChainSourceSet(source);
}
/// @notice Point tree 8's branch 3 at the slot-key registry it projects.
function setSlotKeySource(
address source,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_SLOT_KEY_SOURCE, keccak256(abi.encode(source)), anchorBlock, approvals
);
slotKeySource = source;
emit SlotKeySourceSet(source);
}
/// @notice Point tree 8's branch 4 at the endpoint registry it projects.
function setEndpointSource(
address source,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_ENDPOINT_SOURCE, keccak256(abi.encode(source)), anchorBlock, approvals
);
endpointSource = source;
emit EndpointSourceSet(source);
}
/**
* @notice Take over the previous plane's counters — one `treeVersion` per
* tree (index = treeId, 0 unused) and the published `round` — so a
* redeploy is monotonic for every consumer that compares them
* (rings, explorers, the round feed). NO-WIPE redeploy, ruled
* 2026-09-03. Past rounds' roots stay on the old plane:
* `roundRootAt` below the seed answers zero.
* @dev Configuration authority (bootstrap admin before the seal, registrar
* quorum after), and only while this plane has published nothing.
*/
function seedCounters(
uint64[] calldata versions,
uint64 round_,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SEED_COUNTERS, keccak256(abi.encode(versions, round_)), anchorBlock, approvals
);
if (versions.length != TREE_COUNT + 1) revert VersionCountMismatch(versions.length);
if (round != 0) revert NotFresh();
for (uint8 t = 1; t <= TREE_COUNT; t++) {
if (treeVersion[t] != 0) revert NotFresh();
}
for (uint8 t = 1; t <= TREE_COUNT; t++) {
treeVersion[t] = versions[t];
}
round = round_;
emit CountersSeeded(round_, versions);
}
/// @notice Install the records contract that writes the typed trees.
function setTypedWriter(
address writer,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_requireConfigurationAuthority(
ACTION_SET_TYPED_WRITER, keccak256(abi.encode(writer)), anchorBlock, approvals
);
typedWriter = writer;
emit TypedWriterSet(writer);
}
/**
* @notice Write configuration rows into a tree's branch 0.
* @param treeId The tree whose owning service the rows configure.
* @param keys `configKey(name, sub)` per row.
* @param values One word per row — a duration, a count, an address, a
* flag; the reader knows the shape from the name.
*
* @dev The configuration authority, not the tree's writer or quorum: a
* tree's writer states what its domain verified, its quorum attests to
* what it read, and neither is the authority over how the service that
* feeds it is configured. The value is stored beside the hash so a
* contract on this chain reads it in one call (`configValue`) while the
* same row is provable off chain against the round root — one source for
* the fleet, the contracts and the explorer, where the fleet's environment
* used to be a second one.
*/
function setConfig(
uint8 treeId,
bytes32[] calldata keys,
bytes32[] calldata values,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_assertTree(treeId);
if (keys.length != values.length || keys.length == 0) revert LengthMismatch(keys.length, values.length);
_requireConfigurationAuthority(
ACTION_SET_CONFIG, keccak256(abi.encode(treeId, keys, values)), anchorBlock, approvals
);
for (uint256 i = 0; i < keys.length; i++) {
_configValue[treeId][keys[i]] = values[i];
_set(treeId, BRANCH_CONFIG, keys[i], configLeafHash(treeId, keys[i], values[i]));
emit ConfigSet(treeId, keys[i], values[i]);
}
_bump(treeId, keys.length);
}
// ------------------------------------------------------------- writing
/**
* @notice Write leaves into one branch of one tree under a PQ quorum.
* @param treeId Which tree.
* @param branch Which branch — never 0, which `setConfig` alone writes.
* @param keys Domain keys — a wallet address for accounts, an asset id for
* the allowlist, whatever identifies a row in that domain. Each gets
* a permanent slot in the branch on first write.
* @param leaves The raw (untagged) leaf values.
* @param approvals At least `threshold[treeId]` of them, ascending by signer.
*
* @dev The digest binds the tree, its nonce, and the full batch. Binding the
* nonce is what stops the same approved batch being replayed: without it,
* an approval to set a price is an approval to set that price again at any
* later block, which for an oracle is the whole attack.
*
* ML-DSA-87 is required rather than accepted. These are operational,
* high-cadence writes — the transaction class — and leaving the choice open
* would mean a break in either scheme takes the tree.
*/
function setLeaves(
uint8 treeId,
uint8 branch,
bytes32[] calldata keys,
bytes32[] calldata leaves,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
_assertTree(treeId);
_assertDataBranch(treeId, branch);
if (treeId == TREE_PHI || treeId == TREE_VASSET || treeId == TREE_ORACLE) {
revert TypedTreeOnly(treeId);
}
// Trees 7 and 8 have their own rulers and NO quorum path at all: an
// intent's status is what `FinalIntentLog` verified, an identity is
// what the registry or the ledger verified, and no set of service
// signatures can make a different answer true.
if (treeId == TREE_INTENTS || treeId == TREE_IDENTITY) revert WriterOnlyTree(treeId);
if (keys.length != leaves.length) revert LengthMismatch(keys.length, leaves.length);
uint256 k = threshold[treeId];
if (k == 0) revert TreeNotConfigured(treeId);
uint64 n = nonce[treeId];
FinalPqQuorum.require_(
registry,
approvals,
FinalPqQuorum.digest(
address(this),
ACTION_SET_LEAVES,
anchorBlock,
keccak256(abi.encode(treeId, branch, n, keys, leaves))
),
writerRole[treeId],
k,
FinalPqQuorum.ALG_ML_DSA_87,
anchorBlock,
false
);
nonce[treeId] = n + 1;
for (uint256 i = 0; i < keys.length; i++) {
_set(treeId, branch, keys[i], leaves[i]);
}
_bump(treeId, keys.length);
}
/// @notice One chain an account exists on, and as what.
/// @dev `chainRef` is the registry's CAIP-derived chain reference — the one
/// identifier that names an EVM chain and a non-EVM one alike — and
/// `account` is the wallet's account there, in that chain's own account
/// space (an EVM address right-aligned, a 32-byte key filling the
/// width). Field-for-field with `IWalletTypes.ChainAccount`.
struct ChainAccount {
bytes32 chainRef;
bytes32 account;
}
/// @notice `FinalWalletFactory.AccountStateLeaf`, field for field.
struct AccountStateLeaf {
address wallet;
bytes32 liveAccess;
bytes32 liveTransaction;
bytes32 recoveryAccess;
bytes32 recoveryTransaction;
/// @dev Active-stage encapsulation commitment and its pre-committed
/// successor. Field-for-field with `FinalWalletFactory.AccountStateLeaf`;
/// a field added on one side and not the other is a root every execution
/// chain rejects, with nothing pointing at the cause.
bytes32 liveKem;
bytes32 recoveryKem;
address owner;
bool pqEnabled;
bool frozen;
/// @dev The chains this account exists on, and its account on each —
/// including chains whose accounts are not EVM addresses. Decided HERE
/// (set by the holder through the ledger) and enforced there: an
/// execution chain refuses to create the account unless the table has a
/// row for it, and a settlement toward a chain with no row is refused at
/// the source. This is what a zero beneficiary resolves through; it
/// replaced a bitmask over registry slots that could only say "may
/// exist", never "as what".
ChainAccount[] deployedChains;
/// @dev Per-chain dormancy verdict, one bit per asset-registry chain
/// slot. Keeps the slot space the bitmask had.
uint32 dormantChains;
uint64 version;
}
/**
* @notice Write account state into tree 1 from the typed leaf.
* @dev The typed form exists so the leaf preimage is built HERE rather than
* by whoever assembles the calldata. Tree 1 is the source of truth for every
* other chain, and `syncAccountState` will accept any 32 bytes that carry a
* valid proof — so if the publisher chose the preimage, the publisher could
* write an account state that no wallet record on this chain agrees with,
* and the proof would still verify everywhere.
*
* **Sealed.** Tree 1 is membership: a leaf here is who an account is, on
* every chain. So the round takes the hybrid class — each approval carries
* the ML-DSA-87 vote AND the member's SLH-DSA seal — where the other trees
* take the transaction class alone. A lattice break rewrites a price; it
* does not rewrite an account.
*/
function setAccountStates(
AccountStateLeaf[] calldata leaves,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
uint256 k = threshold[TREE_ACCOUNTS];
if (k == 0) revert TreeNotConfigured(TREE_ACCOUNTS);
bytes32[] memory keys = new bytes32[](leaves.length);
bytes32[] memory hashes = new bytes32[](leaves.length);
for (uint256 i = 0; i < leaves.length; i++) {
keys[i] = accountKeyFor(leaves[i].wallet);
hashes[i] = accountStateLeafHash(leaves[i]);
}
uint64 n = nonce[TREE_ACCOUNTS];
FinalPqQuorum.require_(
registry,
approvals,
FinalPqQuorum.digest(
address(this),
ACTION_SET_LEAVES,
anchorBlock,
keccak256(abi.encode(TREE_ACCOUNTS, n, keys, hashes))
),
writerRole[TREE_ACCOUNTS],
k,
FinalPqQuorum.ALG_ML_DSA_87,
anchorBlock,
true
);
nonce[TREE_ACCOUNTS] = n + 1;
for (uint256 i = 0; i < leaves.length; i++) {
_set(TREE_ACCOUNTS, BRANCH_MAIN, keys[i], hashes[i]);
}
_bump(TREE_ACCOUNTS, leaves.length);
}
/**
* @notice Write account state into tree 1 from the contract that owns it.
* @dev No quorum, and no nonce burned: `treeWriter[1]` is the ledger, and
* the ledger already verified the holder's own signature before it called
* here. See {treeWriter} for why adding a service quorum on top would be a
* censorship power rather than a safeguard.
*
* Typed, exactly as `setAccountStates` is: the preimage is built HERE, so
* even the writer contract cannot publish a leaf whose meaning no record on
* this chain agrees with.
*/
function setAccountStatesAsWriter(AccountStateLeaf[] calldata leaves) external {
if (msg.sender != treeWriter[TREE_ACCOUNTS]) revert NotAuthorized(msg.sender);
for (uint256 i = 0; i < leaves.length; i++) {
_set(TREE_ACCOUNTS, BRANCH_MAIN, accountKeyFor(leaves[i].wallet), accountStateLeafHash(leaves[i]));
}
_bump(TREE_ACCOUNTS, leaves.length);
}
/**
* @notice Write raw leaves into any tree from the contract that owns it.
* @dev The generic sibling of {setAccountStatesAsWriter}, for a tree whose
* writer is a contract rather than a service quorum. Same authorization —
* `treeWriter[treeId]` and nothing else — and the same reasoning: the
* writer has already verified whatever its domain requires, and layering a
* quorum on top of a contract's own rules is a censorship power rather
* than a safeguard.
*
* UNTYPED, unlike the account path, and that is the trade. Tree 1's
* preimage is built here so even the ledger cannot publish a leaf whose
* meaning no record agrees with; a generic writer supplies its own hash,
* so the leaf means whatever that contract says it means. Acceptable only
* because the writer is a specific contract this chain's operators
* installed — its rules are its bytecode, it has no owner and no proxy —
* and NOT acceptable for a role-gated key. Point `treeWriter` at a
* contract, never at an EOA.
*/
function setLeavesAsWriter(uint8 treeId, uint8 branch, bytes32[] calldata keys, bytes32[] calldata leaves)
external
{
if (msg.sender != treeWriter[treeId]) revert NotAuthorized(msg.sender);
_assertDataBranch(treeId, branch);
if (keys.length != leaves.length) revert LengthMismatch(keys.length, leaves.length);
for (uint256 i = 0; i < keys.length; i++) {
_set(treeId, branch, keys[i], leaves[i]);
}
_bump(treeId, keys.length);
}
/// @notice The leaf hash `FinalWalletFactory.accountStateLeafHash` computes.
/// @dev Identical `abi.encode`, identical field order, identical domain.
/// Pinned against the factory by test. `deployedChains` rides through
/// `abi.encode` like every other field — head offset, then length and
/// rows — so the table is committed whole and in order.
function accountStateLeafHash(AccountStateLeaf memory leaf) public pure returns (bytes32) {
_assertChainAccounts(leaf.deployedChains);
return keccak256(
abi.encode(
DOMAIN_ACCOUNT_STATE_LEAF,
leaf.wallet,
leaf.liveAccess,
leaf.liveTransaction,
leaf.recoveryAccess,
leaf.recoveryTransaction,
leaf.liveKem,
leaf.recoveryKem,
leaf.owner,
leaf.pqEnabled,
leaf.frozen,
leaf.deployedChains,
leaf.dormantChains,
leaf.version
)
);
}
/// @dev A well-formed table: no zero chain, no zero account, no chain twice.
/// Checked where the leaf is hashed so no door — quorum, writer
/// contract, identity projection — can publish a table a resolver
/// would read two ways.
function _assertChainAccounts(ChainAccount[] memory rows) private pure {
for (uint256 i = 0; i < rows.length; i++) {
if (rows[i].chainRef == bytes32(0) || rows[i].account == bytes32(0)) {
revert InvalidChainAccount(rows[i].chainRef, rows[i].account);
}
for (uint256 j = 0; j < i; j++) {
if (rows[j].chainRef == rows[i].chainRef) {
revert InvalidChainAccount(rows[i].chainRef, rows[i].account);
}
}
}
}
/// @notice The account `wallet`'s published table names on `chainRef`, or
/// zero if it has no row there.
/// @dev A convenience over `accountStateLeafHash`'s input for readers on
/// this chain; execution chains answer the same question from their synced
/// record (`FinalWalletFactory.addressOn`).
function accountOn(AccountStateLeaf memory leaf, bytes32 chainRef) public pure returns (bytes32) {
for (uint256 i = 0; i < leaf.deployedChains.length; i++) {
if (leaf.deployedChains[i].chainRef == chainRef) return leaf.deployedChains[i].account;
}
return bytes32(0);
}
/**
* @notice The typed trees' write door — `FinalStateRecords` alone.
* @dev The quorum, the nonce and the write, shared by every typed record.
* The records contract computed the keys and hashes from the structs it
* stores; this contract admits nobody else to trees 2, 3 and 4
* (`setLeaves` refuses them), so the value there can never drift from
* the commitment here.
*
* The digest is byte-identical to `setLeaves`' over the same keys and
* hashes, deliberately: the typed entrypoints choose the PREIMAGE, not the
* authorization. A member recomputes one digest whichever door the batch
* came through, and there is no second approval shape to get wrong.
*/
function writeTyped(
uint8 treeId,
bytes32[] memory keys,
bytes32[] memory hashes,
uint64 anchorBlock,
FinalPqQuorum.Approval[] calldata approvals
) external {
if (msg.sender != typedWriter) revert NotAuthorized(msg.sender);
uint256 k = threshold[treeId];
if (k == 0) revert TreeNotConfigured(treeId);
uint64 n = nonce[treeId];
FinalPqQuorum.require_(
registry,
approvals,
FinalPqQuorum.digest(
address(this),
ACTION_SET_LEAVES,
anchorBlock,
keccak256(abi.encode(treeId, n, keys, hashes))
),
writerRole[treeId],
k,
FinalPqQuorum.ALG_ML_DSA_87,
anchorBlock,
false
);
nonce[treeId] = n + 1;
for (uint256 i = 0; i < keys.length; i++) {
_set(treeId, BRANCH_MAIN, keys[i], hashes[i]);
}
_bump(treeId, keys.length);
}
/**
* @notice Snapshot every tree's root into a new round.
* @dev Permissionless, deliberately. Every root being snapshotted was
* already authorized by its tree's quorum, so this adds no authority — it
* only fixes a moment. Requiring a signature would put a liveness
* dependency in front of publication for no security gain.
*
* A round that would change nothing is refused, so the round number cannot
* be advanced by anyone with gas to spend.
*/
function publishRound() external returns (uint64 published) {
bool changed;
for (uint8 t = 1; t <= TREE_COUNT; t++) {
if (treeVersion[t] != _publishedVersion[t]) {
changed = true;
break;
}
}
if (!changed) revert NothingToPublish();
published = round + 1;
Round storage r = _rounds[published];
for (uint8 t = 1; t <= TREE_COUNT; t++) {
r.roots[t] = liveRoot[t];
_publishedVersion[t] = treeVersion[t];
}
r.roundRoot = _foldForest(_forestLeaves(r.roots));
r.blockNumber = uint64(block.number);
// MILLISECONDS, like every instant on this chain.
r.timestamp = FinalChainTime.nowMs();
round = published;
emit RoundPublished(published, r.blockNumber, r.timestamp);
}
// ---------------------------------------------------------------- views
/// @notice Every root from one round. Index by the `TREE_*` constants;
/// index 0 is unused.
function rootsAt(uint64 which) external view returns (bytes32[TREE_COUNT + 1] memory) {
return _rounds[which].roots;
}
/// @notice One tree's root at one round.
function rootAt(uint64 which, uint8 treeId) external view returns (bytes32) {
_assertTree(treeId);
return _rounds[which].roots[treeId];
}
/// @notice The one word that commits to every tree at one round.
function roundRootAt(uint64 which) external view returns (bytes32) {
return _rounds[which].roundRoot;
}
/**
* @notice The `FOREST_BITS` siblings that take a tree's root at one round
* up to that round's root — appended to `proofFor`, they make a
* leaf provable against `roundRootAt(which)` by the same verifier.
*/
function roundProofFor(uint64 which, uint8 treeId) external view returns (bytes32[] memory path) {
_assertTree(treeId);
if (which == 0 || which > round) revert NoRounds();
bytes32[] memory level = _forestLeaves(_rounds[which].roots);
path = new bytes32[](FOREST_BITS);
uint256 idx = treeId;
uint256 n = level.length;
for (uint256 l = 0; l < FOREST_BITS; l++) {
path[l] = level[idx ^ 1];
n >>= 1;
for (uint256 i = 0; i < n; i++) {
level[i] = _pair(level[2 * i], level[2 * i + 1]);
}
idx >>= 1;
}
}
/// @notice The latest round's roots, with the block it was taken at.
function latestRound()
external
view
returns (uint64 which, bytes32[TREE_COUNT + 1] memory roots, uint64 blockNumber, uint64 timestamp)
{
which = round;
if (which == 0) revert NoRounds();
Round storage r = _rounds[which];
return (which, r.roots, r.blockNumber, r.timestamp);
}
/// @notice The raw leaf stored for a key, and whether it has a slot.
function leafOf(uint8 treeId, bytes32 key) external view returns (bytes32 leaf, bool present) {
uint256 s = _slotPlusOne[treeId][key];
if (s == 0) return (bytes32(0), false);
return (_leaf[treeId][s - 1], true);
}
/// @notice The permanent slot for a key. Reverts if it has none. The
/// slot's top `BRANCH_BITS` are its branch.
function slotOf(uint8 treeId, bytes32 key) public view returns (uint256) {
uint256 s = _slotPlusOne[treeId][key];
if (s == 0) revert UnknownKey(treeId, key);
return s - 1;
}
/// @notice The key a slot was handed to, or zero if it is still free —
/// the enumeration every branch offers: slots `branch << BRANCH_DEPTH`
/// through `+ branchSlotsUsed(treeId, branch) - 1`.
function keyAt(uint8 treeId, uint256 slot) external view returns (bytes32) {
return _keyAt[treeId][slot];
}
/// @notice Slots handed out in one branch.
function branchSlotsUsed(uint8 treeId, uint8 branch) external view returns (uint256) {
return _branchSlotsUsed[treeId][branch];
}
/// @notice One branch's root: the level-`BRANCH_DEPTH` node at its position.
function branchRoot(uint8 treeId, uint8 branch) external view returns (bytes32) {
_assertTree(treeId);
_assertBranch(branch);
return _nodeAt(treeId, BRANCH_DEPTH, branch);
}
/// @notice The first `BRANCH_DEPTH` siblings of `proofFor` — a proof
/// against the leaf's branch root rather than the tree root.
function branchProofFor(uint8 treeId, bytes32 key) external view returns (bytes32[] memory) {
_assertTree(treeId);
return _path(treeId, slotOf(treeId, key), BRANCH_DEPTH);
}
/// @notice A configuration row's value, and whether the row exists.
function configValue(uint8 treeId, bytes32 key) external view returns (bytes32 value, bool present) {
present = _slotPlusOne[treeId][key] != 0;
value = _configValue[treeId][key];
}
/// @notice The branch-0 key of a configuration row: a name the owning
/// service defines, and a sub-key (a chain reference, an asset, zero).
function configKey(bytes32 name, bytes32 sub) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_CONFIG_KEY, name, sub));
}
/// @notice The leaf a configuration row hashes to.
function configLeafHash(uint8 treeId, bytes32 key, bytes32 value) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_CONFIG_LEAF, treeId, key, value));
}
/// @notice The tree-8 branch-2 key an owner occupies.
function ownerIndexKeyFor(address owner) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_OWNER_INDEX_KEY, owner));
}
/// @notice The owner-index leaf: a commitment to the ledger's ordered
/// `walletsByOwner(owner)`.
function ownerIndexLeafHash(address owner, address[] memory wallets) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_OWNER_INDEX_LEAF, owner, wallets));
}
/// @notice The tree-8 branch-3 key of one member's slot — a ring position.
function slotKeyFor(address member, uint64 slotIndex) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_SLOT_KEY, member, slotIndex % SLOT_KEY_RING));
}
/**
* @notice Project slot keys into tree 8's branch 3 — the co-signers'
* per-slot KEM publics the private option seals to.
* @dev Permissionless, for {syncIdentityLeaves}' reason: the leaf VALUE
* is `slotKeySource`'s own verdict (the registry verified the member's
* signature when the key was published, and answers zero once the slot's
* window has passed), so this adds no authority and only projects. The
* registry calls it same-tx on publication; anyone may call it to retire a
* slot that lapsed by time.
*/
function syncSlotKeyLeaves(address member, uint64[] calldata slotIndexes) external {
address source = slotKeySource;
if (source == address(0)) revert SlotKeySourceUnset();
for (uint256 i = 0; i < slotIndexes.length; i++) {
_set(
TREE_IDENTITY,
BRANCH_SLOT_KEYS,
slotKeyFor(member, slotIndexes[i]),
ISlotKeySource(source).slotKeyLeafOf(member, slotIndexes[i])
);
}
_bump(TREE_IDENTITY, slotIndexes.length);
}
/// @notice The tree-8 branch-4 key of one tunnel endpoint.
function endpointKeyFor(bytes32 endpointId) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_ENDPOINT_KEY, endpointId));
}
/**
* @notice Project tunnel endpoints into tree 8's branch 4.
* @dev Permissionless, for {syncSlotKeyLeaves}' reason: the leaf VALUE is
* `endpointSource`'s own verdict — the registry admitted the certificate
* under the registrar quorum with the holder's proof of possession, and
* answers the revoked status once it is revoked — so this adds no authority
* and only projects. The registry calls it same-tx on registration and
* revocation; anyone may call it to re-project.
*/
function syncEndpointLeaves(bytes32[] calldata endpointIds) external {
address source = endpointSource;
if (source == address(0)) revert EndpointSourceUnset();
for (uint256 i = 0; i < endpointIds.length; i++) {
_set(
TREE_IDENTITY,
BRANCH_ENDPOINTS,
endpointKeyFor(endpointIds[i]),
IEndpointSource(source).endpointLeafOf(endpointIds[i])
);
}
_bump(TREE_IDENTITY, endpointIds.length);
}
/**
* @notice The sibling path for a key, ready for
* `FinalMerkle.verifyTaggedSortedProof` on any chain.
* @dev A view, so the backend fetches a proof with one `eth_call` instead of
* rebuilding the tree off chain. Rebuilding is where a divergence between
* what the chain holds and what a service believes it holds would come
* from, and this removes the second implementation entirely.
*/
function proofFor(uint8 treeId, bytes32 key) external view returns (bytes32[] memory) {
_assertTree(treeId);
return _path(treeId, slotOf(treeId, key), DEPTH);
}
/// @notice The empty-subtree hash at a level. Level `DEPTH` is the root of
/// a tree with nothing in it.
function emptyRoot(uint256 level) external view returns (bytes32) {
return _zero[level];
}
/// @notice The tree-1 key a wallet occupies.
function accountKeyFor(address wallet) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_ACCOUNT_KEY, wallet));
}
/**
* @notice Copy a registered identity into tree 1 as an account-state leaf.
* @dev Services are Final Wallets, so a service's leaf is the SAME leaf a
* user's wallet gets — `FinalWalletFactory.AccountStateLeaf`, four key
* commitments and all. There is no second shape and no second domain,
* which is what lets every chain that already consumes account state
* consume a co-signer's identity with no contract change.
*
* `owner` is the account itself: a service wallet is its own owner, having
* no separate holder to speak for it.
*
* Permissionless, and for the same reason `publishRound` is: every fact it
* writes was already authorized when it entered the registry, so this adds
* no authority and only projects. Gating it would put a liveness dependency
* in front of publishing a revocation, which is the one thing that must
* never wait.
*/
function syncIdentities(address[] calldata accounts) external {
// One table for the batch: a service is its own canonical address on
// every enabled chain, so the rows differ only in `account`.
bytes32[] memory chainRefs = _enabledChainRefs();
for (uint256 i = 0; i < accounts.length; i++) {
address who = accounts[i];
FinalIdentityRegistry.Identity memory id = registry.identityOf(who);
if (!id.registered) revert UnknownKey(TREE_ACCOUNTS, accountKeyFor(who));
(bytes32 la, bytes32 lt, bytes32 ra, bytes32 rt) = registry.keyCommitments(who);
(bytes32 lk, bytes32 rk) = registry.kemCommitments(who);
ChainAccount[] memory table = new ChainAccount[](chainRefs.length);
for (uint256 c = 0; c < chainRefs.length; c++) {
table[c] = ChainAccount({chainRef: chainRefs[c], account: bytes32(uint256(uint160(who)))});
}
AccountStateLeaf memory leaf = AccountStateLeaf({
wallet: who,
liveAccess: la,
liveTransaction: lt,
recoveryAccess: ra,
recoveryTransaction: rt,
liveKem: lk,
recoveryKem: rk,
// A service reaches every chain the registry has enabled, at
// its own address, and is never dormant: dormancy measures an
// ABSENT holder, and these identities have no holder to be
// absent.
deployedChains: table,
dormantChains: 0,
owner: who,
// Every identity here is PQ by construction — there is no other
// kind of key in this registry.
pqEnabled: true,
// Revocation is a leaf that CHANGES, not one that disappears.
// A consumer holding an old proof gets a stale `false`, which is
// why the round is the thing to pin.
frozen: id.revoked,
version: id.version
});
_set(TREE_ACCOUNTS, BRANCH_MAIN, accountKeyFor(who), accountStateLeafHash(leaf));
}
_bump(TREE_ACCOUNTS, accounts.length);
}
/// @notice The tree-8 slot key an identity occupies.
function identityKeyFor(address account) public pure returns (bytes32) {
return keccak256(abi.encode(DOMAIN_IDENTITY_TREE_KEY, account));
}
/**
* @notice Project identities into tree 8 — the wallet-creation admission
* set whose live root every execution chain anchors as its
* `currentIdentityRoot`.
*
* @dev The leaf VALUE is the registry's own verdict —
* `FinalIdentityRegistry.identityTreeLeafOf`: the execution chains'
* identity leaf while the identity stands, zero once it does not. Derived
* there rather than here because every input (serial, the six key
* commitments, standing, the CA depth pair) is registry storage, and this
* contract sits against EIP-170 while the registry does not.
*
* Permissionless, for exactly {syncIdentities}' reason: every fact
* written here was authorized when it entered the registry, so this adds
* no authority and only projects. The registry itself calls it same-tx on
* every identity mutation (register, rotate, roles, revoke, LMS-key ops),
* which is what makes the root CONTINUOUS; the open door additionally lets
* anyone retire a leaf whose standing lapsed by TIME — expiry moves no
* registry storage, so no mutation hook can ever fire for it.
*
* There is no quorum door and no writer seat (both raw doors refuse this
* tree), so the strongest thing any caller can do here is copy the
* registry's own verdict.
*/
function syncIdentityLeaves(address[] calldata accounts) external {
for (uint256 i = 0; i < accounts.length; i++) {
_set(TREE_IDENTITY, BRANCH_MAIN, identityKeyFor(accounts[i]), registry.identityTreeLeafOf(accounts[i]));
}
_bump(TREE_IDENTITY, accounts.length);
}
/**
* @notice Per-tree quorum health: can each configured tree still be written?
* @dev A threshold above the live member count is not a strict quorum, it is
* a tree that reverts forever with nothing naming the roster as the cause.
* `configureTree` refuses to create that state, but revocation can arrive at
* it later — revocation must never be blocked on quorum arithmetic, so the
* check has to be something monitoring reads rather than something the
* contract enforces after the fact.
*/
function quorumHealth()
external
view
returns (uint256[] memory live, uint256[] memory required, bool[] memory ok)
{
live = new uint256[](TREE_COUNT + 1);
required = new uint256[](TREE_COUNT + 1);
ok = new bool[](TREE_COUNT + 1);
for (uint8 t = 1; t <= TREE_COUNT; t++) {
required[t] = threshold[t];
live[t] = required[t] == 0 ? 0 : registry.liveMemberCount(writerRole[t]);
ok[t] = required[t] == 0 || live[t] >= required[t];
}
}
// -------------------------------------------------------------- internal
/// @dev The enabled chain references `chainSource` knows, or none if it is
/// unset. Read through the narrow interface so this contract need not
/// import the registry that imports it.
function _enabledChainRefs() private view returns (bytes32[] memory) {
address source = chainSource;
if (source == address(0)) return new bytes32[](0);
return IChainSource(source).enabledChainRefs();
}
function _assertTree(uint8 treeId) private pure {
if (treeId == 0 || treeId > TREE_COUNT) revert UnknownTree(treeId);
}
function _assertBranch(uint8 branch) private pure {
if (branch >= BRANCH_COUNT) revert UnknownBranch(branch);
}
/// @dev A branch a quorum or a writer may write: any but the config branch.
function _assertDataBranch(uint8 treeId, uint8 branch) private pure {
_assertBranch(branch);
if (branch == BRANCH_CONFIG) revert ConfigBranchReserved(treeId);
}
/// @dev Version + event, the tail of every write door.
function _bump(uint8 treeId, uint256 count) private {
uint64 v = treeVersion[treeId] + 1;
treeVersion[treeId] = v;
emit LeavesSet(treeId, count, liveRoot[treeId], v);
}
/// @dev `keccak256(0x01 ‖ lo ‖ hi)`, the pair sorted — the one node hash.
function _pair(bytes32 a, bytes32 b) private pure returns (bytes32) {
(bytes32 lo, bytes32 hi) = a < b ? (a, b) : (b, a);
return keccak256(abi.encodePacked(bytes1(0x01), lo, hi));
}
/// @dev The sibling path from a slot up `height` levels.
function _path(uint8 treeId, uint256 idx, uint256 height) private view returns (bytes32[] memory path) {
path = new bytes32[](height);
for (uint256 l = 0; l < height; l++) {
path[l] = _nodeAt(treeId, l, idx ^ 1);
idx >>= 1;
}
}
/// @dev The forest's leaves: the tree roots at their positions, the
/// empty tree at the rest.
function _forestLeaves(bytes32[TREE_COUNT + 1] memory roots) private view returns (bytes32[] memory level) {
level = new bytes32[](1 << FOREST_BITS);
for (uint256 p = 0; p < level.length; p++) {
level[p] = (p >= 1 && p <= TREE_COUNT) ? roots[p] : _zero[DEPTH];
}
}
/// @dev Fold a power-of-two level to its root, in place.
function _foldForest(bytes32[] memory level) private pure returns (bytes32) {
for (uint256 n = level.length; n > 1; n >>= 1) {
for (uint256 i = 0; i < n / 2; i++) {
level[i] = _pair(level[2 * i], level[2 * i + 1]);
}
}
return level[0];
}
function _set(uint8 treeId, uint8 branch, bytes32 key, bytes32 leaf) private {
uint256 s = _slotPlusOne[treeId][key];
uint256 idx;
if (s == 0) {
uint256 used = _branchSlotsUsed[treeId][branch];
if (used >= BRANCH_CAPACITY) revert BranchFull(treeId, branch);
idx = (uint256(branch) << BRANCH_DEPTH) | used;
_branchSlotsUsed[treeId][branch] = used + 1;
slotsUsed[treeId] += 1;
_slotPlusOne[treeId][key] = idx + 1;
_keyAt[treeId][idx] = key;
} else {
idx = s - 1;
uint8 have = uint8(idx >> BRANCH_DEPTH);
if (have != branch) revert BranchMismatch(treeId, key, have, branch);
}
_leaf[treeId][idx] = leaf;
bytes32 cursor = keccak256(abi.encodePacked(bytes1(0x00), leaf));
for (uint256 l = 0; l < DEPTH; l++) {
cursor = _pair(cursor, _nodeAt(treeId, l, idx ^ 1));
idx >>= 1;
_node[treeId][l + 1][idx] = cursor;
}
liveRoot[treeId] = cursor;
}
/// @dev Level 0 is derived from the leaf store rather than duplicated into
/// `_node`, so there is one place a leaf lives and no way for the two to
/// disagree. Unset positions fall through to the empty-subtree hash.
function _nodeAt(uint8 treeId, uint256 level, uint256 index) private view returns (bytes32) {
if (level == 0) {
return keccak256(abi.encodePacked(bytes1(0x00), _leaf[treeId][index]));
}
bytes32 v = _node[treeId][level][index];
return v == bytes32(0) ? _zero[level] : v;
}
}
abi
[
{
"type": "constructor",
"inputs": [
{
"name": "registry_",
"type": "address",
"internalType": "contract FinalIdentityRegistry"
},
{
"name": "trees_",
"type": "address",
"internalType": "contract FinalStateTrees"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "ACTION_SEED_SEQUENCE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "ACTION_SET_BOND_POLICY",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "ACTION_SET_CONSUMER",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "BRANCH_MAIN_ID",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "CONFIG_SCHEDULE_LEAD_MS",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DEFAULT_SCHEDULE_LEAD_MS",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DOMAIN_INTENT_APPROVE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DOMAIN_INTENT_CANCEL",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DOMAIN_INTENT_KEY",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DOMAIN_INTENT_STATUS_LEAF",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "EXECUTION_WINDOW",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "FLAG_AUTO_APPROVE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "HEADER_VERSION",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "HEADER_VERSION_MAX",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "INTENT_SLOT_RING",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "MAX_SCHEDULE_HORIZON",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "STATUS_APPROVED",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "STATUS_CANCELLED",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "STATUS_CONSUMED",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "STATUS_POSTED",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "TREE_INTENTS_ID",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "approve",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "publicKey",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "executorSection",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "bondForfeitTo",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "bondOf",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "payer",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint88",
"internalType": "uint88"
},
{
"name": "settled",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "bondWei",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "cancel",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "publicKey",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "claimBond",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "consume",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "consumer",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "envelopeOf",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "header",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "ciphertext",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "executorSection",
"type": "bytes",
"internalType": "bytes"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "forfeitBond",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "intentSlotKey",
"inputs": [
{
"name": "seq",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "intentStatusLeaf",
"inputs": [
{
"name": "intentLeaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "status",
"type": "uint8",
"internalType": "uint8"
},
{
"name": "postedAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "executeNotBefore",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "targetChainRef",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "bodyCommitment",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "seq",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "isConsumable",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "isOpen",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "leafAt",
"inputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "post",
"inputs": [
{
"name": "header",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "ciphertext",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "postSeq",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "postedOf",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "postedAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "executeNotBefore",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "consumedAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "bodyCommitment",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "approvalKeyCommit",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "targetChainRef",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "approvedAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "cancelledAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "seq",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "flags",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "registry",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract FinalIdentityRegistry"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "scheduleLeadMsOf",
"inputs": [
{
"name": "targetChainRef",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "seedSequence",
"inputs": [
{
"name": "postSeq_",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "anchorBlock",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "approvals",
"type": "tuple[]",
"internalType": "struct FinalPqQuorum.Approval[]",
"components": [
{
"name": "signer",
"type": "address",
"internalType": "address"
},
{
"name": "algorithm",
"type": "uint8",
"internalType": "uint8"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "seal",
"type": "bytes",
"internalType": "bytes"
}
]
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "setBondPolicy",
"inputs": [
{
"name": "newBondWei",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "forfeitTo",
"type": "address",
"internalType": "address"
},
{
"name": "anchorBlock",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "approvals",
"type": "tuple[]",
"internalType": "struct FinalPqQuorum.Approval[]",
"components": [
{
"name": "signer",
"type": "address",
"internalType": "address"
},
{
"name": "algorithm",
"type": "uint8",
"internalType": "uint8"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "seal",
"type": "bytes",
"internalType": "bytes"
}
]
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "setConsumer",
"inputs": [
{
"name": "newConsumer",
"type": "address",
"internalType": "address"
},
{
"name": "anchorBlock",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "approvals",
"type": "tuple[]",
"internalType": "struct FinalPqQuorum.Approval[]",
"components": [
{
"name": "signer",
"type": "address",
"internalType": "address"
},
{
"name": "algorithm",
"type": "uint8",
"internalType": "uint8"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "seal",
"type": "bytes",
"internalType": "bytes"
}
]
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "trees",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract FinalStateTrees"
}
],
"stateMutability": "view"
},
{
"type": "event",
"name": "BondForfeited",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "payer",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "BondPolicySet",
"inputs": [
{
"name": "bondWei",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "forfeitTo",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "BondPosted",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "payer",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "BondRefunded",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "payer",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "ConsumerSet",
"inputs": [
{
"name": "consumer",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "IntentApproved",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "executorSectionBytes",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "IntentCancelled",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
}
],
"anonymous": false
},
{
"type": "event",
"name": "IntentConsumed",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "by",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "IntentPosted",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "targetChainRef",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "executeNotBefore",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
},
{
"name": "deadline",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
},
{
"name": "flags",
"type": "uint8",
"indexed": false,
"internalType": "uint8"
},
{
"name": "headerBytes",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "ciphertextBytes",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "SequenceSeeded",
"inputs": [
{
"name": "postSeq",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "error",
"name": "AlreadyApproved",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "at",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "AlreadyConsumed",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "at",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "AlreadyPosted",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "ApprovalKeyCommitRequired",
"inputs": []
},
{
"type": "error",
"name": "ApprovalSignatureInvalid",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "AutoApproveTakesNoCommitment",
"inputs": [
{
"name": "approvalKeyCommit",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "BondAlreadySettled",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "BondMismatch",
"inputs": [
{
"name": "required",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "supplied",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "BondNeedsAForfeitDestination",
"inputs": []
},
{
"type": "error",
"name": "BondNotForfeitable",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "BondNotRefundable",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "BondTransferFailed",
"inputs": [
{
"name": "to",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "ConsumerAlreadySet",
"inputs": [
{
"name": "current",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ConsumerUnset",
"inputs": []
},
{
"type": "error",
"name": "DeadlinePassed",
"inputs": [
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "nowMs",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "DeadlineTooFar",
"inputs": [
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "limit",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "Expired",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "HeaderTooShort",
"inputs": [
{
"name": "length",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "IntentIsCancelled",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "at",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "NoApprovalKey",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "NoBond",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "NotApproved",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "NotAuthorized",
"inputs": [
{
"name": "caller",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "NotConsumer",
"inputs": [
{
"name": "caller",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "NotFresh",
"inputs": []
},
{
"type": "error",
"name": "NotPosted",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "PrecompileUnavailable",
"inputs": [
{
"name": "precompile",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ScheduleTooFar",
"inputs": [
{
"name": "executeNotBefore",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "limit",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "TooEarly",
"inputs": [
{
"name": "leaf",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "executeNotBefore",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "nowMs",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "UnsupportedFlags",
"inputs": [
{
"name": "flags",
"type": "uint8",
"internalType": "uint8"
}
]
},
{
"type": "error",
"name": "UnsupportedHeaderVersion",
"inputs": [
{
"name": "version",
"type": "uint8",
"internalType": "uint8"
}
]
},
{
"type": "error",
"name": "WrongApprovalKey",
"inputs": [
{
"name": "expected",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "got",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "ZeroConsumer",
"inputs": []
},
{
"type": "error",
"name": "ZeroLeaf",
"inputs": []
}
]read contract
bytecode · 12,995 bytes
0x60806040526004361015610011575f80fd5b5f5f3560e01c80630618c724146123b7578063072e6d6d1461074b5780630fb585ba14612368578063116c1af0146122a0578063178bcc931461225c5780632972cd9914611e7757806330a0d08f14611d92578063352e466014611d1257806338fcba7714610dde5780633e65164a14611cf2578063480e7ffa14611cb75780634f26b64b14611c7c5780634f65a32e14611c4157806351c043a714611af4578063581582c714611ad65780635a4e5a1514611aba5780635c0b233014611a3e5780636ee7ab1f14610de357806372efd40514610efa5780637b10399914610eb55780637b8ec02b14610e7a5780637c35be7a14610de85780637cb33ac014610de35780639b76f6bb14610dde5780639ca3efea14610cda578063af6f8c1b146109d6578063b0843d5d14610779578063b4fd729614610750578063b996de661461074b578063b998367714610724578063becec19014610704578063c21a3fa2146105ca578063d085c61a14610592578063d11b201514610566578063d2a26fb01461052b578063d61ec1cd1461050f578063dd759453146104d4578063e01696b1146104b5578063ed8da0011461047a578063f5760fd11461045a578063f63c7bfb1461042a578063f68365b014610401578063ff08fc001461032b578063ff582a04146102f05763ffc7733c14610209575f80fd5b346102ed5760203660031901126102ed576004359081815260046020526040812091825460018060a01b0381169081156102d9578060f81c6102c55782845283602052604084205460c01c156102b1576001600160581b036102ae94958392600160f81b9060018060f81b03161780915560a01c16927f7514b10bc04eb31bd8aa5b8639cb6c21e464040da82dd4e84534cd91f49ac6756020604051868152a361319b565b80f35b6333cb2a1760e21b84526004839052602484fd5b63f920a8ad60e01b84526004839052602484fd5b6303c231f160e21b84526004839052602484fd5b80fd5b50346102ed57806003193601126102ed5760206040517f39efb8a3ddb9a6b5fbbc1efde87859ad508e4acf5b6c2a87ce3a298ccc3c5a008152f35b50346102ed5760603660031901126102ed5761034561245a565b61034d61242e565b604435906001600160401b0382116103fd5761037061039e923690600401612470565b91604051946001600160401b036020870191169586825260208152610396604082612508565b519020612f6d565b6002546001600160401b0381166103ee5767ffffffffffffffff191681176002556040519081527f0b2384dfec7e6ac4cabe32366a33ef1072d076ac41659321348732ffe00b318190602090a180f35b63dc63d81f60e01b8352600483fd5b8380fd5b50346102ed57806003193601126102ed576006546040516001600160a01b039091168152602090f35b50346102ed5760203660031901126102ed5760206104496004356127e3565b6001600160401b0360405191168152f35b50346102ed57806003193601126102ed5750602062100000604051908152f35b50346102ed57806003193601126102ed5760206040517f2efb98c58c1606c2b7524fdfbd55ecb71e0ebbedaef85fb5ceca0b8f4e66b0d98152f35b50346102ed57806003193601126102ed5760405162015f908152602090f35b50346102ed57806003193601126102ed5760206040517f25d67559fc7236429288de0997218a361d6df4de81f842df2e5db075e8643eaa8152f35b50346102ed57806003193601126102ed57602060405160078152f35b50346102ed57806003193601126102ed5760206040517f8613751e8e5a860774fbee33f44b7afcd801513ac5715713f0d65d5fe93554658152f35b50346102ed5760203660031901126102ed57602061058a61058561245a565b612792565b604051908152f35b50346102ed5760203660031901126102ed5760406020916001600160401b036105b961245a565b168152600383522054604051908152f35b50346102ed5760803660031901126102ed57600435906024356001600160a01b038116808203610700576105fc612444565b6064356001600160401b0381116106fc579061061f610651923690600401612470565b60408051602081018a81526001600160a01b03891682840152918152919391610649606082612508565b519020612d6e565b831515806106f4575b6106e5576001600160581b0384116106c6576005849055600680546001600160a01b031916919091179055604080519384526001600160a01b0391909116602084015290917fcb31391f189faeae4cf8cec8849f690db565c748ce3da5987fd102f1bdeda60b9190a180f35b634ba85a6b60e11b83526001600160581b036004526024849052604483fd5b6318f99d4360e31b8352600483fd5b50801561065a565b8480fd5b8280fd5b50346102ed57806003193601126102ed57604051639a7ec8008152602090f35b50346102ed57806003193601126102ed5760206001600160401b0360025416604051908152f35b6123d2565b50346102ed57806003193601126102ed576007546040516001600160a01b039091168152602090f35b50346102ed5760603660031901126102ed57600435816024356001600160401b0381116109c9576107ae9036906004016123ed565b906044356001600160401b0381116103fd57610834916107d3869236906004016123ed565b906107dd8461293e565b9560405160208101907fcc7c08481f764947d6a6fa10f1913f9c489bcbe1ea586c5d4aca3bb0d12f45f682524660408201523060608201528660808201526080815261082a60a082612508565b51902093876129be565b6004810180546fffffffffffffffff000000000000000019164260401b67ffffffffffffffff60401b16178155906040906108f18251916108758484612508565b600183526001600160401b03601f198501958636602087013785519661089b8789612508565b600188523660208901375460801c16906108b482612792565b6108bd85612a67565b5280549060016003820154910154916001600160401b038160801c16906001600160401b0380828a1c16911660048c6126b0565b6108fa84612a67565b527f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b031692833b156106fc5761097b9361096986809486519788958694859363abf1570d60e01b85526007600486015260016024860152608060448601526084850190612a88565b83810360031901606485015290612a88565b03925af19081156109cd57506109b4575b50807fc08eb64db16a39d2848960af04e3f16fb404d9d436a9f0e9d7d0d4854715c9dc91a280f35b816109be91612508565b6109c957815f61098c565b5080fd5b513d84823e3d90fd5b50346102ed5760203660031901126102ed57600754600435906001600160a01b03168015610ccb573303610cb85780825281602052604082208054906001600160401b03821615610ca4578160c01c80610c8d5750600481019182546001600160401b038160401c1680610c7657506001600160401b034216916001600160401b038160801c16808411610c5f57506001600160401b039081610a81610a7b876131d2565b8661275e565b9160401c169182911610610c4357506001600160401b038116159081610c34575b50610c205781546001600160c01b031660c09190911b6001600160c01b031916178155839190604090610b57825191610adb8484612508565b600183526001600160401b03601f1985019586366020870137855196610b018789612508565b600188523660208901375460801c1690610b1a82612792565b610b2385612a67565b5280549060016003820154910154916001600160401b038160801c16906001600160401b0380828a1c16911660038c6126b0565b610b6084612a67565b527f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b031692833b156106fc57610bcf9361096986809486519788958694859363abf1570d60e01b85526007600486015260016024860152608060448601526084850190612a88565b03925af19081156109cd5750610c0b575b505033907f1408bd9a6e6ac1e782a8780a8d173b72dff516f8deb1cf14209f043d74d7f8848380a380f35b81610c1591612508565b6109c957815f610be0565b63c5d8910960e01b85526004849052602485fd5b6001915060c01c16155f610aa2565b6328ae40d360e11b875260048690526024526044829052606486fd5b634d13561d60e01b88526004879052602452604487fd5b6337e3280d60e21b87526004869052602452604486fd5b6386de195360e01b85526004849052602452604484fd5b6354880ffd60e11b84526004839052602484fd5b6316f28f7960e21b825233600452602482fd5b63edc1a9bb60e01b8352600483fd5b50346102ed5760203660031901126102ed5760406020916004358152808352206001600160401b0342169080546001600160401b03811615159283610dd1575b83610db8575b83610da0575b83610d6e575b505081610d3f575b506040519015158152f35b600401546001600160401b0381161580159250610d5e575b505f610d34565b6001915060c01c1615155f610d57565b829350610d8f6001600160401b03929391610d8984936131d2565b9061275e565b9260401c1691161015905f80610d2c565b92506001600160401b038160801c1683111592610d26565b600483015460401c6001600160401b0316159350610d20565b92508060c01c1592610d1a565b6123b7565b6124d2565b50346102ed5760203660031901126102ed57604060209160043581528083522080546001600160401b03811615159182610e6d575b82610e54575b5081610e3457506040519015158152f35b6001600160401b03915060801c166001600160401b03421611155f610d34565b6004015460401c6001600160401b03161591505f610e23565b91508060c01c1591610e1d565b50346102ed57806003193601126102ed5760206040517fcc7c08481f764947d6a6fa10f1913f9c489bcbe1ea586c5d4aca3bb0d12f45f68152f35b50346102ed57806003193601126102ed576040517f0000000000000000000000003c0698e02a10fec9a5cd5939d0a0f2d484e8d5406001600160a01b03168152602090f35b5060403660031901126102ed576004356001600160401b0381116109c957610f269036906004016123ed565b906024356001600160401b0381116103fd57610f469036906004016123ed565b60b684929410611a2a5781156119fa57823560f81c600281108015611a20575b611a0e575081600110156119fa5760fe600184013560f81c166119e057816022116106fc5760028301359082602a116119dc57602284013590836032116119d857602a85013593806052116119d457603286013595816072116119d057605281013596826092116119cc57607282013560018084013560f81c16158015806119c3575b6119af57806119a7575b61199857881561198957888b528a6020526001600160401b0360408c20541661197557426001600160401b031660c089901c11156119515760c086901c6118d6576001600160401b0361104c630a4cb80082421661275e565b16806001600160401b038a60c01c16116118bc57505b600554918215801561182e575b506001600160581b03831161180f578234036117f7576002549160016001600160401b038416016001600160401b0381116117e35760408e6001600160401b038e93166001600160401b03198716176002556001600160401b0386168152600360205220556040519161016083018381106001600160401b038211176117cf57928a8f95938e938c8f8b98604052426001600160401b03168652602086019160c01c6001600160401b03168252604086019060c01c6001600160401b0316815260608601918a83526080870193845260a0870194855260c0870195865260e087019a808c52610100880198818a5261012089019a6001600160401b03168b5261014089019b6001013560f81c8c528152806020526040902096516001600160401b03166001600160401b03166001600160401b0319885416178755516001600160401b03166111e190879067ffffffffffffffff60401b82549160401b169067ffffffffffffffff60401b1916179055565b51855491516001600160c01b031960c091821b166fffffffffffffffffffffffffffffffff90931667ffffffffffffffff60801b608093841b81169190911793909317875592516001870155925160028601559251600385015596516004909301805494519551965160ff60c01b981b979097166001600160c81b03199094166001600160401b039093169290921767ffffffffffffffff60401b604095861b16179490911b169290921791909117909155519861129e8a6124ed565b6112a9368585612544565b8a528436906112b792612544565b60208a01526020986040516112cc8b82612508565b8b81526040820152888b5260018a5260408b2081518051906001600160401b03821161175657908c8e9261130a83611304875461257a565b876125b2565b81601f841160011461176a575061133793919083611662575b50508160011b915f199060031b1c19161790565b81555b60208201518051906001600160401b038211611756578c908e61136d84611364600188015461257a565b600188016125b2565b82601f85116001146116e557509280604095936113a093600296926116625750508160011b915f199060031b1c19161790565b60018201555b0191015180516001600160401b0381116116d1576113ce816113c8855461257a565b856125b2565b8b8d601f831160011461166d57906113f993836116625750508160011b915f199060031b1c19161790565b90555b806115bb575b50868952888852604089209589604097886114998151926114238385612508565b60018452601f1983018e81368288013761143f85519586612508565b6001855236908501378c6001600160401b03600483015460801c169161146483612792565b61146d87612a67565b528d8154600160038401549301549360016001600160401b038084818160801c16961c169316916126b0565b6114a282612a67565b527f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b0316803b156103fd578a5163abf1570d60e01b81526007600482015260016024820152608060448201529d84938f9384929183919061150e906084840190612a88565b82810360031901606484015261152391612a88565b03925af19a8b156115af57899a9b9997989961158c575b5050875160c095861c8152941c898501526001013560f81c83870152606083015260808201527f24f7513addaa5e94cfcd9b75c20467f3408766ba4339ceb2e7f7670542bc05199060a090a351908152f35b81809394959697985061159e91612508565b6102ed57908189969594939261153a565b508751903d90823e3d90fd5b6040516115c7816124ed565b338082526001600160581b0383168b830190815260408084018e81528c8f5260048e52818f209451925190516001600160f81b031990151560f81b166001600160a01b039093166affffffffffffffffffffff60a01b60a09290921b91909116179190911790925590519182529088907fa7370d05155156bd5ea6efcbeb39806e27517011389f0fdecfc64cf5d00f405a908b90a35f611402565b015190505f80611323565b8481528d8120929390601f198516908f5b8282106116ba5750509084600195949392106116a2575b505050811b0190556113fc565b01515f1960f88460031b161c191690555f8080611695565b60018596829396860151815501950193018f61167e565b634e487b7160e01b8d52604160045260248dfd5b600186018252808220939291905b601f198616821061173f575050926040949260019260029583601f19811610611727575b505050811b0160018201556113a6565b01515f1960f88460031b161c191690555f8080611717565b60018495829395850151815501940192018f6116f3565b634e487b7160e01b8e52604160045260248efd5b8585528085209291905b601f19851686106117b557506001945083601f1981161061179d575b505050811b01815561133a565b01515f1960f88460031b161c191690555f8080611790565b82820151845594850194600190930192909101908f611774565b634e487b7160e01b8f52604160045260248ffd5b634e487b7160e01b8e52601160045260248efd5b634ba85a6b60e11b8c5260048390523460245260448cfd5b634ba85a6b60e11b8c526001600160581b03600452602483905260448cfd5b909290426001600160401b031660c08b901c9081039081116117e357630a4cb800908181019081106118a8575f1981019081116118a8578115611894570480830292830414171561188057915f61106f565b634e487b7160e01b8c52601160045260248cfd5b634e487b7160e01b8f52601260045260248ffd5b634e487b7160e01b8f52601160045260248ffd5b63049fe78160e51b8c5260c089901c60045260245260448bfd5b6001600160401b036118ee639a7ec80082421661275e565b16806001600160401b038860c01c161161193757506001600160401b0361191d630a4cb80060c089901c61275e565b16806001600160401b038a60c01c16116118bc5750611062565b6366936bfb60e01b8c5260c087901c60045260245260448bfd5b63fdea5da160e01b8b5260c088901c600452426001600160401b031660245260448bfd5b630838d09f60e31b8b52600489905260248bfd5b63ad7816e560e01b8b5260048bfd5b63205fae3f60e01b8b5260048bfd5b508015610ff3565b63be519db760e01b8c52600482905260248cfd5b50811515610fe9565b8980fd5b8880fd5b8780fd5b8680fd5b8580fd5b63ea3c636760e01b8552600183013560f81c600452602485fd5b634e487b7160e01b85526032600452602485fd5b637217802b60e11b8652600452602485fd5b5060038111610f66565b63b612418f60e01b85526004829052602485fd5b50346102ed576101003660031901126102ed5760243560ff811681036109c957611a66612444565b906064356001600160401b03811681036103fd57608435906001600160401b03821682036106fc5760e435946001600160401b03861686036102ed57602061058a8760c43560a43587878b8b6004356126b0565b50346102ed57806003193601126102ed57602060405160048152f35b50346102ed57806003193601126102ed576020600554604051908152f35b50346102ed5760203660031901126102ed57600480358083526020919091526040822080546001600160a01b03811691908215611c2d578060f81c611c19578385528460205260408520548060c01c611bf6576001600160401b039060801c16806001600160401b0342161115611bdf57506001600160f81b0316600160f81b179081905560065460405160a09290921c6001600160581b03168083526001600160a01b0391909116939092917f854c17f532edcef160bda03149cb791ef99da3d1091304c1b9fe7541194b49fa90602090a381611bd0578280f35b611bd99161319b565b5f808280f35b6339baf86960e21b86526004859052602452604485fd5b6339baf86960e21b8652600485905260801c6001600160401b0316602452604485fd5b63f920a8ad60e01b85526004849052602485fd5b6303c231f160e21b85526004849052602485fd5b50346102ed57806003193601126102ed5760206040517f64253d49ff965a8e8d9a338e10cd792ff0162b348f9f2f13961f508823fc306c8152f35b50346102ed57806003193601126102ed5760206040517fbc63f27502b75e6353acc1046081bba167948d74448f22f22e4d585e42f76e408152f35b50346102ed57806003193601126102ed5760206040517f4319588f25b52e7a814fe1a9cfa5ef4a669aa7fc3bf98ec8cf376946c5ea61ca8152f35b50346102ed57806003193601126102ed57604051630a4cb8008152602090f35b50346102ed5760203660031901126102ed576040611d72916004358152600160205220611d8e611d4182612610565b91611d80611d5d6002611d5660018501612610565b9301612610565b916040519586956060875260608701906124a0565b9085820360208701526124a0565b9083820360408501526124a0565b0390f35b50346102ed5760603660031901126102ed576004356001600160a01b038116908190036109c957611dc161242e565b604435906001600160401b0382116103fd57611de4611e07923690600401612470565b91604051602081019086825260208152611dff604082612508565b519020612b0c565b6007546001600160a01b03811680611e6557508115611e56576001600160a01b03191681176007557f7db69a2d299c904659420a4e27899c2ba105928ecdc1ba630100e95fe5010f838280a280f35b6380e294cb60e01b8352600483fd5b6327d2a69760e21b8452600452602483fd5b50346121a85760803660031901126121a8576004356024356001600160401b0381116121a857611eab9036906004016123ed565b906044356001600160401b0381116121a857611ecb9036906004016123ed565b916064356001600160401b0381116121a857611eeb9036906004016123ed565b949091611ef78761293e565b9460048601946001600160401b038654168061224657506001600160401b034216936001600160401b03885460801c16808611612230575092611fad928a926001600160401b039695611f4b368d8b612544565b6020815191012060405160208101917f25d67559fc7236429288de0997218a361d6df4de81f842df2e5db075e8643eaa835246604083015230606083015287608083015260a082015260a08152611fa360c082612508565b519020938b6129be565b166001600160401b0319835416178255845f526001602052600260405f2001906001600160401b03851161221c57611fef85611fe9845461257a565b846125b2565b845f91601f82116001146121b75761201c925f91836121ac5750508160011b915f199060031b1c19161790565b90555b6040916120ae8351916120328584612508565b600183526001600160401b03601f19860194853660208701378651956120588888612508565b600187523660208801375460801c169061207182612792565b61207a85612a67565b5280549060016003820154910154916001600160401b038160801c16906001600160401b0380828b1c16911660028c6126b0565b6120b783612a67565b527f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b031691823b156121a857612126926109695f809487519687958694859363abf1570d60e01b85526007600486015260016024860152608060448601526084850190612a88565b03925af1801561219e57612163575b507fef6909503ff04303797c0acbb3700634e2468a164761dae4c3cef0159750bcb19160209151908152a280f35b6020919450916121945f7fef6909503ff04303797c0acbb3700634e2468a164761dae4c3cef0159750bcb194612508565b5f94915091612135565b82513d5f823e3d90fd5b5f80fd5b013590505f80611323565b9050601f19861691835f528660205f20935f5b8181106122015750106121e8575b505050600184811b01905561201f565b01355f19600387901b60f8161c191690555f80806121d8565b8484013586556001909501946020938401938a9350016121ca565b634e487b7160e01b5f52604160045260245ffd5b8a634d13561d60e01b5f5260045260245260445ffd5b89631700099b60e11b5f5260045260245260445ffd5b346121a8575f3660031901126121a8576040517f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b03168152602090f35b346121a85760203660031901126121a8576004355f525f60205261016060405f2060ff81549160018101549060028101546004600383015492015492604051956001600160401b03811687526001600160401b038160401c1660208801526001600160401b038160801c16604088015260c01c6060870152608086015260a085015260c08401526001600160401b03811660e08401526001600160401b038160401c166101008401526001600160401b038160801c1661012084015260c01c16610140820152f35b346121a85760203660031901126121a8576004355f526004602052606060405f20546040519060018060a01b03811682526001600160581b038160a01c16602083015260f81c15156040820152f35b346121a8575f3660031901126121a857602060405160018152f35b346121a8575f3660031901126121a857602060405160028152f35b9181601f840112156121a8578235916001600160401b0383116121a857602083818601950101116121a857565b35906001600160a01b03821682036121a857565b602435906001600160401b03821682036121a857565b604435906001600160401b03821682036121a857565b600435906001600160401b03821682036121a857565b9181601f840112156121a8578235916001600160401b0383116121a8576020808501948460051b0101116121a857565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b359060ff821682036121a857565b346121a8575f3660031901126121a857602060405160038152f35b606081019081106001600160401b0382111761221c57604052565b90601f801991011681019081106001600160401b0382111761221c57604052565b6001600160401b03811161221c57601f01601f191660200190565b92919261255082612529565b9161255e6040519384612508565b8294818452818301116121a8578281602093845f960137010152565b90600182811c921680156125a8575b602083101461259457565b634e487b7160e01b5f52602260045260245ffd5b91607f1691612589565b919091601f83116125c3575b505050565b8183116125cf57505050565b5f5260205f206020601f830160051c9210612608575b81601f9101920160051c03905f5b828110156125be575f828201556001016125f3565b5f91506125e5565b9060405191825f8254926126238461257a565b808452936001811690811561268e575060011461264a575b5061264892500383612508565b565b90505f9291925260205f20905f915b818310612672575050906020612648928201015f61263b565b6020919350806001915483858901015201910190918492612659565b90506020925061264894915060ff191682840152151560051b8201015f61263b565b9592936001600160401b03602098958180989560ff82966040519d8e019c8d521660408d01521660608b01521660808901521660a087015260c086015260e085015216610100830152610100825261270a61012083612508565b61275860408051809360208201957f64253d49ff965a8e8d9a338e10cd792ff0162b348f9f2f13961f508823fc306c87525180918484015e81015f838201520301601f198101835282612508565b51902090565b906001600160401b03809116911601906001600160401b03821161277e57565b634e487b7160e01b5f52601160045260245ffd5b604051620fffff60208201927f4319588f25b52e7a814fe1a9cfa5ef4a669aa7fc3bf98ec8cf376946c5ea61ca845216604082015260408152612758606082612508565b519081151582036121a857565b60405163615cfa4760e11b81527f8613751e8e5a860774fbee33f44b7afcd801513ac5715713f0d65d5fe9355465600482015260248101919091527f0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c86001600160a01b031690602081604481855afa8015612900575f9061290b575b60409150604482518094819363ac81af2f60e01b83526007600484015260248301525afa8015612900575f915f916128c0575b50156128b857639a7ec80090818111156128aa575090565b6001600160401b0391501690565b5062015f9090565b9150506040813d6040116128f8575b816128dc60409383612508565b810103126121a8576128f26020825192016127d6565b5f612892565b3d91506128cf565b6040513d5f823e3d90fd5b506020813d602011612936575b8161292560209383612508565b810103126121a8576040905161285f565b3d9150612918565b90815f525f60205260405f209182546001600160401b038116156129ab5760c01c8061299557506001600160401b03600484015460401c169081612980575050565b6337e3280d60e21b5f5260045260245260445ffd5b906386de195360e01b5f5260045260245260445ffd5b506354880ffd60e11b5f5260045260245ffd5b600201549394939091908015612a54576129d9368385612544565b6020815191012090808203612a3f57505091612a17612a1f92612a2596959460405195602087015260208652612a10604087612508565b3691612544565b933691612544565b916131f9565b15612a2d5750565b636cf641e760e11b5f5260045260245ffd5b63d4609a1960e01b5f5260045260245260445ffd5b866364616e4d60e11b5f5260045260245ffd5b805115612a745760200190565b634e487b7160e01b5f52603260045260245ffd5b90602080835192838152019201905f5b818110612aa55750505090565b8251845260209384019390920191600101612a98565b9035601e19823603018112156121a85701602081359101916001600160401b0382116121a85781360383136121a857565b908060209392818452848401375f828201840152601f01601f1916010190565b6040516328305db160e21b815291937f0000000000000000000000003c0698e02a10fec9a5cd5939d0a0f2d484e8d5406001600160a01b03169392909190602081600481885afa908115612900575f91612d34575b501580612cbc575b612cb557833b156121a85791816001600160401b0395936040519687956322f3f44760e11b875260848701927fbc63f27502b75e6353acc1046081bba167948d74448f22f22e4d585e42f76e4060048901526024880152166044860152608060648601525260a4830160a48360051b85010192825f90607e1981360301935b838310612c165750505050505091815f81819503925af1801561290057612c0c5750565b5f61264891612508565b919395909294965060a3198982030182528635868112156121a8576001916020918291612ca3918701906001600160a01b03612c518361241a565b16815260ff612c618584016124c4565b1684820152612c95612c8a612c796040850185612abb565b608060408601526080850191612aec565b926060810190612abb565b916060818503910152612aec565b98019201930190939188969593612be8565b5050505050565b5060405163f5778b0360e01b8152602081600481885afa908115612900575f91612cf2575b506001600160a01b03163314612b69565b90506020813d602011612d2c575b81612d0d60209383612508565b810103126121a857516001600160a01b03811681036121a8575f612ce1565b3d9150612d00565b90506020813d602011612d66575b81612d4f60209383612508565b810103126121a857612d60906127d6565b5f612b61565b3d9150612d42565b6040516328305db160e21b815291937f0000000000000000000000003c0698e02a10fec9a5cd5939d0a0f2d484e8d5406001600160a01b03169392909190602081600481885afa908115612900575f91612f33575b501580612ebb575b612cb557833b156121a85791816001600160401b0395936040519687956322f3f44760e11b875260848701927f2efb98c58c1606c2b7524fdfbd55ecb71e0ebbedaef85fb5ceca0b8f4e66b0d960048901526024880152166044860152608060648601525260a4830160a48360051b85010192825f90607e1981360301935b838310612e6e5750505050505091815f81819503925af1801561290057612c0c5750565b919395909294965060a3198982030182528635868112156121a8576001916020918291612ea9918701906001600160a01b03612c518361241a565b98019201930190939188969593612e4a565b5060405163f5778b0360e01b8152602081600481885afa908115612900575f91612ef1575b506001600160a01b03163314612dcb565b90506020813d602011612f2b575b81612f0c60209383612508565b810103126121a857516001600160a01b03811681036121a8575f612ee0565b3d9150612eff565b90506020813d602011612f65575b81612f4e60209383612508565b810103126121a857612f5f906127d6565b5f612dc3565b3d9150612f41565b6040516328305db160e21b815291937f0000000000000000000000003c0698e02a10fec9a5cd5939d0a0f2d484e8d5406001600160a01b03169392909190602081600481885afa908115612900575f91613132575b5015806130ba575b612cb557833b156121a85791816001600160401b0395936040519687956322f3f44760e11b875260848701927f39efb8a3ddb9a6b5fbbc1efde87859ad508e4acf5b6c2a87ce3a298ccc3c5a0060048901526024880152166044860152608060648601525260a4830160a48360051b85010192825f90607e1981360301935b83831061306d5750505050505091815f81819503925af1801561290057612c0c5750565b919395909294965060a3198982030182528635868112156121a85760019160209182916130a8918701906001600160a01b03612c518361241a565b98019201930190939188969593613049565b5060405163f5778b0360e01b8152602081600481885afa908115612900575f916130f0575b506001600160a01b03163314612fca565b90506020813d60201161312a575b8161310b60209383612508565b810103126121a857516001600160a01b03811681036121a8575f6130df565b3d91506130fe565b90506020813d602011613164575b8161314d60209383612508565b810103126121a85761315e906127d6565b5f612fc2565b3d9150613140565b3d15613196573d9061317d82612529565b9161318b6040519384612508565b82523d5f602084013e565b606090565b5f80808085855af16131ab61316c565b50156131b5575050565b638fdb80a360e01b5f5260018060a01b031660045260245260445ffd5b805460401c6001600160401b03166131e957505f90565b60036131f69101546127e3565b90565b80519192610a2083148015906132b6575b6132ae5761325a5f949360208695818060405196858896838089019b018b5e8601908282018b8152815193849201905e010190878252805192839101825e0185815203601f198101835282612508565b51906102045afa61326961316c565b816132a2575b81613278575090565b9050602081519101519060208110613291575b50151590565b5f199060200360031b1b165f61328b565b8051602014915061326f565b505050505f90565b506112138151141561320a56
No CBOR metadata tail — this bytecode was built with cbor_metadata off, the setting our own contracts pin for CREATE2 address invariance.
disassembly (first 4,000 ops)
| pc | op | operand |
|---|---|---|
| 0000 | PUSH1 | 0x80 |
| 0002 | PUSH1 | 0x40 |
| 0004 | MSTORE | |
| 0005 | PUSH1 | 0x04 |
| 0007 | CALLDATASIZE | |
| 0008 | LT | |
| 0009 | ISZERO | |
| 000a | PUSH2 | 0x0011 |
| 000d | JUMPI | |
| 000e | PUSH0 | |
| 000f | DUP1 | |
| 0010 | REVERT | |
| 0011 | JUMPDEST | |
| 0012 | PUSH0 | |
| 0013 | PUSH0 | |
| 0014 | CALLDATALOAD | |
| 0015 | PUSH1 | 0xe0 |
| 0017 | SHR | |
| 0018 | DUP1 | |
| 0019 | PUSH4 | 0x0618c724 |
| 001e | EQ | |
| 001f | PUSH2 | 0x23b7 |
| 0022 | JUMPI | |
| 0023 | DUP1 | |
| 0024 | PUSH4 | 0x072e6d6d |
| 0029 | EQ | |
| 002a | PUSH2 | 0x074b |
| 002d | JUMPI | |
| 002e | DUP1 | |
| 002f | PUSH4 | 0x0fb585ba |
| 0034 | EQ | |
| 0035 | PUSH2 | 0x2368 |
| 0038 | JUMPI | |
| 0039 | DUP1 | |
| 003a | PUSH4 | 0x116c1af0 |
| 003f | EQ | |
| 0040 | PUSH2 | 0x22a0 |
| 0043 | JUMPI | |
| 0044 | DUP1 | |
| 0045 | PUSH4 | 0x178bcc93 |
| 004a | EQ | |
| 004b | PUSH2 | 0x225c |
| 004e | JUMPI | |
| 004f | DUP1 | |
| 0050 | PUSH4 | 0x2972cd99 |
| 0055 | EQ | |
| 0056 | PUSH2 | 0x1e77 |
| 0059 | JUMPI | |
| 005a | DUP1 | |
| 005b | PUSH4 | 0x30a0d08f |
| 0060 | EQ | |
| 0061 | PUSH2 | 0x1d92 |
| 0064 | JUMPI | |
| 0065 | DUP1 | |
| 0066 | PUSH4 | 0x352e4660 |
| 006b | EQ | |
| 006c | PUSH2 | 0x1d12 |
| 006f | JUMPI | |
| 0070 | DUP1 | |
| 0071 | PUSH4 | 0x38fcba77 |
| 0076 | EQ | |
| 0077 | PUSH2 | 0x0dde |
| 007a | JUMPI | |
| 007b | DUP1 | |
| 007c | PUSH4 | 0x3e65164a |
| 0081 | EQ | |
| 0082 | PUSH2 | 0x1cf2 |
| 0085 | JUMPI | |
| 0086 | DUP1 | |
| 0087 | PUSH4 | 0x480e7ffa |
| 008c | EQ | |
| 008d | PUSH2 | 0x1cb7 |
| 0090 | JUMPI | |
| 0091 | DUP1 | |
| 0092 | PUSH4 | 0x4f26b64b |
| 0097 | EQ | |
| 0098 | PUSH2 | 0x1c7c |
| 009b | JUMPI | |
| 009c | DUP1 | |
| 009d | PUSH4 | 0x4f65a32e |
| 00a2 | EQ | |
| 00a3 | PUSH2 | 0x1c41 |
| 00a6 | JUMPI | |
| 00a7 | DUP1 | |
| 00a8 | PUSH4 | 0x51c043a7 |
| 00ad | EQ | |
| 00ae | PUSH2 | 0x1af4 |
| 00b1 | JUMPI | |
| 00b2 | DUP1 | |
| 00b3 | PUSH4 | 0x581582c7 |
| 00b8 | EQ | |
| 00b9 | PUSH2 | 0x1ad6 |
| 00bc | JUMPI | |
| 00bd | DUP1 | |
| 00be | PUSH4 | 0x5a4e5a15 |
| 00c3 | EQ | |
| 00c4 | PUSH2 | 0x1aba |
| 00c7 | JUMPI | |
| 00c8 | DUP1 | |
| 00c9 | PUSH4 | 0x5c0b2330 |
| 00ce | EQ | |
| 00cf | PUSH2 | 0x1a3e |
| 00d2 | JUMPI | |
| 00d3 | DUP1 | |
| 00d4 | PUSH4 | 0x6ee7ab1f |
| 00d9 | EQ | |
| 00da | PUSH2 | 0x0de3 |
| 00dd | JUMPI | |
| 00de | DUP1 | |
| 00df | PUSH4 | 0x72efd405 |
| 00e4 | EQ | |
| 00e5 | PUSH2 | 0x0efa |
| 00e8 | JUMPI | |
| 00e9 | DUP1 | |
| 00ea | PUSH4 | 0x7b103999 |
| 00ef | EQ | |
| 00f0 | PUSH2 | 0x0eb5 |
| 00f3 | JUMPI | |
| 00f4 | DUP1 | |
| 00f5 | PUSH4 | 0x7b8ec02b |
| 00fa | EQ | |
| 00fb | PUSH2 | 0x0e7a |
| 00fe | JUMPI | |
| 00ff | DUP1 | |
| 0100 | PUSH4 | 0x7c35be7a |
| 0105 | EQ | |
| 0106 | PUSH2 | 0x0de8 |
| 0109 | JUMPI | |
| 010a | DUP1 | |
| 010b | PUSH4 | 0x7cb33ac0 |
| 0110 | EQ | |
| 0111 | PUSH2 | 0x0de3 |
| 0114 | JUMPI | |
| 0115 | DUP1 | |
| 0116 | PUSH4 | 0x9b76f6bb |
| 011b | EQ | |
| 011c | PUSH2 | 0x0dde |
| 011f | JUMPI | |
| 0120 | DUP1 | |
| 0121 | PUSH4 | 0x9ca3efea |
| 0126 | EQ | |
| 0127 | PUSH2 | 0x0cda |
| 012a | JUMPI | |
| 012b | DUP1 | |
| 012c | PUSH4 | 0xaf6f8c1b |
| 0131 | EQ | |
| 0132 | PUSH2 | 0x09d6 |
| 0135 | JUMPI | |
| 0136 | DUP1 | |
| 0137 | PUSH4 | 0xb0843d5d |
| 013c | EQ | |
| 013d | PUSH2 | 0x0779 |
| 0140 | JUMPI | |
| 0141 | DUP1 | |
| 0142 | PUSH4 | 0xb4fd7296 |
| 0147 | EQ | |
| 0148 | PUSH2 | 0x0750 |
| 014b | JUMPI | |
| 014c | DUP1 | |
| 014d | PUSH4 | 0xb996de66 |
| 0152 | EQ | |
| 0153 | PUSH2 | 0x074b |
| 0156 | JUMPI | |
| 0157 | DUP1 | |
| 0158 | PUSH4 | 0xb9983677 |
| 015d | EQ | |
| 015e | PUSH2 | 0x0724 |
| 0161 | JUMPI | |
| 0162 | DUP1 | |
| 0163 | PUSH4 | 0xbecec190 |
| 0168 | EQ | |
| 0169 | PUSH2 | 0x0704 |
| 016c | JUMPI | |
| 016d | DUP1 | |
| 016e | PUSH4 | 0xc21a3fa2 |
| 0173 | EQ | |
| 0174 | PUSH2 | 0x05ca |
| 0177 | JUMPI | |
| 0178 | DUP1 | |
| 0179 | PUSH4 | 0xd085c61a |
| 017e | EQ | |
| 017f | PUSH2 | 0x0592 |
| 0182 | JUMPI | |
| 0183 | DUP1 | |
| 0184 | PUSH4 | 0xd11b2015 |
| 0189 | EQ | |
| 018a | PUSH2 | 0x0566 |
| 018d | JUMPI | |
| 018e | DUP1 | |
| 018f | PUSH4 | 0xd2a26fb0 |
| 0194 | EQ | |
| 0195 | PUSH2 | 0x052b |
| 0198 | JUMPI | |
| 0199 | DUP1 | |
| 019a | PUSH4 | 0xd61ec1cd |
| 019f | EQ | |
| 01a0 | PUSH2 | 0x050f |
| 01a3 | JUMPI | |
| 01a4 | DUP1 | |
| 01a5 | PUSH4 | 0xdd759453 |
| 01aa | EQ | |
| 01ab | PUSH2 | 0x04d4 |
| 01ae | JUMPI | |
| 01af | DUP1 | |
| 01b0 | PUSH4 | 0xe01696b1 |
| 01b5 | EQ | |
| 01b6 | PUSH2 | 0x04b5 |
| 01b9 | JUMPI | |
| 01ba | DUP1 | |
| 01bb | PUSH4 | 0xed8da001 |
| 01c0 | EQ | |
| 01c1 | PUSH2 | 0x047a |
| 01c4 | JUMPI | |
| 01c5 | DUP1 | |
| 01c6 | PUSH4 | 0xf5760fd1 |
| 01cb | EQ | |
| 01cc | PUSH2 | 0x045a |
| 01cf | JUMPI | |
| 01d0 | DUP1 | |
| 01d1 | PUSH4 | 0xf63c7bfb |
| 01d6 | EQ | |
| 01d7 | PUSH2 | 0x042a |
| 01da | JUMPI | |
| 01db | DUP1 | |
| 01dc | PUSH4 | 0xf68365b0 |
| 01e1 | EQ | |
| 01e2 | PUSH2 | 0x0401 |
| 01e5 | JUMPI | |
| 01e6 | DUP1 | |
| 01e7 | PUSH4 | 0xff08fc00 |
| 01ec | EQ | |
| 01ed | PUSH2 | 0x032b |
| 01f0 | JUMPI | |
| 01f1 | DUP1 | |
| 01f2 | PUSH4 | 0xff582a04 |
| 01f7 | EQ | |
| 01f8 | PUSH2 | 0x02f0 |
| 01fb | JUMPI | |
| 01fc | PUSH4 | 0xffc7733c |
| 0201 | EQ | |
| 0202 | PUSH2 | 0x0209 |
| 0205 | JUMPI | |
| 0206 | PUSH0 | |
| 0207 | DUP1 | |
| 0208 | REVERT | |
| 0209 | JUMPDEST | |
| 020a | CALLVALUE | |
| 020b | PUSH2 | 0x02ed |
| 020e | JUMPI | |
| 020f | PUSH1 | 0x20 |
| 0211 | CALLDATASIZE | |
| 0212 | PUSH1 | 0x03 |
| 0214 | NOT | |
| 0215 | ADD | |
| 0216 | SLT | |
| 0217 | PUSH2 | 0x02ed |
| 021a | JUMPI | |
| 021b | PUSH1 | 0x04 |
| 021d | CALLDATALOAD | |
| 021e | SWAP1 | |
| 021f | DUP2 | |
| 0220 | DUP2 | |
| 0221 | MSTORE | |
| 0222 | PUSH1 | 0x04 |
| 0224 | PUSH1 | 0x20 |
| 0226 | MSTORE | |
| 0227 | PUSH1 | 0x40 |
| 0229 | DUP2 | |
| 022a | KECCAK256 | |
| 022b | SWAP2 | |
| 022c | DUP3 | |
| 022d | SLOAD | |
| 022e | PUSH1 | 0x01 |
| 0230 | DUP1 | |
| 0231 | PUSH1 | 0xa0 |
| 0233 | SHL | |
| 0234 | SUB | |
| 0235 | DUP2 | |
| 0236 | AND | |
| 0237 | SWAP1 | |
| 0238 | DUP2 | |
| 0239 | ISZERO | |
| 023a | PUSH2 | 0x02d9 |
| 023d | JUMPI | |
| 023e | DUP1 | |
| 023f | PUSH1 | 0xf8 |
| 0241 | SHR | |
| 0242 | PUSH2 | 0x02c5 |
| 0245 | JUMPI | |
| 0246 | DUP3 | |
| 0247 | DUP5 | |
| 0248 | MSTORE | |
| 0249 | DUP4 | |
| 024a | PUSH1 | 0x20 |
| 024c | MSTORE | |
| 024d | PUSH1 | 0x40 |
| 024f | DUP5 | |
| 0250 | KECCAK256 | |
| 0251 | SLOAD | |
| 0252 | PUSH1 | 0xc0 |
| 0254 | SHR | |
| 0255 | ISZERO | |
| 0256 | PUSH2 | 0x02b1 |
| 0259 | JUMPI | |
| 025a | PUSH1 | 0x01 |
| 025c | PUSH1 | 0x01 |
| 025e | PUSH1 | 0x58 |
| 0260 | SHL | |
| 0261 | SUB | |
| 0262 | PUSH2 | 0x02ae |
| 0265 | SWAP5 | |
| 0266 | SWAP6 | |
| 0267 | DUP4 | |
| 0268 | SWAP3 | |
| 0269 | PUSH1 | 0x01 |
| 026b | PUSH1 | 0xf8 |
| 026d | SHL | |
| 026e | SWAP1 | |
| 026f | PUSH1 | 0x01 |
| 0271 | DUP1 | |
| 0272 | PUSH1 | 0xf8 |
| 0274 | SHL | |
| 0275 | SUB | |
| 0276 | AND | |
| 0277 | OR | |
| 0278 | DUP1 | |
| 0279 | SWAP2 | |
| 027a | SSTORE | |
| 027b | PUSH1 | 0xa0 |
| 027d | SHR | |
| 027e | AND | |
| 027f | SWAP3 | |
| 0280 | PUSH32 | 0x7514b10bc04eb31bd8aa5b8639cb6c21e464040da82dd4e84534cd91f49ac675 |
| 02a1 | PUSH1 | 0x20 |
| 02a3 | PUSH1 | 0x40 |
| 02a5 | MLOAD | |
| 02a6 | DUP7 | |
| 02a7 | DUP2 | |
| 02a8 | MSTORE | |
| 02a9 | LOG3 | |
| 02aa | PUSH2 | 0x319b |
| 02ad | JUMP | |
| 02ae | JUMPDEST | |
| 02af | DUP1 | |
| 02b0 | RETURN | |
| 02b1 | JUMPDEST | |
| 02b2 | PUSH4 | 0x33cb2a17 |
| 02b7 | PUSH1 | 0xe2 |
| 02b9 | SHL | |
| 02ba | DUP5 | |
| 02bb | MSTORE | |
| 02bc | PUSH1 | 0x04 |
| 02be | DUP4 | |
| 02bf | SWAP1 | |
| 02c0 | MSTORE | |
| 02c1 | PUSH1 | 0x24 |
| 02c3 | DUP5 | |
| 02c4 | REVERT | |
| 02c5 | JUMPDEST | |
| 02c6 | PUSH4 | 0xf920a8ad |
| 02cb | PUSH1 | 0xe0 |
| 02cd | SHL | |
| 02ce | DUP5 | |
| 02cf | MSTORE | |
| 02d0 | PUSH1 | 0x04 |
| 02d2 | DUP4 | |
| 02d3 | SWAP1 | |
| 02d4 | MSTORE | |
| 02d5 | PUSH1 | 0x24 |
| 02d7 | DUP5 | |
| 02d8 | REVERT | |
| 02d9 | JUMPDEST | |
| 02da | PUSH4 | 0x03c231f1 |
| 02df | PUSH1 | 0xe2 |
| 02e1 | SHL | |
| 02e2 | DUP5 | |
| 02e3 | MSTORE | |
| 02e4 | PUSH1 | 0x04 |
| 02e6 | DUP4 | |
| 02e7 | SWAP1 | |
| 02e8 | MSTORE | |
| 02e9 | PUSH1 | 0x24 |
| 02eb | DUP5 | |
| 02ec | REVERT | |
| 02ed | JUMPDEST | |
| 02ee | DUP1 | |
| 02ef | REVERT | |
| 02f0 | JUMPDEST | |
| 02f1 | POP | |
| 02f2 | CALLVALUE | |
| 02f3 | PUSH2 | 0x02ed |
| 02f6 | JUMPI | |
| 02f7 | DUP1 | |
| 02f8 | PUSH1 | 0x03 |
| 02fa | NOT | |
| 02fb | CALLDATASIZE | |
| 02fc | ADD | |
| 02fd | SLT | |
| 02fe | PUSH2 | 0x02ed |
| 0301 | JUMPI | |
| 0302 | PUSH1 | 0x20 |
| 0304 | PUSH1 | 0x40 |
| 0306 | MLOAD | |
| 0307 | PUSH32 | 0x39efb8a3ddb9a6b5fbbc1efde87859ad508e4acf5b6c2a87ce3a298ccc3c5a00 |
| 0328 | DUP2 | |
| 0329 | MSTORE | |
| 032a | RETURN | |
| 032b | JUMPDEST | |
| 032c | POP | |
| 032d | CALLVALUE | |
| 032e | PUSH2 | 0x02ed |
| 0331 | JUMPI | |
| 0332 | PUSH1 | 0x60 |
| 0334 | CALLDATASIZE | |
| 0335 | PUSH1 | 0x03 |
| 0337 | NOT | |
| 0338 | ADD | |
| 0339 | SLT | |
| 033a | PUSH2 | 0x02ed |
| 033d | JUMPI | |
| 033e | PUSH2 | 0x0345 |
| 0341 | PUSH2 | 0x245a |
| 0344 | JUMP | |
| 0345 | JUMPDEST | |
| 0346 | PUSH2 | 0x034d |
| 0349 | PUSH2 | 0x242e |
| 034c | JUMP | |
| 034d | JUMPDEST | |
| 034e | PUSH1 | 0x44 |
| 0350 | CALLDATALOAD | |
| 0351 | SWAP1 | |
| 0352 | PUSH1 | 0x01 |
| 0354 | PUSH1 | 0x01 |
| 0356 | PUSH1 | 0x40 |
| 0358 | SHL | |
| 0359 | SUB | |
| 035a | DUP3 | |
| 035b | GT | |
| 035c | PUSH2 | 0x03fd |
| 035f | JUMPI | |
| 0360 | PUSH2 | 0x0370 |
| 0363 | PUSH2 | 0x039e |
| 0366 | SWAP3 | |
| 0367 | CALLDATASIZE | |
| 0368 | SWAP1 | |
| 0369 | PUSH1 | 0x04 |
| 036b | ADD | |
| 036c | PUSH2 | 0x2470 |
| 036f | JUMP | |
| 0370 | JUMPDEST | |
| 0371 | SWAP2 | |
| 0372 | PUSH1 | 0x40 |
| 0374 | MLOAD | |
| 0375 | SWAP5 | |
| 0376 | PUSH1 | 0x01 |
| 0378 | PUSH1 | 0x01 |
| 037a | PUSH1 | 0x40 |
| 037c | SHL | |
| 037d | SUB | |
| 037e | PUSH1 | 0x20 |
| 0380 | DUP8 | |
| 0381 | ADD | |
| 0382 | SWAP2 | |
| 0383 | AND | |
| 0384 | SWAP6 | |
| 0385 | DUP7 | |
| 0386 | DUP3 | |
| 0387 | MSTORE | |
| 0388 | PUSH1 | 0x20 |
| 038a | DUP2 | |
| 038b | MSTORE | |
| 038c | PUSH2 | 0x0396 |
| 038f | PUSH1 | 0x40 |
| 0391 | DUP3 | |
| 0392 | PUSH2 | 0x2508 |
| 0395 | JUMP | |
| 0396 | JUMPDEST | |
| 0397 | MLOAD | |
| 0398 | SWAP1 | |
| 0399 | KECCAK256 | |
| 039a | PUSH2 | 0x2f6d |
| 039d | JUMP | |
| 039e | JUMPDEST | |
| 039f | PUSH1 | 0x02 |
| 03a1 | SLOAD | |
| 03a2 | PUSH1 | 0x01 |
| 03a4 | PUSH1 | 0x01 |
| 03a6 | PUSH1 | 0x40 |
| 03a8 | SHL | |
| 03a9 | SUB | |
| 03aa | DUP2 | |
| 03ab | AND | |
| 03ac | PUSH2 | 0x03ee |
| 03af | JUMPI | |
| 03b0 | PUSH8 | 0xffffffffffffffff |
| 03b9 | NOT | |
| 03ba | AND | |
| 03bb | DUP2 | |
| 03bc | OR | |
| 03bd | PUSH1 | 0x02 |
| 03bf | SSTORE | |
| 03c0 | PUSH1 | 0x40 |
| 03c2 | MLOAD | |
| 03c3 | SWAP1 | |
| 03c4 | DUP2 | |
| 03c5 | MSTORE | |
| 03c6 | PUSH32 | 0x0b2384dfec7e6ac4cabe32366a33ef1072d076ac41659321348732ffe00b3181 |
| 03e7 | SWAP1 | |
| 03e8 | PUSH1 | 0x20 |
| 03ea | SWAP1 | |
| 03eb | LOG1 | |
| 03ec | DUP1 | |
| 03ed | RETURN | |
| 03ee | JUMPDEST | |
| 03ef | PUSH4 | 0xdc63d81f |
| 03f4 | PUSH1 | 0xe0 |
| 03f6 | SHL | |
| 03f7 | DUP4 | |
| 03f8 | MSTORE | |
| 03f9 | PUSH1 | 0x04 |
| 03fb | DUP4 | |
| 03fc | REVERT | |
| 03fd | JUMPDEST | |
| 03fe | DUP4 | |
| 03ff | DUP1 | |
| 0400 | REVERT | |
| 0401 | JUMPDEST | |
| 0402 | POP | |
| 0403 | CALLVALUE | |
| 0404 | PUSH2 | 0x02ed |
| 0407 | JUMPI | |
| 0408 | DUP1 | |
| 0409 | PUSH1 | 0x03 |
| 040b | NOT | |
| 040c | CALLDATASIZE | |
| 040d | ADD | |
| 040e | SLT | |
| 040f | PUSH2 | 0x02ed |
| 0412 | JUMPI | |
| 0413 | PUSH1 | 0x06 |
| 0415 | SLOAD | |
| 0416 | PUSH1 | 0x40 |
| 0418 | MLOAD | |
| 0419 | PUSH1 | 0x01 |
| 041b | PUSH1 | 0x01 |
| 041d | PUSH1 | 0xa0 |
| 041f | SHL | |
| 0420 | SUB | |
| 0421 | SWAP1 | |
| 0422 | SWAP2 | |
| 0423 | AND | |
| 0424 | DUP2 | |
| 0425 | MSTORE | |
| 0426 | PUSH1 | 0x20 |
| 0428 | SWAP1 | |
| 0429 | RETURN | |
| 042a | JUMPDEST | |
| 042b | POP | |
| 042c | CALLVALUE | |
| 042d | PUSH2 | 0x02ed |
| 0430 | JUMPI | |
| 0431 | PUSH1 | 0x20 |
| 0433 | CALLDATASIZE | |
| 0434 | PUSH1 | 0x03 |
| 0436 | NOT | |
| 0437 | ADD | |
| 0438 | SLT | |
| 0439 | PUSH2 | 0x02ed |
| 043c | JUMPI | |
| 043d | PUSH1 | 0x20 |
| 043f | PUSH2 | 0x0449 |
| 0442 | PUSH1 | 0x04 |
| 0444 | CALLDATALOAD | |
| 0445 | PUSH2 | 0x27e3 |
| 0448 | JUMP | |
| 0449 | JUMPDEST | |
| 044a | PUSH1 | 0x01 |
| 044c | PUSH1 | 0x01 |
| 044e | PUSH1 | 0x40 |
| 0450 | SHL | |
| 0451 | SUB | |
| 0452 | PUSH1 | 0x40 |
| 0454 | MLOAD | |
| 0455 | SWAP2 | |
| 0456 | AND | |
| 0457 | DUP2 | |
| 0458 | MSTORE | |
| 0459 | RETURN | |
| 045a | JUMPDEST | |
| 045b | POP | |
| 045c | CALLVALUE | |
| 045d | PUSH2 | 0x02ed |
| 0460 | JUMPI | |
| 0461 | DUP1 | |
| 0462 | PUSH1 | 0x03 |
| 0464 | NOT | |
| 0465 | CALLDATASIZE | |
| 0466 | ADD | |
| 0467 | SLT | |
| 0468 | PUSH2 | 0x02ed |
| 046b | JUMPI | |
| 046c | POP | |
| 046d | PUSH1 | 0x20 |
| 046f | PUSH3 | 0x100000 |
| 0473 | PUSH1 | 0x40 |
| 0475 | MLOAD | |
| 0476 | SWAP1 | |
| 0477 | DUP2 | |
| 0478 | MSTORE | |
| 0479 | RETURN | |
| 047a | JUMPDEST | |
| 047b | POP | |
| 047c | CALLVALUE | |
| 047d | PUSH2 | 0x02ed |
| 0480 | JUMPI | |
| 0481 | DUP1 | |
| 0482 | PUSH1 | 0x03 |
| 0484 | NOT | |
| 0485 | CALLDATASIZE | |
| 0486 | ADD | |
| 0487 | SLT | |
| 0488 | PUSH2 | 0x02ed |
| 048b | JUMPI | |
| 048c | PUSH1 | 0x20 |
| 048e | PUSH1 | 0x40 |
| 0490 | MLOAD | |
| 0491 | PUSH32 | 0x2efb98c58c1606c2b7524fdfbd55ecb71e0ebbedaef85fb5ceca0b8f4e66b0d9 |
| 04b2 | DUP2 | |
| 04b3 | MSTORE | |
| 04b4 | RETURN | |
| 04b5 | JUMPDEST | |
| 04b6 | POP | |
| 04b7 | CALLVALUE | |
| 04b8 | PUSH2 | 0x02ed |
| 04bb | JUMPI | |
| 04bc | DUP1 | |
| 04bd | PUSH1 | 0x03 |
| 04bf | NOT | |
| 04c0 | CALLDATASIZE | |
| 04c1 | ADD | |
| 04c2 | SLT | |
| 04c3 | PUSH2 | 0x02ed |
| 04c6 | JUMPI | |
| 04c7 | PUSH1 | 0x40 |
| 04c9 | MLOAD | |
| 04ca | PUSH3 | 0x015f90 |
| 04ce | DUP2 | |
| 04cf | MSTORE | |
| 04d0 | PUSH1 | 0x20 |
| 04d2 | SWAP1 | |
| 04d3 | RETURN | |
| 04d4 | JUMPDEST | |
| 04d5 | POP | |
| 04d6 | CALLVALUE | |
| 04d7 | PUSH2 | 0x02ed |
| 04da | JUMPI | |
| 04db | DUP1 | |
| 04dc | PUSH1 | 0x03 |
| 04de | NOT | |
| 04df | CALLDATASIZE | |
| 04e0 | ADD | |
| 04e1 | SLT | |
| 04e2 | PUSH2 | 0x02ed |
| 04e5 | JUMPI | |
| 04e6 | PUSH1 | 0x20 |
| 04e8 | PUSH1 | 0x40 |
| 04ea | MLOAD | |
| 04eb | PUSH32 | 0x25d67559fc7236429288de0997218a361d6df4de81f842df2e5db075e8643eaa |
| 050c | DUP2 | |
| 050d | MSTORE | |
| 050e | RETURN | |
| 050f | JUMPDEST | |
| 0510 | POP | |
| 0511 | CALLVALUE | |
| 0512 | PUSH2 | 0x02ed |
| 0515 | JUMPI | |
| 0516 | DUP1 | |
| 0517 | PUSH1 | 0x03 |
| 0519 | NOT | |
| 051a | CALLDATASIZE | |
| 051b | ADD | |
| 051c | SLT | |
| 051d | PUSH2 | 0x02ed |
| 0520 | JUMPI | |
| 0521 | PUSH1 | 0x20 |
| 0523 | PUSH1 | 0x40 |
| 0525 | MLOAD | |
| 0526 | PUSH1 | 0x07 |
| 0528 | DUP2 | |
| 0529 | MSTORE | |
| 052a | RETURN | |
| 052b | JUMPDEST | |
| 052c | POP | |
| 052d | CALLVALUE | |
| 052e | PUSH2 | 0x02ed |
| 0531 | JUMPI | |
| 0532 | DUP1 | |
| 0533 | PUSH1 | 0x03 |
| 0535 | NOT | |
| 0536 | CALLDATASIZE | |
| 0537 | ADD | |
| 0538 | SLT | |
| 0539 | PUSH2 | 0x02ed |
| 053c | JUMPI | |
| 053d | PUSH1 | 0x20 |
| 053f | PUSH1 | 0x40 |
| 0541 | MLOAD | |
| 0542 | PUSH32 | 0x8613751e8e5a860774fbee33f44b7afcd801513ac5715713f0d65d5fe9355465 |
| 0563 | DUP2 | |
| 0564 | MSTORE | |
| 0565 | RETURN | |
| 0566 | JUMPDEST | |
| 0567 | POP | |
| 0568 | CALLVALUE | |
| 0569 | PUSH2 | 0x02ed |
| 056c | JUMPI | |
| 056d | PUSH1 | 0x20 |
| 056f | CALLDATASIZE | |
| 0570 | PUSH1 | 0x03 |
| 0572 | NOT | |
| 0573 | ADD | |
| 0574 | SLT | |
| 0575 | PUSH2 | 0x02ed |
| 0578 | JUMPI | |
| 0579 | PUSH1 | 0x20 |
| 057b | PUSH2 | 0x058a |
| 057e | PUSH2 | 0x0585 |
| 0581 | PUSH2 | 0x245a |
| 0584 | JUMP | |
| 0585 | JUMPDEST | |
| 0586 | PUSH2 | 0x2792 |
| 0589 | JUMP | |
| 058a | JUMPDEST | |
| 058b | PUSH1 | 0x40 |
| 058d | MLOAD | |
| 058e | SWAP1 | |
| 058f | DUP2 | |
| 0590 | MSTORE | |
| 0591 | RETURN | |
| 0592 | JUMPDEST | |
| 0593 | POP | |
| 0594 | CALLVALUE | |
| 0595 | PUSH2 | 0x02ed |
| 0598 | JUMPI | |
| 0599 | PUSH1 | 0x20 |
| 059b | CALLDATASIZE | |
| 059c | PUSH1 | 0x03 |
| 059e | NOT | |
| 059f | ADD | |
| 05a0 | SLT | |
| 05a1 | PUSH2 | 0x02ed |
| 05a4 | JUMPI | |
| 05a5 | PUSH1 | 0x40 |
| 05a7 | PUSH1 | 0x20 |
| 05a9 | SWAP2 | |
| 05aa | PUSH1 | 0x01 |
| 05ac | PUSH1 | 0x01 |
| 05ae | PUSH1 | 0x40 |
| 05b0 | SHL | |
| 05b1 | SUB | |
| 05b2 | PUSH2 | 0x05b9 |
| 05b5 | PUSH2 | 0x245a |
| 05b8 | JUMP | |
| 05b9 | JUMPDEST | |
| 05ba | AND | |
| 05bb | DUP2 | |
| 05bc | MSTORE | |
| 05bd | PUSH1 | 0x03 |
| 05bf | DUP4 | |
| 05c0 | MSTORE | |
| 05c1 | KECCAK256 | |
| 05c2 | SLOAD | |
| 05c3 | PUSH1 | 0x40 |
| 05c5 | MLOAD | |
| 05c6 | SWAP1 | |
| 05c7 | DUP2 | |
| 05c8 | MSTORE | |
| 05c9 | RETURN | |
| 05ca | JUMPDEST | |
| 05cb | POP | |
| 05cc | CALLVALUE | |
| 05cd | PUSH2 | 0x02ed |
| 05d0 | JUMPI | |
| 05d1 | PUSH1 | 0x80 |
| 05d3 | CALLDATASIZE | |
| 05d4 | PUSH1 | 0x03 |
| 05d6 | NOT | |
| 05d7 | ADD | |
| 05d8 | SLT | |
| 05d9 | PUSH2 | 0x02ed |
| 05dc | JUMPI | |
| 05dd | PUSH1 | 0x04 |
| 05df | CALLDATALOAD | |
| 05e0 | SWAP1 | |
| 05e1 | PUSH1 | 0x24 |
| 05e3 | CALLDATALOAD | |
| 05e4 | PUSH1 | 0x01 |
| 05e6 | PUSH1 | 0x01 |
| 05e8 | PUSH1 | 0xa0 |
| 05ea | SHL | |
| 05eb | SUB | |
| 05ec | DUP2 | |
| 05ed | AND | |
| 05ee | DUP1 | |
| 05ef | DUP3 | |
| 05f0 | SUB | |
| 05f1 | PUSH2 | 0x0700 |
| 05f4 | JUMPI | |
| 05f5 | PUSH2 | 0x05fc |
| 05f8 | PUSH2 | 0x2444 |
| 05fb | JUMP | |
| 05fc | JUMPDEST | |
| 05fd | PUSH1 | 0x64 |
| 05ff | CALLDATALOAD | |
| 0600 | PUSH1 | 0x01 |
| 0602 | PUSH1 | 0x01 |
| 0604 | PUSH1 | 0x40 |
| 0606 | SHL | |
| 0607 | SUB | |
| 0608 | DUP2 | |
| 0609 | GT | |
| 060a | PUSH2 | 0x06fc |
| 060d | JUMPI | |
| 060e | SWAP1 | |
| 060f | PUSH2 | 0x061f |
| 0612 | PUSH2 | 0x0651 |
| 0615 | SWAP3 | |
| 0616 | CALLDATASIZE | |
| 0617 | SWAP1 | |
| 0618 | PUSH1 | 0x04 |
| 061a | ADD | |
| 061b | PUSH2 | 0x2470 |
| 061e | JUMP | |
| 061f | JUMPDEST | |
| 0620 | PUSH1 | 0x40 |
| 0622 | DUP1 | |
| 0623 | MLOAD | |
| 0624 | PUSH1 | 0x20 |
| 0626 | DUP2 | |
| 0627 | ADD | |
| 0628 | DUP11 | |
| 0629 | DUP2 | |
| 062a | MSTORE | |
| 062b | PUSH1 | 0x01 |
| 062d | PUSH1 | 0x01 |
| 062f | PUSH1 | 0xa0 |
| 0631 | SHL | |
| 0632 | SUB | |
| 0633 | DUP10 | |
| 0634 | AND | |
| 0635 | DUP3 | |
| 0636 | DUP5 | |
| 0637 | ADD | |
| 0638 | MSTORE | |
| 0639 | SWAP2 | |
| 063a | DUP2 | |
| 063b | MSTORE | |
| 063c | SWAP2 | |
| 063d | SWAP4 | |
| 063e | SWAP2 | |
| 063f | PUSH2 | 0x0649 |
| 0642 | PUSH1 | 0x60 |
| 0644 | DUP3 | |
| 0645 | PUSH2 | 0x2508 |
| 0648 | JUMP | |
| 0649 | JUMPDEST | |
| 064a | MLOAD | |
| 064b | SWAP1 | |
| 064c | KECCAK256 | |
| 064d | PUSH2 | 0x2d6e |
| 0650 | JUMP | |
| 0651 | JUMPDEST | |
| 0652 | DUP4 | |
| 0653 | ISZERO | |
| 0654 | ISZERO | |
| 0655 | DUP1 | |
| 0656 | PUSH2 | 0x06f4 |
| 0659 | JUMPI | |
| 065a | JUMPDEST | |
| 065b | PUSH2 | 0x06e5 |
| 065e | JUMPI | |
| 065f | PUSH1 | 0x01 |
| 0661 | PUSH1 | 0x01 |
| 0663 | PUSH1 | 0x58 |
| 0665 | SHL | |
| 0666 | SUB | |
| 0667 | DUP5 | |
| 0668 | GT | |
| 0669 | PUSH2 | 0x06c6 |
| 066c | JUMPI | |
| 066d | PUSH1 | 0x05 |
| 066f | DUP5 | |
| 0670 | SWAP1 | |
| 0671 | SSTORE | |
| 0672 | PUSH1 | 0x06 |
| 0674 | DUP1 | |
| 0675 | SLOAD | |
| 0676 | PUSH1 | 0x01 |
| 0678 | PUSH1 | 0x01 |
| 067a | PUSH1 | 0xa0 |
| 067c | SHL | |
| 067d | SUB | |
| 067e | NOT | |
| 067f | AND | |
| 0680 | SWAP2 | |
| 0681 | SWAP1 | |
| 0682 | SWAP2 | |
| 0683 | OR | |
| 0684 | SWAP1 | |
| 0685 | SSTORE | |
| 0686 | PUSH1 | 0x40 |
| 0688 | DUP1 | |
| 0689 | MLOAD | |
| 068a | SWAP4 | |
| 068b | DUP5 | |
| 068c | MSTORE | |
| 068d | PUSH1 | 0x01 |
| 068f | PUSH1 | 0x01 |
| 0691 | PUSH1 | 0xa0 |
| 0693 | SHL | |
| 0694 | SUB | |
| 0695 | SWAP2 | |
| 0696 | SWAP1 | |
| 0697 | SWAP2 | |
| 0698 | AND | |
| 0699 | PUSH1 | 0x20 |
| 069b | DUP5 | |
| 069c | ADD | |
| 069d | MSTORE | |
| 069e | SWAP1 | |
| 069f | SWAP2 | |
| 06a0 | PUSH32 | 0xcb31391f189faeae4cf8cec8849f690db565c748ce3da5987fd102f1bdeda60b |
| 06c1 | SWAP2 | |
| 06c2 | SWAP1 | |
| 06c3 | LOG1 | |
| 06c4 | DUP1 | |
| 06c5 | RETURN | |
| 06c6 | JUMPDEST | |
| 06c7 | PUSH4 | 0x4ba85a6b |
| 06cc | PUSH1 | 0xe1 |
| 06ce | SHL | |
| 06cf | DUP4 | |
| 06d0 | MSTORE | |
| 06d1 | PUSH1 | 0x01 |
| 06d3 | PUSH1 | 0x01 |
| 06d5 | PUSH1 | 0x58 |
| 06d7 | SHL | |
| 06d8 | SUB | |
| 06d9 | PUSH1 | 0x04 |
| 06db | MSTORE | |
| 06dc | PUSH1 | 0x24 |
| 06de | DUP5 | |
| 06df | SWAP1 | |
| 06e0 | MSTORE | |
| 06e1 | PUSH1 | 0x44 |
| 06e3 | DUP4 | |
| 06e4 | REVERT | |
| 06e5 | JUMPDEST | |
| 06e6 | PUSH4 | 0x18f99d43 |
| 06eb | PUSH1 | 0xe3 |
| 06ed | SHL | |
| 06ee | DUP4 | |
| 06ef | MSTORE | |
| 06f0 | PUSH1 | 0x04 |
| 06f2 | DUP4 | |
| 06f3 | REVERT | |
| 06f4 | JUMPDEST | |
| 06f5 | POP | |
| 06f6 | DUP1 | |
| 06f7 | ISZERO | |
| 06f8 | PUSH2 | 0x065a |
| 06fb | JUMP | |
| 06fc | JUMPDEST | |
| 06fd | DUP5 | |
| 06fe | DUP1 | |
| 06ff | REVERT | |
| 0700 | JUMPDEST | |
| 0701 | DUP3 | |
| 0702 | DUP1 | |
| 0703 | REVERT | |
| 0704 | JUMPDEST | |
| 0705 | POP | |
| 0706 | CALLVALUE | |
| 0707 | PUSH2 | 0x02ed |
| 070a | JUMPI | |
| 070b | DUP1 | |
| 070c | PUSH1 | 0x03 |
| 070e | NOT | |
| 070f | CALLDATASIZE | |
| 0710 | ADD | |
| 0711 | SLT | |
| 0712 | PUSH2 | 0x02ed |
| 0715 | JUMPI | |
| 0716 | PUSH1 | 0x40 |
| 0718 | MLOAD | |
| 0719 | PUSH4 | 0x9a7ec800 |
| 071e | DUP2 | |
| 071f | MSTORE | |
| 0720 | PUSH1 | 0x20 |
| 0722 | SWAP1 | |
| 0723 | RETURN | |
| 0724 | JUMPDEST | |
| 0725 | POP | |
| 0726 | CALLVALUE | |
| 0727 | PUSH2 | 0x02ed |
| 072a | JUMPI | |
| 072b | DUP1 | |
| 072c | PUSH1 | 0x03 |
| 072e | NOT | |
| 072f | CALLDATASIZE | |
| 0730 | ADD | |
| 0731 | SLT | |
| 0732 | PUSH2 | 0x02ed |
| 0735 | JUMPI | |
| 0736 | PUSH1 | 0x20 |
| 0738 | PUSH1 | 0x01 |
| 073a | PUSH1 | 0x01 |
| 073c | PUSH1 | 0x40 |
| 073e | SHL | |
| 073f | SUB | |
| 0740 | PUSH1 | 0x02 |
| 0742 | SLOAD | |
| 0743 | AND | |
| 0744 | PUSH1 | 0x40 |
| 0746 | MLOAD | |
| 0747 | SWAP1 | |
| 0748 | DUP2 | |
| 0749 | MSTORE | |
| 074a | RETURN | |
| 074b | JUMPDEST | |
| 074c | PUSH2 | 0x23d2 |
| 074f | JUMP | |
| 0750 | JUMPDEST | |
| 0751 | POP | |
| 0752 | CALLVALUE | |
| 0753 | PUSH2 | 0x02ed |
| 0756 | JUMPI | |
| 0757 | DUP1 | |
| 0758 | PUSH1 | 0x03 |
| 075a | NOT | |
| 075b | CALLDATASIZE | |
| 075c | ADD | |
| 075d | SLT | |
| 075e | PUSH2 | 0x02ed |
| 0761 | JUMPI | |
| 0762 | PUSH1 | 0x07 |
| 0764 | SLOAD | |
| 0765 | PUSH1 | 0x40 |
| 0767 | MLOAD | |
| 0768 | PUSH1 | 0x01 |
| 076a | PUSH1 | 0x01 |
| 076c | PUSH1 | 0xa0 |
| 076e | SHL | |
| 076f | SUB | |
| 0770 | SWAP1 | |
| 0771 | SWAP2 | |
| 0772 | AND | |
| 0773 | DUP2 | |
| 0774 | MSTORE | |
| 0775 | PUSH1 | 0x20 |
| 0777 | SWAP1 | |
| 0778 | RETURN | |
| 0779 | JUMPDEST | |
| 077a | POP | |
| 077b | CALLVALUE | |
| 077c | PUSH2 | 0x02ed |
| 077f | JUMPI | |
| 0780 | PUSH1 | 0x60 |
| 0782 | CALLDATASIZE | |
| 0783 | PUSH1 | 0x03 |
| 0785 | NOT | |
| 0786 | ADD | |
| 0787 | SLT | |
| 0788 | PUSH2 | 0x02ed |
| 078b | JUMPI | |
| 078c | PUSH1 | 0x04 |
| 078e | CALLDATALOAD | |
| 078f | DUP2 | |
| 0790 | PUSH1 | 0x24 |
| 0792 | CALLDATALOAD | |
| 0793 | PUSH1 | 0x01 |
| 0795 | PUSH1 | 0x01 |
| 0797 | PUSH1 | 0x40 |
| 0799 | SHL | |
| 079a | SUB | |
| 079b | DUP2 | |
| 079c | GT | |
| 079d | PUSH2 | 0x09c9 |
| 07a0 | JUMPI | |
| 07a1 | PUSH2 | 0x07ae |
| 07a4 | SWAP1 | |
| 07a5 | CALLDATASIZE | |
| 07a6 | SWAP1 | |
| 07a7 | PUSH1 | 0x04 |
| 07a9 | ADD | |
| 07aa | PUSH2 | 0x23ed |
| 07ad | JUMP | |
| 07ae | JUMPDEST | |
| 07af | SWAP1 | |
| 07b0 | PUSH1 | 0x44 |
| 07b2 | CALLDATALOAD | |
| 07b3 | PUSH1 | 0x01 |
| 07b5 | PUSH1 | 0x01 |
| 07b7 | PUSH1 | 0x40 |
| 07b9 | SHL | |
| 07ba | SUB | |
| 07bb | DUP2 | |
| 07bc | GT | |
| 07bd | PUSH2 | 0x03fd |
| 07c0 | JUMPI | |
| 07c1 | PUSH2 | 0x0834 |
| 07c4 | SWAP2 | |
| 07c5 | PUSH2 | 0x07d3 |
| 07c8 | DUP7 | |
| 07c9 | SWAP3 | |
| 07ca | CALLDATASIZE | |
| 07cb | SWAP1 | |
| 07cc | PUSH1 | 0x04 |
| 07ce | ADD | |
| 07cf | PUSH2 | 0x23ed |
| 07d2 | JUMP | |
| 07d3 | JUMPDEST | |
| 07d4 | SWAP1 | |
| 07d5 | PUSH2 | 0x07dd |
| 07d8 | DUP5 | |
| 07d9 | PUSH2 | 0x293e |
| 07dc | JUMP | |
| 07dd | JUMPDEST | |
| 07de | SWAP6 | |
| 07df | PUSH1 | 0x40 |
| 07e1 | MLOAD | |
| 07e2 | PUSH1 | 0x20 |
| 07e4 | DUP2 | |
| 07e5 | ADD | |
| 07e6 | SWAP1 | |
| 07e7 | PUSH32 | 0xcc7c08481f764947d6a6fa10f1913f9c489bcbe1ea586c5d4aca3bb0d12f45f6 |
| 0808 | DUP3 | |
| 0809 | MSTORE | |
| 080a | CHAINID | |
| 080b | PUSH1 | 0x40 |
| 080d | DUP3 | |
| 080e | ADD | |
| 080f | MSTORE | |
| 0810 | ADDRESS | |
| 0811 | PUSH1 | 0x60 |
| 0813 | DUP3 | |
| 0814 | ADD | |
| 0815 | MSTORE | |
| 0816 | DUP7 | |
| 0817 | PUSH1 | 0x80 |
| 0819 | DUP3 | |
| 081a | ADD | |
| 081b | MSTORE | |
| 081c | PUSH1 | 0x80 |
| 081e | DUP2 | |
| 081f | MSTORE | |
| 0820 | PUSH2 | 0x082a |
| 0823 | PUSH1 | 0xa0 |
| 0825 | DUP3 | |
| 0826 | PUSH2 | 0x2508 |
| 0829 | JUMP | |
| 082a | JUMPDEST | |
| 082b | MLOAD | |
| 082c | SWAP1 | |
| 082d | KECCAK256 | |
| 082e | SWAP4 | |
| 082f | DUP8 | |
| 0830 | PUSH2 | 0x29be |
| 0833 | JUMP | |
| 0834 | JUMPDEST | |
| 0835 | PUSH1 | 0x04 |
| 0837 | DUP2 | |
| 0838 | ADD | |
| 0839 | DUP1 | |
| 083a | SLOAD | |
| 083b | PUSH16 | 0xffffffffffffffff0000000000000000 |
| 084c | NOT | |
| 084d | AND | |
| 084e | TIMESTAMP | |
| 084f | PUSH1 | 0x40 |
| 0851 | SHL | |
| 0852 | PUSH8 | 0xffffffffffffffff |
| 085b | PUSH1 | 0x40 |
| 085d | SHL | |
| 085e | AND | |
| 085f | OR | |
| 0860 | DUP2 | |
| 0861 | SSTORE | |
| 0862 | SWAP1 | |
| 0863 | PUSH1 | 0x40 |
| 0865 | SWAP1 | |
| 0866 | PUSH2 | 0x08f1 |
| 0869 | DUP3 | |
| 086a | MLOAD | |
| 086b | SWAP2 | |
| 086c | PUSH2 | 0x0875 |
| 086f | DUP5 | |
| 0870 | DUP5 | |
| 0871 | PUSH2 | 0x2508 |
| 0874 | JUMP | |
| 0875 | JUMPDEST | |
| 0876 | PUSH1 | 0x01 |
| 0878 | DUP4 | |
| 0879 | MSTORE | |
| 087a | PUSH1 | 0x01 |
| 087c | PUSH1 | 0x01 |
| 087e | PUSH1 | 0x40 |
| 0880 | SHL | |
| 0881 | SUB | |
| 0882 | PUSH1 | 0x1f |
| 0884 | NOT | |
| 0885 | DUP6 | |
| 0886 | ADD | |
| 0887 | SWAP6 | |
| 0888 | DUP7 | |
| 0889 | CALLDATASIZE | |
| 088a | PUSH1 | 0x20 |
| 088c | DUP8 | |
| 088d | ADD | |
| 088e | CALLDATACOPY | |
| 088f | DUP6 | |
| 0890 | MLOAD | |
| 0891 | SWAP7 | |
| 0892 | PUSH2 | 0x089b |
| 0895 | DUP8 | |
| 0896 | DUP10 | |
| 0897 | PUSH2 | 0x2508 |
| 089a | JUMP | |
| 089b | JUMPDEST | |
| 089c | PUSH1 | 0x01 |
| 089e | DUP9 | |
| 089f | MSTORE | |
| 08a0 | CALLDATASIZE | |
| 08a1 | PUSH1 | 0x20 |
| 08a3 | DUP10 | |
| 08a4 | ADD | |
| 08a5 | CALLDATACOPY | |
| 08a6 | SLOAD | |
| 08a7 | PUSH1 | 0x80 |
| 08a9 | SHR | |
| 08aa | AND | |
| 08ab | SWAP1 | |
| 08ac | PUSH2 | 0x08b4 |
| 08af | DUP3 | |
| 08b0 | PUSH2 | 0x2792 |
| 08b3 | JUMP | |
| 08b4 | JUMPDEST | |
| 08b5 | PUSH2 | 0x08bd |
| 08b8 | DUP6 | |
| 08b9 | PUSH2 | 0x2a67 |
| 08bc | JUMP | |
| 08bd | JUMPDEST | |
| 08be | MSTORE | |
| 08bf | DUP1 | |
| 08c0 | SLOAD | |
| 08c1 | SWAP1 | |
| 08c2 | PUSH1 | 0x01 |
| 08c4 | PUSH1 | 0x03 |
| 08c6 | DUP3 | |
| 08c7 | ADD | |
| 08c8 | SLOAD | |
| 08c9 | SWAP2 | |
| 08ca | ADD | |
| 08cb | SLOAD | |
| 08cc | SWAP2 | |
| 08cd | PUSH1 | 0x01 |
| 08cf | PUSH1 | 0x01 |
| 08d1 | PUSH1 | 0x40 |
| 08d3 | SHL | |
| 08d4 | SUB | |
| 08d5 | DUP2 | |
| 08d6 | PUSH1 | 0x80 |
| 08d8 | SHR | |
| 08d9 | AND | |
| 08da | SWAP1 | |
| 08db | PUSH1 | 0x01 |
| 08dd | PUSH1 | 0x01 |
| 08df | PUSH1 | 0x40 |
| 08e1 | SHL | |
| 08e2 | SUB | |
| 08e3 | DUP1 | |
| 08e4 | DUP3 | |
| 08e5 | DUP11 | |
| 08e6 | SHR | |
| 08e7 | AND | |
| 08e8 | SWAP2 | |
| 08e9 | AND | |
| 08ea | PUSH1 | 0x04 |
| 08ec | DUP13 | |
| 08ed | PUSH2 | 0x26b0 |
| 08f0 | JUMP | |
| 08f1 | JUMPDEST | |
| 08f2 | PUSH2 | 0x08fa |
| 08f5 | DUP5 | |
| 08f6 | PUSH2 | 0x2a67 |
| 08f9 | JUMP | |
| 08fa | JUMPDEST | |
| 08fb | MSTORE | |
| 08fc | PUSH32 | 0x0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c8 |
| 091d | PUSH1 | 0x01 |
| 091f | PUSH1 | 0x01 |
| 0921 | PUSH1 | 0xa0 |
| 0923 | SHL | |
| 0924 | SUB | |
| 0925 | AND | |
| 0926 | SWAP3 | |
| 0927 | DUP4 | |
| 0928 | EXTCODESIZE | |
| 0929 | ISZERO | |
| 092a | PUSH2 | 0x06fc |
| 092d | JUMPI | |
| 092e | PUSH2 | 0x097b |
| 0931 | SWAP4 | |
| 0932 | PUSH2 | 0x0969 |
| 0935 | DUP7 | |
| 0936 | DUP1 | |
| 0937 | SWAP5 | |
| 0938 | DUP7 | |
| 0939 | MLOAD | |
| 093a | SWAP8 | |
| 093b | DUP9 | |
| 093c | SWAP6 | |
| 093d | DUP7 | |
| 093e | SWAP5 | |
| 093f | DUP6 | |
| 0940 | SWAP4 | |
| 0941 | PUSH4 | 0xabf1570d |
| 0946 | PUSH1 | 0xe0 |
| 0948 | SHL | |
| 0949 | DUP6 | |
| 094a | MSTORE | |
| 094b | PUSH1 | 0x07 |
| 094d | PUSH1 | 0x04 |
| 094f | DUP7 | |
| 0950 | ADD | |
| 0951 | MSTORE | |
| 0952 | PUSH1 | 0x01 |
| 0954 | PUSH1 | 0x24 |
| 0956 | DUP7 | |
| 0957 | ADD | |
| 0958 | MSTORE | |
| 0959 | PUSH1 | 0x80 |
| 095b | PUSH1 | 0x44 |
| 095d | DUP7 | |
| 095e | ADD | |
| 095f | MSTORE | |
| 0960 | PUSH1 | 0x84 |
| 0962 | DUP6 | |
| 0963 | ADD | |
| 0964 | SWAP1 | |
| 0965 | PUSH2 | 0x2a88 |
| 0968 | JUMP | |
| 0969 | JUMPDEST | |
| 096a | DUP4 | |
| 096b | DUP2 | |
| 096c | SUB | |
| 096d | PUSH1 | 0x03 |
| 096f | NOT | |
| 0970 | ADD | |
| 0971 | PUSH1 | 0x64 |
| 0973 | DUP6 | |
| 0974 | ADD | |
| 0975 | MSTORE | |
| 0976 | SWAP1 | |
| 0977 | PUSH2 | 0x2a88 |
| 097a | JUMP | |
| 097b | JUMPDEST | |
| 097c | SUB | |
| 097d | SWAP3 | |
| 097e | GAS | |
| 097f | CALL | |
| 0980 | SWAP1 | |
| 0981 | DUP2 | |
| 0982 | ISZERO | |
| 0983 | PUSH2 | 0x09cd |
| 0986 | JUMPI | |
| 0987 | POP | |
| 0988 | PUSH2 | 0x09b4 |
| 098b | JUMPI | |
| 098c | JUMPDEST | |
| 098d | POP | |
| 098e | DUP1 | |
| 098f | PUSH32 | 0xc08eb64db16a39d2848960af04e3f16fb404d9d436a9f0e9d7d0d4854715c9dc |
| 09b0 | SWAP2 | |
| 09b1 | LOG2 | |
| 09b2 | DUP1 | |
| 09b3 | RETURN | |
| 09b4 | JUMPDEST | |
| 09b5 | DUP2 | |
| 09b6 | PUSH2 | 0x09be |
| 09b9 | SWAP2 | |
| 09ba | PUSH2 | 0x2508 |
| 09bd | JUMP | |
| 09be | JUMPDEST | |
| 09bf | PUSH2 | 0x09c9 |
| 09c2 | JUMPI | |
| 09c3 | DUP2 | |
| 09c4 | PUSH0 | |
| 09c5 | PUSH2 | 0x098c |
| 09c8 | JUMP | |
| 09c9 | JUMPDEST | |
| 09ca | POP | |
| 09cb | DUP1 | |
| 09cc | REVERT | |
| 09cd | JUMPDEST | |
| 09ce | MLOAD | |
| 09cf | RETURNDATASIZE | |
| 09d0 | DUP5 | |
| 09d1 | DUP3 | |
| 09d2 | RETURNDATACOPY | |
| 09d3 | RETURNDATASIZE | |
| 09d4 | SWAP1 | |
| 09d5 | REVERT | |
| 09d6 | JUMPDEST | |
| 09d7 | POP | |
| 09d8 | CALLVALUE | |
| 09d9 | PUSH2 | 0x02ed |
| 09dc | JUMPI | |
| 09dd | PUSH1 | 0x20 |
| 09df | CALLDATASIZE | |
| 09e0 | PUSH1 | 0x03 |
| 09e2 | NOT | |
| 09e3 | ADD | |
| 09e4 | SLT | |
| 09e5 | PUSH2 | 0x02ed |
| 09e8 | JUMPI | |
| 09e9 | PUSH1 | 0x07 |
| 09eb | SLOAD | |
| 09ec | PUSH1 | 0x04 |
| 09ee | CALLDATALOAD | |
| 09ef | SWAP1 | |
| 09f0 | PUSH1 | 0x01 |
| 09f2 | PUSH1 | 0x01 |
| 09f4 | PUSH1 | 0xa0 |
| 09f6 | SHL | |
| 09f7 | SUB | |
| 09f8 | AND | |
| 09f9 | DUP1 | |
| 09fa | ISZERO | |
| 09fb | PUSH2 | 0x0ccb |
| 09fe | JUMPI | |
| 09ff | CALLER | |
| 0a00 | SUB | |
| 0a01 | PUSH2 | 0x0cb8 |
| 0a04 | JUMPI | |
| 0a05 | DUP1 | |
| 0a06 | DUP3 | |
| 0a07 | MSTORE | |
| 0a08 | DUP2 | |
| 0a09 | PUSH1 | 0x20 |
| 0a0b | MSTORE | |
| 0a0c | PUSH1 | 0x40 |
| 0a0e | DUP3 | |
| 0a0f | KECCAK256 | |
| 0a10 | DUP1 | |
| 0a11 | SLOAD | |
| 0a12 | SWAP1 | |
| 0a13 | PUSH1 | 0x01 |
| 0a15 | PUSH1 | 0x01 |
| 0a17 | PUSH1 | 0x40 |
| 0a19 | SHL | |
| 0a1a | SUB | |
| 0a1b | DUP3 | |
| 0a1c | AND | |
| 0a1d | ISZERO | |
| 0a1e | PUSH2 | 0x0ca4 |
| 0a21 | JUMPI | |
| 0a22 | DUP2 | |
| 0a23 | PUSH1 | 0xc0 |
| 0a25 | SHR | |
| 0a26 | DUP1 | |
| 0a27 | PUSH2 | 0x0c8d |
| 0a2a | JUMPI | |
| 0a2b | POP | |
| 0a2c | PUSH1 | 0x04 |
| 0a2e | DUP2 | |
| 0a2f | ADD | |
| 0a30 | SWAP2 | |
| 0a31 | DUP3 | |
| 0a32 | SLOAD | |
| 0a33 | PUSH1 | 0x01 |
| 0a35 | PUSH1 | 0x01 |
| 0a37 | PUSH1 | 0x40 |
| 0a39 | SHL | |
| 0a3a | SUB | |
| 0a3b | DUP2 | |
| 0a3c | PUSH1 | 0x40 |
| 0a3e | SHR | |
| 0a3f | AND | |
| 0a40 | DUP1 | |
| 0a41 | PUSH2 | 0x0c76 |
| 0a44 | JUMPI | |
| 0a45 | POP | |
| 0a46 | PUSH1 | 0x01 |
| 0a48 | PUSH1 | 0x01 |
| 0a4a | PUSH1 | 0x40 |
| 0a4c | SHL | |
| 0a4d | SUB | |
| 0a4e | TIMESTAMP | |
| 0a4f | AND | |
| 0a50 | SWAP2 | |
| 0a51 | PUSH1 | 0x01 |
| 0a53 | PUSH1 | 0x01 |
| 0a55 | PUSH1 | 0x40 |
| 0a57 | SHL | |
| 0a58 | SUB | |
| 0a59 | DUP2 | |
| 0a5a | PUSH1 | 0x80 |
| 0a5c | SHR | |
| 0a5d | AND | |
| 0a5e | DUP1 | |
| 0a5f | DUP5 | |
| 0a60 | GT | |
| 0a61 | PUSH2 | 0x0c5f |
| 0a64 | JUMPI | |
| 0a65 | POP | |
| 0a66 | PUSH1 | 0x01 |
| 0a68 | PUSH1 | 0x01 |
| 0a6a | PUSH1 | 0x40 |
| 0a6c | SHL | |
| 0a6d | SUB | |
| 0a6e | SWAP1 | |
| 0a6f | DUP2 | |
| 0a70 | PUSH2 | 0x0a81 |
| 0a73 | PUSH2 | 0x0a7b |
| 0a76 | DUP8 | |
| 0a77 | PUSH2 | 0x31d2 |
| 0a7a | JUMP | |
| 0a7b | JUMPDEST | |
| 0a7c | DUP7 | |
| 0a7d | PUSH2 | 0x275e |
| 0a80 | JUMP | |
| 0a81 | JUMPDEST | |
| 0a82 | SWAP2 | |
| 0a83 | PUSH1 | 0x40 |
| 0a85 | SHR | |
| 0a86 | AND | |
| 0a87 | SWAP2 | |
| 0a88 | DUP3 | |
| 0a89 | SWAP2 | |
| 0a8a | AND | |
| 0a8b | LT | |
| 0a8c | PUSH2 | 0x0c43 |
| 0a8f | JUMPI | |
| 0a90 | POP | |
| 0a91 | PUSH1 | 0x01 |
| 0a93 | PUSH1 | 0x01 |
| 0a95 | PUSH1 | 0x40 |
| 0a97 | SHL | |
| 0a98 | SUB | |
| 0a99 | DUP2 | |
| 0a9a | AND | |
| 0a9b | ISZERO | |
| 0a9c | SWAP1 | |
| 0a9d | DUP2 | |
| 0a9e | PUSH2 | 0x0c34 |
| 0aa1 | JUMPI | |
| 0aa2 | JUMPDEST | |
| 0aa3 | POP | |
| 0aa4 | PUSH2 | 0x0c20 |
| 0aa7 | JUMPI | |
| 0aa8 | DUP2 | |
| 0aa9 | SLOAD | |
| 0aaa | PUSH1 | 0x01 |
| 0aac | PUSH1 | 0x01 |
| 0aae | PUSH1 | 0xc0 |
| 0ab0 | SHL | |
| 0ab1 | SUB | |
| 0ab2 | AND | |
| 0ab3 | PUSH1 | 0xc0 |
| 0ab5 | SWAP2 | |
| 0ab6 | SWAP1 | |
| 0ab7 | SWAP2 | |
| 0ab8 | SHL | |
| 0ab9 | PUSH1 | 0x01 |
| 0abb | PUSH1 | 0x01 |
| 0abd | PUSH1 | 0xc0 |
| 0abf | SHL | |
| 0ac0 | SUB | |
| 0ac1 | NOT | |
| 0ac2 | AND | |
| 0ac3 | OR | |
| 0ac4 | DUP2 | |
| 0ac5 | SSTORE | |
| 0ac6 | DUP4 | |
| 0ac7 | SWAP2 | |
| 0ac8 | SWAP1 | |
| 0ac9 | PUSH1 | 0x40 |
| 0acb | SWAP1 | |
| 0acc | PUSH2 | 0x0b57 |
| 0acf | DUP3 | |
| 0ad0 | MLOAD | |
| 0ad1 | SWAP2 | |
| 0ad2 | PUSH2 | 0x0adb |
| 0ad5 | DUP5 | |
| 0ad6 | DUP5 | |
| 0ad7 | PUSH2 | 0x2508 |
| 0ada | JUMP | |
| 0adb | JUMPDEST | |
| 0adc | PUSH1 | 0x01 |
| 0ade | DUP4 | |
| 0adf | MSTORE | |
| 0ae0 | PUSH1 | 0x01 |
| 0ae2 | PUSH1 | 0x01 |
| 0ae4 | PUSH1 | 0x40 |
| 0ae6 | SHL | |
| 0ae7 | SUB | |
| 0ae8 | PUSH1 | 0x1f |
| 0aea | NOT | |
| 0aeb | DUP6 | |
| 0aec | ADD | |
| 0aed | SWAP6 | |
| 0aee | DUP7 | |
| 0aef | CALLDATASIZE | |
| 0af0 | PUSH1 | 0x20 |
| 0af2 | DUP8 | |
| 0af3 | ADD | |
| 0af4 | CALLDATACOPY | |
| 0af5 | DUP6 | |
| 0af6 | MLOAD | |
| 0af7 | SWAP7 | |
| 0af8 | PUSH2 | 0x0b01 |
| 0afb | DUP8 | |
| 0afc | DUP10 | |
| 0afd | PUSH2 | 0x2508 |
| 0b00 | JUMP | |
| 0b01 | JUMPDEST | |
| 0b02 | PUSH1 | 0x01 |
| 0b04 | DUP9 | |
| 0b05 | MSTORE | |
| 0b06 | CALLDATASIZE | |
| 0b07 | PUSH1 | 0x20 |
| 0b09 | DUP10 | |
| 0b0a | ADD | |
| 0b0b | CALLDATACOPY | |
| 0b0c | SLOAD | |
| 0b0d | PUSH1 | 0x80 |
| 0b0f | SHR | |
| 0b10 | AND | |
| 0b11 | SWAP1 | |
| 0b12 | PUSH2 | 0x0b1a |
| 0b15 | DUP3 | |
| 0b16 | PUSH2 | 0x2792 |
| 0b19 | JUMP | |
| 0b1a | JUMPDEST | |
| 0b1b | PUSH2 | 0x0b23 |
| 0b1e | DUP6 | |
| 0b1f | PUSH2 | 0x2a67 |
| 0b22 | JUMP | |
| 0b23 | JUMPDEST | |
| 0b24 | MSTORE | |
| 0b25 | DUP1 | |
| 0b26 | SLOAD | |
| 0b27 | SWAP1 | |
| 0b28 | PUSH1 | 0x01 |
| 0b2a | PUSH1 | 0x03 |
| 0b2c | DUP3 | |
| 0b2d | ADD | |
| 0b2e | SLOAD | |
| 0b2f | SWAP2 | |
| 0b30 | ADD | |
| 0b31 | SLOAD | |
| 0b32 | SWAP2 | |
| 0b33 | PUSH1 | 0x01 |
| 0b35 | PUSH1 | 0x01 |
| 0b37 | PUSH1 | 0x40 |
| 0b39 | SHL | |
| 0b3a | SUB | |
| 0b3b | DUP2 | |
| 0b3c | PUSH1 | 0x80 |
| 0b3e | SHR | |
| 0b3f | AND | |
| 0b40 | SWAP1 | |
| 0b41 | PUSH1 | 0x01 |
| 0b43 | PUSH1 | 0x01 |
| 0b45 | PUSH1 | 0x40 |
| 0b47 | SHL | |
| 0b48 | SUB | |
| 0b49 | DUP1 | |
| 0b4a | DUP3 | |
| 0b4b | DUP11 | |
| 0b4c | SHR | |
| 0b4d | AND | |
| 0b4e | SWAP2 | |
| 0b4f | AND | |
| 0b50 | PUSH1 | 0x03 |
| 0b52 | DUP13 | |
| 0b53 | PUSH2 | 0x26b0 |
| 0b56 | JUMP | |
| 0b57 | JUMPDEST | |
| 0b58 | PUSH2 | 0x0b60 |
| 0b5b | DUP5 | |
| 0b5c | PUSH2 | 0x2a67 |
| 0b5f | JUMP | |
| 0b60 | JUMPDEST | |
| 0b61 | MSTORE | |
| 0b62 | PUSH32 | 0x0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c8 |
| 0b83 | PUSH1 | 0x01 |
| 0b85 | PUSH1 | 0x01 |
| 0b87 | PUSH1 | 0xa0 |
| 0b89 | SHL | |
| 0b8a | SUB | |
| 0b8b | AND | |
| 0b8c | SWAP3 | |
| 0b8d | DUP4 | |
| 0b8e | EXTCODESIZE | |
| 0b8f | ISZERO | |
| 0b90 | PUSH2 | 0x06fc |
| 0b93 | JUMPI | |
| 0b94 | PUSH2 | 0x0bcf |
| 0b97 | SWAP4 | |
| 0b98 | PUSH2 | 0x0969 |
| 0b9b | DUP7 | |
| 0b9c | DUP1 | |
| 0b9d | SWAP5 | |
| 0b9e | DUP7 | |
| 0b9f | MLOAD | |
| 0ba0 | SWAP8 | |
| 0ba1 | DUP9 | |
| 0ba2 | SWAP6 | |
| 0ba3 | DUP7 | |
| 0ba4 | SWAP5 | |
| 0ba5 | DUP6 | |
| 0ba6 | SWAP4 | |
| 0ba7 | PUSH4 | 0xabf1570d |
| 0bac | PUSH1 | 0xe0 |
| 0bae | SHL | |
| 0baf | DUP6 | |
| 0bb0 | MSTORE | |
| 0bb1 | PUSH1 | 0x07 |
| 0bb3 | PUSH1 | 0x04 |
| 0bb5 | DUP7 | |
| 0bb6 | ADD | |
| 0bb7 | MSTORE | |
| 0bb8 | PUSH1 | 0x01 |
| 0bba | PUSH1 | 0x24 |
| 0bbc | DUP7 | |
| 0bbd | ADD | |
| 0bbe | MSTORE | |
| 0bbf | PUSH1 | 0x80 |
| 0bc1 | PUSH1 | 0x44 |
| 0bc3 | DUP7 | |
| 0bc4 | ADD | |
| 0bc5 | MSTORE | |
| 0bc6 | PUSH1 | 0x84 |
| 0bc8 | DUP6 | |
| 0bc9 | ADD | |
| 0bca | SWAP1 | |
| 0bcb | PUSH2 | 0x2a88 |
| 0bce | JUMP | |
| 0bcf | JUMPDEST | |
| 0bd0 | SUB | |
| 0bd1 | SWAP3 | |
| 0bd2 | GAS | |
| 0bd3 | CALL | |
| 0bd4 | SWAP1 | |
| 0bd5 | DUP2 | |
| 0bd6 | ISZERO | |
| 0bd7 | PUSH2 | 0x09cd |
| 0bda | JUMPI | |
| 0bdb | POP | |
| 0bdc | PUSH2 | 0x0c0b |
| 0bdf | JUMPI | |
| 0be0 | JUMPDEST | |
| 0be1 | POP | |
| 0be2 | POP | |
| 0be3 | CALLER | |
| 0be4 | SWAP1 | |
| 0be5 | PUSH32 | 0x1408bd9a6e6ac1e782a8780a8d173b72dff516f8deb1cf14209f043d74d7f884 |
| 0c06 | DUP4 | |
| 0c07 | DUP1 | |
| 0c08 | LOG3 | |
| 0c09 | DUP1 | |
| 0c0a | RETURN | |
| 0c0b | JUMPDEST | |
| 0c0c | DUP2 | |
| 0c0d | PUSH2 | 0x0c15 |
| 0c10 | SWAP2 | |
| 0c11 | PUSH2 | 0x2508 |
| 0c14 | JUMP | |
| 0c15 | JUMPDEST | |
| 0c16 | PUSH2 | 0x09c9 |
| 0c19 | JUMPI | |
| 0c1a | DUP2 | |
| 0c1b | PUSH0 | |
| 0c1c | PUSH2 | 0x0be0 |
| 0c1f | JUMP | |
| 0c20 | JUMPDEST | |
| 0c21 | PUSH4 | 0xc5d89109 |
| 0c26 | PUSH1 | 0xe0 |
| 0c28 | SHL | |
| 0c29 | DUP6 | |
| 0c2a | MSTORE | |
| 0c2b | PUSH1 | 0x04 |
| 0c2d | DUP5 | |
| 0c2e | SWAP1 | |
| 0c2f | MSTORE | |
| 0c30 | PUSH1 | 0x24 |
| 0c32 | DUP6 | |
| 0c33 | REVERT | |
| 0c34 | JUMPDEST | |
| 0c35 | PUSH1 | 0x01 |
| 0c37 | SWAP2 | |
| 0c38 | POP | |
| 0c39 | PUSH1 | 0xc0 |
| 0c3b | SHR | |
| 0c3c | AND | |
| 0c3d | ISZERO | |
| 0c3e | PUSH0 | |
| 0c3f | PUSH2 | 0x0aa2 |
| 0c42 | JUMP | |
| 0c43 | JUMPDEST | |
| 0c44 | PUSH4 | 0x28ae40d3 |
| 0c49 | PUSH1 | 0xe1 |
| 0c4b | SHL | |
| 0c4c | DUP8 | |
| 0c4d | MSTORE | |
| 0c4e | PUSH1 | 0x04 |
| 0c50 | DUP7 | |
| 0c51 | SWAP1 | |
| 0c52 | MSTORE | |
| 0c53 | PUSH1 | 0x24 |
| 0c55 | MSTORE | |
| 0c56 | PUSH1 | 0x44 |
| 0c58 | DUP3 | |
| 0c59 | SWAP1 | |
| 0c5a | MSTORE | |
| 0c5b | PUSH1 | 0x64 |
| 0c5d | DUP7 | |
| 0c5e | REVERT | |
| 0c5f | JUMPDEST | |
| 0c60 | PUSH4 | 0x4d13561d |
| 0c65 | PUSH1 | 0xe0 |
| 0c67 | SHL | |
| 0c68 | DUP9 | |
| 0c69 | MSTORE | |
| 0c6a | PUSH1 | 0x04 |
| 0c6c | DUP8 | |
| 0c6d | SWAP1 | |
| 0c6e | MSTORE | |
| 0c6f | PUSH1 | 0x24 |
| 0c71 | MSTORE | |
| 0c72 | PUSH1 | 0x44 |
| 0c74 | DUP8 | |
| 0c75 | REVERT | |
| 0c76 | JUMPDEST | |
| 0c77 | PUSH4 | 0x37e3280d |
| 0c7c | PUSH1 | 0xe2 |
| 0c7e | SHL | |
| 0c7f | DUP8 | |
| 0c80 | MSTORE | |
| 0c81 | PUSH1 | 0x04 |
| 0c83 | DUP7 | |
| 0c84 | SWAP1 | |
| 0c85 | MSTORE | |
| 0c86 | PUSH1 | 0x24 |
| 0c88 | MSTORE | |
| 0c89 | PUSH1 | 0x44 |
| 0c8b | DUP7 | |
| 0c8c | REVERT | |
| 0c8d | JUMPDEST | |
| 0c8e | PUSH4 | 0x86de1953 |
| 0c93 | PUSH1 | 0xe0 |
| 0c95 | SHL | |
| 0c96 | DUP6 | |
| 0c97 | MSTORE | |
| 0c98 | PUSH1 | 0x04 |
| 0c9a | DUP5 | |
| 0c9b | SWAP1 | |
| 0c9c | MSTORE | |
| 0c9d | PUSH1 | 0x24 |
| 0c9f | MSTORE | |
| 0ca0 | PUSH1 | 0x44 |
| 0ca2 | DUP5 | |
| 0ca3 | REVERT | |
| 0ca4 | JUMPDEST | |
| 0ca5 | PUSH4 | 0x54880ffd |
| 0caa | PUSH1 | 0xe1 |
| 0cac | SHL | |
| 0cad | DUP5 | |
| 0cae | MSTORE | |
| 0caf | PUSH1 | 0x04 |
| 0cb1 | DUP4 | |
| 0cb2 | SWAP1 | |
| 0cb3 | MSTORE | |
| 0cb4 | PUSH1 | 0x24 |
| 0cb6 | DUP5 | |
| 0cb7 | REVERT | |
| 0cb8 | JUMPDEST | |
| 0cb9 | PUSH4 | 0x16f28f79 |
| 0cbe | PUSH1 | 0xe2 |
| 0cc0 | SHL | |
| 0cc1 | DUP3 | |
| 0cc2 | MSTORE | |
| 0cc3 | CALLER | |
| 0cc4 | PUSH1 | 0x04 |
| 0cc6 | MSTORE | |
| 0cc7 | PUSH1 | 0x24 |
| 0cc9 | DUP3 | |
| 0cca | REVERT | |
| 0ccb | JUMPDEST | |
| 0ccc | PUSH4 | 0xedc1a9bb |
| 0cd1 | PUSH1 | 0xe0 |
| 0cd3 | SHL | |
| 0cd4 | DUP4 | |
| 0cd5 | MSTORE | |
| 0cd6 | PUSH1 | 0x04 |
| 0cd8 | DUP4 | |
| 0cd9 | REVERT | |
| 0cda | JUMPDEST | |
| 0cdb | POP | |
| 0cdc | CALLVALUE | |
| 0cdd | PUSH2 | 0x02ed |
| 0ce0 | JUMPI | |
| 0ce1 | PUSH1 | 0x20 |
| 0ce3 | CALLDATASIZE | |
| 0ce4 | PUSH1 | 0x03 |
| 0ce6 | NOT | |
| 0ce7 | ADD | |
| 0ce8 | SLT | |
| 0ce9 | PUSH2 | 0x02ed |
| 0cec | JUMPI | |
| 0ced | PUSH1 | 0x40 |
| 0cef | PUSH1 | 0x20 |
| 0cf1 | SWAP2 | |
| 0cf2 | PUSH1 | 0x04 |
| 0cf4 | CALLDATALOAD | |
| 0cf5 | DUP2 | |
| 0cf6 | MSTORE | |
| 0cf7 | DUP1 | |
| 0cf8 | DUP4 | |
| 0cf9 | MSTORE | |
| 0cfa | KECCAK256 | |
| 0cfb | PUSH1 | 0x01 |
| 0cfd | PUSH1 | 0x01 |
| 0cff | PUSH1 | 0x40 |
| 0d01 | SHL | |
| 0d02 | SUB | |
| 0d03 | TIMESTAMP | |
| 0d04 | AND | |
| 0d05 | SWAP1 | |
| 0d06 | DUP1 | |
| 0d07 | SLOAD | |
| 0d08 | PUSH1 | 0x01 |
| 0d0a | PUSH1 | 0x01 |
| 0d0c | PUSH1 | 0x40 |
| 0d0e | SHL | |
| 0d0f | SUB | |
| 0d10 | DUP2 | |
| 0d11 | AND | |
| 0d12 | ISZERO | |
| 0d13 | ISZERO | |
| 0d14 | SWAP3 | |
| 0d15 | DUP4 | |
| 0d16 | PUSH2 | 0x0dd1 |
| 0d19 | JUMPI | |
| 0d1a | JUMPDEST | |
| 0d1b | DUP4 | |
| 0d1c | PUSH2 | 0x0db8 |
| 0d1f | JUMPI | |
| 0d20 | JUMPDEST | |
| 0d21 | DUP4 | |
| 0d22 | PUSH2 | 0x0da0 |
| 0d25 | JUMPI | |
| 0d26 | JUMPDEST | |
| 0d27 | DUP4 | |
| 0d28 | PUSH2 | 0x0d6e |
| 0d2b | JUMPI | |
| 0d2c | JUMPDEST | |
| 0d2d | POP | |
| 0d2e | POP | |
| 0d2f | DUP2 | |
| 0d30 | PUSH2 | 0x0d3f |
| 0d33 | JUMPI | |
| 0d34 | JUMPDEST | |
| 0d35 | POP | |
| 0d36 | PUSH1 | 0x40 |
| 0d38 | MLOAD | |
| 0d39 | SWAP1 | |
| 0d3a | ISZERO | |
| 0d3b | ISZERO | |
| 0d3c | DUP2 | |
| 0d3d | MSTORE | |
| 0d3e | RETURN | |
| 0d3f | JUMPDEST | |
| 0d40 | PUSH1 | 0x04 |
| 0d42 | ADD | |
| 0d43 | SLOAD | |
| 0d44 | PUSH1 | 0x01 |
| 0d46 | PUSH1 | 0x01 |
| 0d48 | PUSH1 | 0x40 |
| 0d4a | SHL | |
| 0d4b | SUB | |
| 0d4c | DUP2 | |
| 0d4d | AND | |
| 0d4e | ISZERO | |
| 0d4f | DUP1 | |
| 0d50 | ISZERO | |
| 0d51 | SWAP3 | |
| 0d52 | POP | |
| 0d53 | PUSH2 | 0x0d5e |
| 0d56 | JUMPI | |
| 0d57 | JUMPDEST | |
| 0d58 | POP | |
| 0d59 | PUSH0 | |
| 0d5a | PUSH2 | 0x0d34 |
| 0d5d | JUMP | |
| 0d5e | JUMPDEST | |
| 0d5f | PUSH1 | 0x01 |
| 0d61 | SWAP2 | |
| 0d62 | POP | |
| 0d63 | PUSH1 | 0xc0 |
| 0d65 | SHR | |
| 0d66 | AND | |
| 0d67 | ISZERO | |
| 0d68 | ISZERO | |
| 0d69 | PUSH0 | |
| 0d6a | PUSH2 | 0x0d57 |
| 0d6d | JUMP | |
| 0d6e | JUMPDEST | |
| 0d6f | DUP3 | |
| 0d70 | SWAP4 | |
| 0d71 | POP | |
| 0d72 | PUSH2 | 0x0d8f |
| 0d75 | PUSH1 | 0x01 |
| 0d77 | PUSH1 | 0x01 |
| 0d79 | PUSH1 | 0x40 |
| 0d7b | SHL | |
| 0d7c | SUB | |
| 0d7d | SWAP3 | |
| 0d7e | SWAP4 | |
| 0d7f | SWAP2 | |
| 0d80 | PUSH2 | 0x0d89 |
| 0d83 | DUP5 | |
| 0d84 | SWAP4 | |
| 0d85 | PUSH2 | 0x31d2 |
| 0d88 | JUMP | |
| 0d89 | JUMPDEST | |
| 0d8a | SWAP1 | |
| 0d8b | PUSH2 | 0x275e |
| 0d8e | JUMP | |
| 0d8f | JUMPDEST | |
| 0d90 | SWAP3 | |
| 0d91 | PUSH1 | 0x40 |
| 0d93 | SHR | |
| 0d94 | AND | |
| 0d95 | SWAP2 | |
| 0d96 | AND | |
| 0d97 | LT | |
| 0d98 | ISZERO | |
| 0d99 | SWAP1 | |
| 0d9a | PUSH0 | |
| 0d9b | DUP1 | |
| 0d9c | PUSH2 | 0x0d2c |
| 0d9f | JUMP | |
| 0da0 | JUMPDEST | |
| 0da1 | SWAP3 | |
| 0da2 | POP | |
| 0da3 | PUSH1 | 0x01 |
| 0da5 | PUSH1 | 0x01 |
| 0da7 | PUSH1 | 0x40 |
| 0da9 | SHL | |
| 0daa | SUB | |
| 0dab | DUP2 | |
| 0dac | PUSH1 | 0x80 |
| 0dae | SHR | |
| 0daf | AND | |
| 0db0 | DUP4 | |
| 0db1 | GT | |
| 0db2 | ISZERO | |
| 0db3 | SWAP3 | |
| 0db4 | PUSH2 | 0x0d26 |
| 0db7 | JUMP | |
| 0db8 | JUMPDEST | |
| 0db9 | PUSH1 | 0x04 |
| 0dbb | DUP4 | |
| 0dbc | ADD | |
| 0dbd | SLOAD | |
| 0dbe | PUSH1 | 0x40 |
| 0dc0 | SHR | |
| 0dc1 | PUSH1 | 0x01 |
| 0dc3 | PUSH1 | 0x01 |
| 0dc5 | PUSH1 | 0x40 |
| 0dc7 | SHL | |
| 0dc8 | SUB | |
| 0dc9 | AND | |
| 0dca | ISZERO | |
| 0dcb | SWAP4 | |
| 0dcc | POP | |
| 0dcd | PUSH2 | 0x0d20 |
| 0dd0 | JUMP | |
| 0dd1 | JUMPDEST | |
| 0dd2 | SWAP3 | |
| 0dd3 | POP | |
| 0dd4 | DUP1 | |
| 0dd5 | PUSH1 | 0xc0 |
| 0dd7 | SHR | |
| 0dd8 | ISZERO | |
| 0dd9 | SWAP3 | |
| 0dda | PUSH2 | 0x0d1a |
| 0ddd | JUMP | |
| 0dde | JUMPDEST | |
| 0ddf | PUSH2 | 0x23b7 |
| 0de2 | JUMP | |
| 0de3 | JUMPDEST | |
| 0de4 | PUSH2 | 0x24d2 |
| 0de7 | JUMP | |
| 0de8 | JUMPDEST | |
| 0de9 | POP | |
| 0dea | CALLVALUE | |
| 0deb | PUSH2 | 0x02ed |
| 0dee | JUMPI | |
| 0def | PUSH1 | 0x20 |
| 0df1 | CALLDATASIZE | |
| 0df2 | PUSH1 | 0x03 |
| 0df4 | NOT | |
| 0df5 | ADD | |
| 0df6 | SLT | |
| 0df7 | PUSH2 | 0x02ed |
| 0dfa | JUMPI | |
| 0dfb | PUSH1 | 0x40 |
| 0dfd | PUSH1 | 0x20 |
| 0dff | SWAP2 | |
| 0e00 | PUSH1 | 0x04 |
| 0e02 | CALLDATALOAD | |
| 0e03 | DUP2 | |
| 0e04 | MSTORE | |
| 0e05 | DUP1 | |
| 0e06 | DUP4 | |
| 0e07 | MSTORE | |
| 0e08 | KECCAK256 | |
| 0e09 | DUP1 | |
| 0e0a | SLOAD | |
| 0e0b | PUSH1 | 0x01 |
| 0e0d | PUSH1 | 0x01 |
| 0e0f | PUSH1 | 0x40 |
| 0e11 | SHL | |
| 0e12 | SUB | |
| 0e13 | DUP2 | |
| 0e14 | AND | |
| 0e15 | ISZERO | |
| 0e16 | ISZERO | |
| 0e17 | SWAP2 | |
| 0e18 | DUP3 | |
| 0e19 | PUSH2 | 0x0e6d |
| 0e1c | JUMPI | |
| 0e1d | JUMPDEST | |
| 0e1e | DUP3 | |
| 0e1f | PUSH2 | 0x0e54 |
| 0e22 | JUMPI | |
| 0e23 | JUMPDEST | |
| 0e24 | POP | |
| 0e25 | DUP2 | |
| 0e26 | PUSH2 | 0x0e34 |
| 0e29 | JUMPI | |
| 0e2a | POP | |
| 0e2b | PUSH1 | 0x40 |
| 0e2d | MLOAD | |
| 0e2e | SWAP1 | |
| 0e2f | ISZERO | |
| 0e30 | ISZERO | |
| 0e31 | DUP2 | |
| 0e32 | MSTORE | |
| 0e33 | RETURN | |
| 0e34 | JUMPDEST | |
| 0e35 | PUSH1 | 0x01 |
| 0e37 | PUSH1 | 0x01 |
| 0e39 | PUSH1 | 0x40 |
| 0e3b | SHL | |
| 0e3c | SUB | |
| 0e3d | SWAP2 | |
| 0e3e | POP | |
| 0e3f | PUSH1 | 0x80 |
| 0e41 | SHR | |
| 0e42 | AND | |
| 0e43 | PUSH1 | 0x01 |
| 0e45 | PUSH1 | 0x01 |
| 0e47 | PUSH1 | 0x40 |
| 0e49 | SHL | |
| 0e4a | SUB | |
| 0e4b | TIMESTAMP | |
| 0e4c | AND | |
| 0e4d | GT | |
| 0e4e | ISZERO | |
| 0e4f | PUSH0 | |
| 0e50 | PUSH2 | 0x0d34 |
| 0e53 | JUMP | |
| 0e54 | JUMPDEST | |
| 0e55 | PUSH1 | 0x04 |
| 0e57 | ADD | |
| 0e58 | SLOAD | |
| 0e59 | PUSH1 | 0x40 |
| 0e5b | SHR | |
| 0e5c | PUSH1 | 0x01 |
| 0e5e | PUSH1 | 0x01 |
| 0e60 | PUSH1 | 0x40 |
| 0e62 | SHL | |
| 0e63 | SUB | |
| 0e64 | AND | |
| 0e65 | ISZERO | |
| 0e66 | SWAP2 | |
| 0e67 | POP | |
| 0e68 | PUSH0 | |
| 0e69 | PUSH2 | 0x0e23 |
| 0e6c | JUMP | |
| 0e6d | JUMPDEST | |
| 0e6e | SWAP2 | |
| 0e6f | POP | |
| 0e70 | DUP1 | |
| 0e71 | PUSH1 | 0xc0 |
| 0e73 | SHR | |
| 0e74 | ISZERO | |
| 0e75 | SWAP2 | |
| 0e76 | PUSH2 | 0x0e1d |
| 0e79 | JUMP | |
| 0e7a | JUMPDEST | |
| 0e7b | POP | |
| 0e7c | CALLVALUE | |
| 0e7d | PUSH2 | 0x02ed |
| 0e80 | JUMPI | |
| 0e81 | DUP1 | |
| 0e82 | PUSH1 | 0x03 |
| 0e84 | NOT | |
| 0e85 | CALLDATASIZE | |
| 0e86 | ADD | |
| 0e87 | SLT | |
| 0e88 | PUSH2 | 0x02ed |
| 0e8b | JUMPI | |
| 0e8c | PUSH1 | 0x20 |
| 0e8e | PUSH1 | 0x40 |
| 0e90 | MLOAD | |
| 0e91 | PUSH32 | 0xcc7c08481f764947d6a6fa10f1913f9c489bcbe1ea586c5d4aca3bb0d12f45f6 |
| 0eb2 | DUP2 | |
| 0eb3 | MSTORE | |
| 0eb4 | RETURN | |
| 0eb5 | JUMPDEST | |
| 0eb6 | POP | |
| 0eb7 | CALLVALUE | |
| 0eb8 | PUSH2 | 0x02ed |
| 0ebb | JUMPI | |
| 0ebc | DUP1 | |
| 0ebd | PUSH1 | 0x03 |
| 0ebf | NOT | |
| 0ec0 | CALLDATASIZE | |
| 0ec1 | ADD | |
| 0ec2 | SLT | |
| 0ec3 | PUSH2 | 0x02ed |
| 0ec6 | JUMPI | |
| 0ec7 | PUSH1 | 0x40 |
| 0ec9 | MLOAD | |
| 0eca | PUSH32 | 0x0000000000000000000000003c0698e02a10fec9a5cd5939d0a0f2d484e8d540 |
| 0eeb | PUSH1 | 0x01 |
| 0eed | PUSH1 | 0x01 |
| 0eef | PUSH1 | 0xa0 |
| 0ef1 | SHL | |
| 0ef2 | SUB | |
| 0ef3 | AND | |
| 0ef4 | DUP2 | |
| 0ef5 | MSTORE | |
| 0ef6 | PUSH1 | 0x20 |
| 0ef8 | SWAP1 | |
| 0ef9 | RETURN | |
| 0efa | JUMPDEST | |
| 0efb | POP | |
| 0efc | PUSH1 | 0x40 |
| 0efe | CALLDATASIZE | |
| 0eff | PUSH1 | 0x03 |
| 0f01 | NOT | |
| 0f02 | ADD | |
| 0f03 | SLT | |
| 0f04 | PUSH2 | 0x02ed |
| 0f07 | JUMPI | |
| 0f08 | PUSH1 | 0x04 |
| 0f0a | CALLDATALOAD | |
| 0f0b | PUSH1 | 0x01 |
| 0f0d | PUSH1 | 0x01 |
| 0f0f | PUSH1 | 0x40 |
| 0f11 | SHL | |
| 0f12 | SUB | |
| 0f13 | DUP2 | |
| 0f14 | GT | |
| 0f15 | PUSH2 | 0x09c9 |
| 0f18 | JUMPI | |
| 0f19 | PUSH2 | 0x0f26 |
| 0f1c | SWAP1 | |
| 0f1d | CALLDATASIZE | |
| 0f1e | SWAP1 | |
| 0f1f | PUSH1 | 0x04 |
| 0f21 | ADD | |
| 0f22 | PUSH2 | 0x23ed |
| 0f25 | JUMP | |
| 0f26 | JUMPDEST | |
| 0f27 | SWAP1 | |
| 0f28 | PUSH1 | 0x24 |
| 0f2a | CALLDATALOAD | |
| 0f2b | PUSH1 | 0x01 |
| 0f2d | PUSH1 | 0x01 |
| 0f2f | PUSH1 | 0x40 |
| 0f31 | SHL | |
| 0f32 | SUB | |
| 0f33 | DUP2 | |
| 0f34 | GT | |
| 0f35 | PUSH2 | 0x03fd |
| 0f38 | JUMPI | |
| 0f39 | PUSH2 | 0x0f46 |
| 0f3c | SWAP1 | |
| 0f3d | CALLDATASIZE | |
| 0f3e | SWAP1 | |
| 0f3f | PUSH1 | 0x04 |
| 0f41 | ADD | |
| 0f42 | PUSH2 | 0x23ed |
| 0f45 | JUMP | |
| 0f46 | JUMPDEST | |
| 0f47 | PUSH1 | 0xb6 |
| 0f49 | DUP5 | |
| 0f4a | SWAP3 | |
| 0f4b | SWAP5 | |
| 0f4c | LT | |
| 0f4d | PUSH2 | 0x1a2a |
| 0f50 | JUMPI | |
| 0f51 | DUP2 | |
| 0f52 | ISZERO | |
| 0f53 | PUSH2 | 0x19fa |
| 0f56 | JUMPI | |
| 0f57 | DUP3 | |
| 0f58 | CALLDATALOAD | |
| 0f59 | PUSH1 | 0xf8 |
| 0f5b | SHR | |
| 0f5c | PUSH1 | 0x02 |
| 0f5e | DUP2 | |
| 0f5f | LT | |
| 0f60 | DUP1 | |
| 0f61 | ISZERO | |
| 0f62 | PUSH2 | 0x1a20 |
| 0f65 | JUMPI | |
| 0f66 | JUMPDEST | |
| 0f67 | PUSH2 | 0x1a0e |
| 0f6a | JUMPI | |
| 0f6b | POP | |
| 0f6c | DUP2 | |
| 0f6d | PUSH1 | 0x01 |
| 0f6f | LT | |
| 0f70 | ISZERO | |
| 0f71 | PUSH2 | 0x19fa |
| 0f74 | JUMPI | |
| 0f75 | PUSH1 | 0xfe |
| 0f77 | PUSH1 | 0x01 |
| 0f79 | DUP5 | |
| 0f7a | ADD | |
| 0f7b | CALLDATALOAD | |
| 0f7c | PUSH1 | 0xf8 |
| 0f7e | SHR | |
| 0f7f | AND | |
| 0f80 | PUSH2 | 0x19e0 |
| 0f83 | JUMPI | |
| 0f84 | DUP2 | |
| 0f85 | PUSH1 | 0x22 |
| 0f87 | GT | |
| 0f88 | PUSH2 | 0x06fc |
| 0f8b | JUMPI | |
| 0f8c | PUSH1 | 0x02 |
| 0f8e | DUP4 | |
| 0f8f | ADD | |
| 0f90 | CALLDATALOAD | |
| 0f91 | SWAP1 | |
| 0f92 | DUP3 | |
| 0f93 | PUSH1 | 0x2a |
| 0f95 | GT | |
| 0f96 | PUSH2 | 0x19dc |
| 0f99 | JUMPI | |
| 0f9a | PUSH1 | 0x22 |
| 0f9c | DUP5 | |
| 0f9d | ADD | |
| 0f9e | CALLDATALOAD | |
| 0f9f | SWAP1 | |
| 0fa0 | DUP4 | |
| 0fa1 | PUSH1 | 0x32 |
| 0fa3 | GT | |
| 0fa4 | PUSH2 | 0x19d8 |
| 0fa7 | JUMPI | |
| 0fa8 | PUSH1 | 0x2a |
| 0faa | DUP6 | |
| 0fab | ADD | |
| 0fac | CALLDATALOAD | |
| 0fad | SWAP4 | |
| 0fae | DUP1 | |
| 0faf | PUSH1 | 0x52 |
| 0fb1 | GT | |
| 0fb2 | PUSH2 | 0x19d4 |
| 0fb5 | JUMPI | |
| 0fb6 | PUSH1 | 0x32 |
| 0fb8 | DUP7 | |
| 0fb9 | ADD | |
| 0fba | CALLDATALOAD | |
| 0fbb | SWAP6 | |
| 0fbc | DUP2 | |
| 0fbd | PUSH1 | 0x72 |
| 0fbf | GT | |
| 0fc0 | PUSH2 | 0x19d0 |
| 0fc3 | JUMPI | |
| 0fc4 | PUSH1 | 0x52 |
| 0fc6 | DUP2 | |
| 0fc7 | ADD | |
| 0fc8 | CALLDATALOAD | |
| 0fc9 | SWAP7 | |
| 0fca | DUP3 | |
| 0fcb | PUSH1 | 0x92 |
| 0fcd | GT | |
| 0fce | PUSH2 | 0x19cc |
| 0fd1 | JUMPI | |
| 0fd2 | PUSH1 | 0x72 |
| 0fd4 | DUP3 | |
| 0fd5 | ADD | |
| 0fd6 | CALLDATALOAD | |
| 0fd7 | PUSH1 | 0x01 |
| 0fd9 | DUP1 | |
| 0fda | DUP5 | |
| 0fdb | ADD | |
| 0fdc | CALLDATALOAD | |
| 0fdd | PUSH1 | 0xf8 |
| 0fdf | SHR | |
| 0fe0 | AND | |
| 0fe1 | ISZERO | |
| 0fe2 | DUP1 | |
| 0fe3 | ISZERO | |
| 0fe4 | DUP1 | |
| 0fe5 | PUSH2 | 0x19c3 |
| 0fe8 | JUMPI | |
| 0fe9 | JUMPDEST | |
| 0fea | PUSH2 | 0x19af |
| 0fed | JUMPI | |
| 0fee | DUP1 | |
| 0fef | PUSH2 | 0x19a7 |
| 0ff2 | JUMPI | |
| 0ff3 | JUMPDEST | |
| 0ff4 | PUSH2 | 0x1998 |
| 0ff7 | JUMPI | |
| 0ff8 | DUP9 | |
| 0ff9 | ISZERO | |
| 0ffa | PUSH2 | 0x1989 |
| 0ffd | JUMPI | |
| 0ffe | DUP9 | |
| 0fff | DUP12 | |
| 1000 | MSTORE | |
| 1001 | DUP11 | |
| 1002 | PUSH1 | 0x20 |
| 1004 | MSTORE | |
| 1005 | PUSH1 | 0x01 |
| 1007 | PUSH1 | 0x01 |
| 1009 | PUSH1 | 0x40 |
| 100b | SHL | |
| 100c | SUB | |
| 100d | PUSH1 | 0x40 |
| 100f | DUP13 | |
| 1010 | KECCAK256 | |
| 1011 | SLOAD | |
| 1012 | AND | |
| 1013 | PUSH2 | 0x1975 |
| 1016 | JUMPI | |
| 1017 | TIMESTAMP | |
| 1018 | PUSH1 | 0x01 |
| 101a | PUSH1 | 0x01 |
| 101c | PUSH1 | 0x40 |
| 101e | SHL | |
| 101f | SUB | |
| 1020 | AND | |
| 1021 | PUSH1 | 0xc0 |
| 1023 | DUP10 | |
| 1024 | SWAP1 | |
| 1025 | SHR | |
| 1026 | GT | |
| 1027 | ISZERO | |
| 1028 | PUSH2 | 0x1951 |
| 102b | JUMPI | |
| 102c | PUSH1 | 0xc0 |
| 102e | DUP7 | |
| 102f | SWAP1 | |
| 1030 | SHR | |
| 1031 | PUSH2 | 0x18d6 |
| 1034 | JUMPI | |
| 1035 | PUSH1 | 0x01 |
| 1037 | PUSH1 | 0x01 |
| 1039 | PUSH1 | 0x40 |
| 103b | SHL | |
| 103c | SUB | |
| 103d | PUSH2 | 0x104c |
| 1040 | PUSH4 | 0x0a4cb800 |
| 1045 | DUP3 | |
| 1046 | TIMESTAMP | |
| 1047 | AND | |
| 1048 | PUSH2 | 0x275e |
| 104b | JUMP | |
| 104c | JUMPDEST | |
| 104d | AND | |
| 104e | DUP1 | |
| 104f | PUSH1 | 0x01 |
| 1051 | PUSH1 | 0x01 |
| 1053 | PUSH1 | 0x40 |
| 1055 | SHL | |
| 1056 | SUB | |
| 1057 | DUP11 | |
| 1058 | PUSH1 | 0xc0 |
| 105a | SHR | |
| 105b | AND | |
| 105c | GT | |
| 105d | PUSH2 | 0x18bc |
| 1060 | JUMPI | |
| 1061 | POP | |
| 1062 | JUMPDEST | |
| 1063 | PUSH1 | 0x05 |
| 1065 | SLOAD | |
| 1066 | SWAP2 | |
| 1067 | DUP3 | |
| 1068 | ISZERO | |
| 1069 | DUP1 | |
| 106a | ISZERO | |
| 106b | PUSH2 | 0x182e |
| 106e | JUMPI | |
| 106f | JUMPDEST | |
| 1070 | POP | |
| 1071 | PUSH1 | 0x01 |
| 1073 | PUSH1 | 0x01 |
| 1075 | PUSH1 | 0x58 |
| 1077 | SHL | |
| 1078 | SUB | |
| 1079 | DUP4 | |
| 107a | GT | |
| 107b | PUSH2 | 0x180f |
| 107e | JUMPI | |
| 107f | DUP3 | |
| 1080 | CALLVALUE | |
| 1081 | SUB | |
| 1082 | PUSH2 | 0x17f7 |
| 1085 | JUMPI | |
| 1086 | PUSH1 | 0x02 |
| 1088 | SLOAD | |
| 1089 | SWAP2 | |
| 108a | PUSH1 | 0x01 |
| 108c | PUSH1 | 0x01 |
| 108e | PUSH1 | 0x01 |
| 1090 | PUSH1 | 0x40 |
| 1092 | SHL | |
| 1093 | SUB | |
| 1094 | DUP5 | |
| 1095 | AND | |
| 1096 | ADD | |
| 1097 | PUSH1 | 0x01 |
| 1099 | PUSH1 | 0x01 |
| 109b | PUSH1 | 0x40 |
| 109d | SHL | |
| 109e | SUB | |
| 109f | DUP2 | |
| 10a0 | GT | |
| 10a1 | PUSH2 | 0x17e3 |
| 10a4 | JUMPI | |
| 10a5 | PUSH1 | 0x40 |
| 10a7 | DUP15 | |
| 10a8 | PUSH1 | 0x01 |
| 10aa | PUSH1 | 0x01 |
| 10ac | PUSH1 | 0x40 |
| 10ae | SHL | |
| 10af | SUB | |
| 10b0 | DUP15 | |
| 10b1 | SWAP4 | |
| 10b2 | AND | |
| 10b3 | PUSH1 | 0x01 |
| 10b5 | PUSH1 | 0x01 |
| 10b7 | PUSH1 | 0x40 |
| 10b9 | SHL | |
| 10ba | SUB | |
| 10bb | NOT | |
| 10bc | DUP8 | |
| 10bd | AND | |
| 10be | OR | |
| 10bf | PUSH1 | 0x02 |
| 10c1 | SSTORE | |
| 10c2 | PUSH1 | 0x01 |
| 10c4 | PUSH1 | 0x01 |
| 10c6 | PUSH1 | 0x40 |
| 10c8 | SHL | |
| 10c9 | SUB | |
| 10ca | DUP7 | |
| 10cb | AND | |
| 10cc | DUP2 | |
| 10cd | MSTORE | |
| 10ce | PUSH1 | 0x03 |
| 10d0 | PUSH1 | 0x20 |
| 10d2 | MSTORE | |
| 10d3 | KECCAK256 | |
| 10d4 | SSTORE | |
| 10d5 | PUSH1 | 0x40 |
| 10d7 | MLOAD | |
| 10d8 | SWAP2 | |
| 10d9 | PUSH2 | 0x0160 |
| 10dc | DUP4 | |
| 10dd | ADD | |
| 10de | DUP4 | |
| 10df | DUP2 | |
| 10e0 | LT | |
| 10e1 | PUSH1 | 0x01 |
| 10e3 | PUSH1 | 0x01 |
| 10e5 | PUSH1 | 0x40 |
| 10e7 | SHL | |
| 10e8 | SUB | |
| 10e9 | DUP3 | |
| 10ea | GT | |
| 10eb | OR | |
| 10ec | PUSH2 | 0x17cf |
| 10ef | JUMPI | |
| 10f0 | SWAP3 | |
| 10f1 | DUP11 | |
| 10f2 | DUP16 | |
| 10f3 | SWAP6 | |
| 10f4 | SWAP4 | |
| 10f5 | DUP15 | |
| 10f6 | SWAP4 | |
| 10f7 | DUP13 | |
| 10f8 | DUP16 | |
| 10f9 | DUP12 | |
| 10fa | SWAP9 | |
| 10fb | PUSH1 | 0x40 |
| 10fd | MSTORE | |
| 10fe | TIMESTAMP | |
| 10ff | PUSH1 | 0x01 |
| 1101 | PUSH1 | 0x01 |
| 1103 | PUSH1 | 0x40 |
| 1105 | SHL | |
| 1106 | SUB | |
| 1107 | AND | |
| 1108 | DUP7 | |
| 1109 | MSTORE | |
| 110a | PUSH1 | 0x20 |
| 110c | DUP7 | |
| 110d | ADD | |
| 110e | SWAP2 | |
| 110f | PUSH1 | 0xc0 |
| 1111 | SHR | |
| 1112 | PUSH1 | 0x01 |
| 1114 | PUSH1 | 0x01 |
| 1116 | PUSH1 | 0x40 |
| 1118 | SHL | |
| 1119 | SUB | |
| 111a | AND | |
| 111b | DUP3 | |
| 111c | MSTORE | |
| 111d | PUSH1 | 0x40 |
| 111f | DUP7 | |
| 1120 | ADD | |
| 1121 | SWAP1 | |
| 1122 | PUSH1 | 0xc0 |
| 1124 | SHR | |
| 1125 | PUSH1 | 0x01 |
| 1127 | PUSH1 | 0x01 |
| 1129 | PUSH1 | 0x40 |
| 112b | SHL | |
| 112c | SUB | |
| 112d | AND | |
| 112e | DUP2 | |
| 112f | MSTORE | |
| 1130 | PUSH1 | 0x60 |
| 1132 | DUP7 | |
| 1133 | ADD | |
| 1134 | SWAP2 | |
| 1135 | DUP11 | |
| 1136 | DUP4 | |
| 1137 | MSTORE | |
| 1138 | PUSH1 | 0x80 |
| 113a | DUP8 | |
| 113b | ADD | |
| 113c | SWAP4 | |
| 113d | DUP5 | |
| 113e | MSTORE | |
| 113f | PUSH1 | 0xa0 |
| 1141 | DUP8 | |
| 1142 | ADD | |
| 1143 | SWAP5 | |
| 1144 | DUP6 | |
| 1145 | MSTORE | |
| 1146 | PUSH1 | 0xc0 |
| 1148 | DUP8 | |
| 1149 | ADD | |
| 114a | SWAP6 | |
| 114b | DUP7 | |
| 114c | MSTORE | |
| 114d | PUSH1 | 0xe0 |
| 114f | DUP8 | |
| 1150 | ADD | |
| 1151 | SWAP11 | |
| 1152 | DUP1 | |
| 1153 | DUP13 | |
| 1154 | MSTORE | |
| 1155 | PUSH2 | 0x0100 |
| 1158 | DUP9 | |
| 1159 | ADD | |
| 115a | SWAP9 | |
| 115b | DUP2 | |
| 115c | DUP11 | |
| 115d | MSTORE | |
| 115e | PUSH2 | 0x0120 |
| 1161 | DUP10 | |
| 1162 | ADD | |
| 1163 | SWAP11 | |
| 1164 | PUSH1 | 0x01 |
| 1166 | PUSH1 | 0x01 |
| 1168 | PUSH1 | 0x40 |
| 116a | SHL | |
| 116b | SUB | |
| 116c | AND | |
| 116d | DUP12 | |
| 116e | MSTORE | |
| 116f | PUSH2 | 0x0140 |
| 1172 | DUP10 | |
| 1173 | ADD | |
| 1174 | SWAP12 | |
| 1175 | PUSH1 | 0x01 |
| 1177 | ADD | |
| 1178 | CALLDATALOAD | |
| 1179 | PUSH1 | 0xf8 |
| 117b | SHR | |
| 117c | DUP13 | |
| 117d | MSTORE | |
| 117e | DUP2 | |
| 117f | MSTORE | |
| 1180 | DUP1 | |
| 1181 | PUSH1 | 0x20 |
| 1183 | MSTORE | |
| 1184 | PUSH1 | 0x40 |
| 1186 | SWAP1 | |
| 1187 | KECCAK256 | |
| 1188 | SWAP7 | |
| 1189 | MLOAD | |
| 118a | PUSH1 | 0x01 |
| 118c | PUSH1 | 0x01 |
| 118e | PUSH1 | 0x40 |
| 1190 | SHL | |
| 1191 | SUB | |
| 1192 | AND | |
| 1193 | PUSH1 | 0x01 |
| 1195 | PUSH1 | 0x01 |
| 1197 | PUSH1 | 0x40 |
| 1199 | SHL | |
| 119a | SUB | |
| 119b | AND | |
| 119c | PUSH1 | 0x01 |
| 119e | PUSH1 | 0x01 |
| 11a0 | PUSH1 | 0x40 |
| 11a2 | SHL | |
| 11a3 | SUB | |
| 11a4 | NOT | |
| 11a5 | DUP9 | |
| 11a6 | SLOAD | |
| 11a7 | AND | |
| 11a8 | OR | |
| 11a9 | DUP8 | |
| 11aa | SSTORE | |
| 11ab | MLOAD | |
| 11ac | PUSH1 | 0x01 |
| 11ae | PUSH1 | 0x01 |
| 11b0 | PUSH1 | 0x40 |
| 11b2 | SHL | |
| 11b3 | SUB | |
| 11b4 | AND | |
| 11b5 | PUSH2 | 0x11e1 |
| 11b8 | SWAP1 | |
| 11b9 | DUP8 | |
| 11ba | SWAP1 | |
| 11bb | PUSH8 | 0xffffffffffffffff |
| 11c4 | PUSH1 | 0x40 |
| 11c6 | SHL | |
| 11c7 | DUP3 | |
| 11c8 | SLOAD | |
| 11c9 | SWAP2 | |
| 11ca | PUSH1 | 0x40 |
| 11cc | SHL | |
| 11cd | AND | |
| 11ce | SWAP1 | |
| 11cf | PUSH8 | 0xffffffffffffffff |
| 11d8 | PUSH1 | 0x40 |
| 11da | SHL | |
| 11db | NOT | |
| 11dc | AND | |
| 11dd | OR | |
| 11de | SWAP1 | |
| 11df | SSTORE | |
| 11e0 | JUMP | |
| 11e1 | JUMPDEST | |
| 11e2 | MLOAD | |
| 11e3 | DUP6 | |
| 11e4 | SLOAD | |
| 11e5 | SWAP2 | |
| 11e6 | MLOAD | |
| 11e7 | PUSH1 | 0x01 |
| 11e9 | PUSH1 | 0x01 |
| 11eb | PUSH1 | 0xc0 |
| 11ed | SHL | |
| 11ee | SUB | |
| 11ef | NOT | |
| 11f0 | PUSH1 | 0xc0 |
| 11f2 | SWAP2 | |
| 11f3 | DUP3 | |
| 11f4 | SHL | |
| 11f5 | AND | |
| 11f6 | PUSH16 | 0xffffffffffffffffffffffffffffffff |
| 1207 | SWAP1 | |
| 1208 | SWAP4 | |
| 1209 | AND | |
| 120a | PUSH8 | 0xffffffffffffffff |
| 1213 | PUSH1 | 0x80 |
| 1215 | SHL | |
| 1216 | PUSH1 | 0x80 |
| 1218 | SWAP4 | |
| 1219 | DUP5 | |
| 121a | SHL | |
| 121b | DUP2 | |
| 121c | AND | |
| 121d | SWAP2 | |
| 121e | SWAP1 | |
| 121f | SWAP2 | |
| 1220 | OR | |
| 1221 | SWAP4 | |
| 1222 | SWAP1 | |
| 1223 | SWAP4 | |
| 1224 | OR | |
| 1225 | DUP8 | |
| 1226 | SSTORE | |
| 1227 | SWAP3 | |
| 1228 | MLOAD | |
| 1229 | PUSH1 | 0x01 |
| 122b | DUP8 | |
| 122c | ADD | |
| 122d | SSTORE | |
| 122e | SWAP3 | |
| 122f | MLOAD | |
| 1230 | PUSH1 | 0x02 |
| 1232 | DUP7 | |
| 1233 | ADD | |
| 1234 | SSTORE | |
| 1235 | SWAP3 | |
| 1236 | MLOAD | |
| 1237 | PUSH1 | 0x03 |
| 1239 | DUP6 | |
| 123a | ADD | |
| 123b | SSTORE | |
| 123c | SWAP7 | |
| 123d | MLOAD | |
| 123e | PUSH1 | 0x04 |
| 1240 | SWAP1 | |
| 1241 | SWAP4 | |
| 1242 | ADD | |
| 1243 | DUP1 | |
| 1244 | SLOAD | |
| 1245 | SWAP5 | |
| 1246 | MLOAD | |
| 1247 | SWAP6 | |
| 1248 | MLOAD | |
| 1249 | SWAP7 | |
| 124a | MLOAD | |
| 124b | PUSH1 | 0xff |
| 124d | PUSH1 | 0xc0 |
| 124f | SHL | |
| 1250 | SWAP9 | |
| 1251 | SHL | |
| 1252 | SWAP8 | |
| 1253 | SWAP1 | |
| 1254 | SWAP8 | |
| 1255 | AND | |
| 1256 | PUSH1 | 0x01 |
| 1258 | PUSH1 | 0x01 |
| 125a | PUSH1 | 0xc8 |
| 125c | SHL | |
| 125d | SUB | |
| 125e | NOT | |
| 125f | SWAP1 | |
| 1260 | SWAP5 | |
| 1261 | AND | |
| 1262 | PUSH1 | 0x01 |
| 1264 | PUSH1 | 0x01 |
| 1266 | PUSH1 | 0x40 |
| 1268 | SHL | |
| 1269 | SUB | |
| 126a | SWAP1 | |
| 126b | SWAP4 | |
| 126c | AND | |
| 126d | SWAP3 | |
| 126e | SWAP1 | |
| 126f | SWAP3 | |
| 1270 | OR | |
| 1271 | PUSH8 | 0xffffffffffffffff |
| 127a | PUSH1 | 0x40 |
| 127c | SHL | |
| 127d | PUSH1 | 0x40 |
| 127f | SWAP6 | |
| 1280 | DUP7 | |
| 1281 | SHL | |
| 1282 | AND | |
| 1283 | OR | |
| 1284 | SWAP5 | |
| 1285 | SWAP1 | |
| 1286 | SWAP2 | |
| 1287 | SHL | |
| 1288 | AND | |
| 1289 | SWAP3 | |
| 128a | SWAP1 | |
| 128b | SWAP3 | |
| 128c | OR | |
| 128d | SWAP2 | |
| 128e | SWAP1 | |
| 128f | SWAP2 | |
| 1290 | OR | |
| 1291 | SWAP1 | |
| 1292 | SWAP2 | |
| 1293 | SSTORE | |
| 1294 | MLOAD | |
| 1295 | SWAP9 | |
| 1296 | PUSH2 | 0x129e |
| 1299 | DUP11 | |
| 129a | PUSH2 | 0x24ed |
| 129d | JUMP | |
| 129e | JUMPDEST | |
| 129f | PUSH2 | 0x12a9 |
| 12a2 | CALLDATASIZE | |
| 12a3 | DUP6 | |
| 12a4 | DUP6 | |
| 12a5 | PUSH2 | 0x2544 |
| 12a8 | JUMP | |
| 12a9 | JUMPDEST | |
| 12aa | DUP11 | |
| 12ab | MSTORE | |
| 12ac | DUP5 | |
| 12ad | CALLDATASIZE | |
| 12ae | SWAP1 | |
| 12af | PUSH2 | 0x12b7 |
| 12b2 | SWAP3 | |
| 12b3 | PUSH2 | 0x2544 |
| 12b6 | JUMP | |
| 12b7 | JUMPDEST | |
| 12b8 | PUSH1 | 0x20 |
| 12ba | DUP11 | |
| 12bb | ADD | |
| 12bc | MSTORE | |
| 12bd | PUSH1 | 0x20 |
| 12bf | SWAP9 | |
| 12c0 | PUSH1 | 0x40 |
| 12c2 | MLOAD | |
| 12c3 | PUSH2 | 0x12cc |
| 12c6 | DUP12 | |
| 12c7 | DUP3 | |
| 12c8 | PUSH2 | 0x2508 |
| 12cb | JUMP | |
| 12cc | JUMPDEST | |
| 12cd | DUP12 | |
| 12ce | DUP2 | |
| 12cf | MSTORE | |
| 12d0 | PUSH1 | 0x40 |
| 12d2 | DUP3 | |
| 12d3 | ADD | |
| 12d4 | MSTORE | |
| 12d5 | DUP9 | |
| 12d6 | DUP12 | |
| 12d7 | MSTORE | |
| 12d8 | PUSH1 | 0x01 |
| 12da | DUP11 | |
| 12db | MSTORE | |
| 12dc | PUSH1 | 0x40 |
| 12de | DUP12 | |
| 12df | KECCAK256 | |
| 12e0 | DUP2 | |
| 12e1 | MLOAD | |
| 12e2 | DUP1 | |
| 12e3 | MLOAD | |
| 12e4 | SWAP1 | |
| 12e5 | PUSH1 | 0x01 |
| 12e7 | PUSH1 | 0x01 |
| 12e9 | PUSH1 | 0x40 |
| 12eb | SHL | |
| 12ec | SUB | |
| 12ed | DUP3 | |
| 12ee | GT | |
| 12ef | PUSH2 | 0x1756 |
| 12f2 | JUMPI | |
| 12f3 | SWAP1 | |
| 12f4 | DUP13 | |
| 12f5 | DUP15 | |
| 12f6 | SWAP3 | |
| 12f7 | PUSH2 | 0x130a |
| 12fa | DUP4 | |
| 12fb | PUSH2 | 0x1304 |
| 12fe | DUP8 | |
| 12ff | SLOAD | |
| 1300 | PUSH2 | 0x257a |
| 1303 | JUMP | |
| 1304 | JUMPDEST | |
| 1305 | DUP8 | |
| 1306 | PUSH2 | 0x25b2 |
| 1309 | JUMP | |
| 130a | JUMPDEST | |
| 130b | DUP2 | |
| 130c | PUSH1 | 0x1f |
| 130e | DUP5 | |
| 130f | GT | |
| 1310 | PUSH1 | 0x01 |
| 1312 | EQ | |
| 1313 | PUSH2 | 0x176a |
| 1316 | JUMPI | |
| 1317 | POP | |
| 1318 | PUSH2 | 0x1337 |
| 131b | SWAP4 | |
| 131c | SWAP2 | |
| 131d | SWAP1 | |
| 131e | DUP4 | |
| 131f | PUSH2 | 0x1662 |
| 1322 | JUMPI | |
| 1323 | JUMPDEST | |
| 1324 | POP | |
| 1325 | POP | |
| 1326 | DUP2 | |
| 1327 | PUSH1 | 0x01 |
| 1329 | SHL | |
| 132a | SWAP2 | |
| 132b | PUSH0 | |
| 132c | NOT | |
| 132d | SWAP1 | |
| 132e | PUSH1 | 0x03 |
| 1330 | SHL | |
| 1331 | SHR | |
| 1332 | NOT | |
| 1333 | AND | |
| 1334 | OR | |
| 1335 | SWAP1 | |
| 1336 | JUMP | |
| 1337 | JUMPDEST | |
| 1338 | DUP2 | |
| 1339 | SSTORE | |
| 133a | JUMPDEST | |
| 133b | PUSH1 | 0x20 |
| 133d | DUP3 | |
| 133e | ADD | |
| 133f | MLOAD | |
| 1340 | DUP1 | |
| 1341 | MLOAD | |
| 1342 | SWAP1 | |
| 1343 | PUSH1 | 0x01 |
| 1345 | PUSH1 | 0x01 |
| 1347 | PUSH1 | 0x40 |
| 1349 | SHL | |
| 134a | SUB | |
| 134b | DUP3 | |
| 134c | GT | |
| 134d | PUSH2 | 0x1756 |
| 1350 | JUMPI | |
| 1351 | DUP13 | |
| 1352 | SWAP1 | |
| 1353 | DUP15 | |
| 1354 | PUSH2 | 0x136d |
| 1357 | DUP5 | |
| 1358 | PUSH2 | 0x1364 |
| 135b | PUSH1 | 0x01 |
| 135d | DUP9 | |
| 135e | ADD | |
| 135f | SLOAD | |
| 1360 | PUSH2 | 0x257a |
| 1363 | JUMP | |
| 1364 | JUMPDEST | |
| 1365 | PUSH1 | 0x01 |
| 1367 | DUP9 | |
| 1368 | ADD | |
| 1369 | PUSH2 | 0x25b2 |
| 136c | JUMP | |
| 136d | JUMPDEST | |
| 136e | DUP3 | |
| 136f | PUSH1 | 0x1f |
| 1371 | DUP6 | |
| 1372 | GT | |
| 1373 | PUSH1 | 0x01 |
| 1375 | EQ | |
| 1376 | PUSH2 | 0x16e5 |
| 1379 | JUMPI | |
| 137a | POP | |
| 137b | SWAP3 | |
| 137c | DUP1 | |
| 137d | PUSH1 | 0x40 |
| 137f | SWAP6 | |
| 1380 | SWAP4 | |
| 1381 | PUSH2 | 0x13a0 |
| 1384 | SWAP4 | |
| 1385 | PUSH1 | 0x02 |
| 1387 | SWAP7 | |
| 1388 | SWAP3 | |
| 1389 | PUSH2 | 0x1662 |
| 138c | JUMPI | |
| 138d | POP | |
| 138e | POP | |
| 138f | DUP2 | |
| 1390 | PUSH1 | 0x01 |
| 1392 | SHL | |
| 1393 | SWAP2 | |
| 1394 | PUSH0 | |
| 1395 | NOT | |
| 1396 | SWAP1 | |
| 1397 | PUSH1 | 0x03 |
| 1399 | SHL | |
| 139a | SHR | |
| 139b | NOT | |
| 139c | AND | |
| 139d | OR | |
| 139e | SWAP1 | |
| 139f | JUMP | |
| 13a0 | JUMPDEST | |
| 13a1 | PUSH1 | 0x01 |
| 13a3 | DUP3 | |
| 13a4 | ADD | |
| 13a5 | SSTORE | |
| 13a6 | JUMPDEST | |
| 13a7 | ADD | |
| 13a8 | SWAP2 | |
| 13a9 | ADD | |
| 13aa | MLOAD | |
| 13ab | DUP1 | |
| 13ac | MLOAD | |
| 13ad | PUSH1 | 0x01 |
| 13af | PUSH1 | 0x01 |
| 13b1 | PUSH1 | 0x40 |
| 13b3 | SHL | |
| 13b4 | SUB | |
| 13b5 | DUP2 | |
| 13b6 | GT | |
| 13b7 | PUSH2 | 0x16d1 |
| 13ba | JUMPI | |
| 13bb | PUSH2 | 0x13ce |
| 13be | DUP2 | |
| 13bf | PUSH2 | 0x13c8 |
| 13c2 | DUP6 | |
| 13c3 | SLOAD | |
| 13c4 | PUSH2 | 0x257a |
| 13c7 | JUMP | |
| 13c8 | JUMPDEST | |
| 13c9 | DUP6 | |
| 13ca | PUSH2 | 0x25b2 |
| 13cd | JUMP | |
| 13ce | JUMPDEST | |
| 13cf | DUP12 | |
| 13d0 | DUP14 | |
| 13d1 | PUSH1 | 0x1f |
| 13d3 | DUP4 | |
| 13d4 | GT | |
| 13d5 | PUSH1 | 0x01 |
| 13d7 | EQ | |
| 13d8 | PUSH2 | 0x166d |
| 13db | JUMPI | |
| 13dc | SWAP1 | |
| 13dd | PUSH2 | 0x13f9 |
| 13e0 | SWAP4 | |
| 13e1 | DUP4 | |
| 13e2 | PUSH2 | 0x1662 |
| 13e5 | JUMPI | |
| 13e6 | POP | |
| 13e7 | POP | |
| 13e8 | DUP2 | |
| 13e9 | PUSH1 | 0x01 |
| 13eb | SHL | |
| 13ec | SWAP2 | |
| 13ed | PUSH0 | |
| 13ee | NOT | |
| 13ef | SWAP1 | |
| 13f0 | PUSH1 | 0x03 |
| 13f2 | SHL | |
| 13f3 | SHR | |
| 13f4 | NOT | |
| 13f5 | AND | |
| 13f6 | OR | |
| 13f7 | SWAP1 | |
| 13f8 | JUMP | |
| 13f9 | JUMPDEST | |
| 13fa | SWAP1 | |
| 13fb | SSTORE | |
| 13fc | JUMPDEST | |
| 13fd | DUP1 | |
| 13fe | PUSH2 | 0x15bb |
| 1401 | JUMPI | |
| 1402 | JUMPDEST | |
| 1403 | POP | |
| 1404 | DUP7 | |
| 1405 | DUP10 | |
| 1406 | MSTORE | |
| 1407 | DUP9 | |
| 1408 | DUP9 | |
| 1409 | MSTORE | |
| 140a | PUSH1 | 0x40 |
| 140c | DUP10 | |
| 140d | KECCAK256 | |
| 140e | SWAP6 | |
| 140f | DUP10 | |
| 1410 | PUSH1 | 0x40 |
| 1412 | SWAP8 | |
| 1413 | DUP9 | |
| 1414 | PUSH2 | 0x1499 |
| 1417 | DUP2 | |
| 1418 | MLOAD | |
| 1419 | SWAP3 | |
| 141a | PUSH2 | 0x1423 |
| 141d | DUP4 | |
| 141e | DUP6 | |
| 141f | PUSH2 | 0x2508 |
| 1422 | JUMP | |
| 1423 | JUMPDEST | |
| 1424 | PUSH1 | 0x01 |
| 1426 | DUP5 | |
| 1427 | MSTORE | |
| 1428 | PUSH1 | 0x1f |
| 142a | NOT | |
| 142b | DUP4 | |
| 142c | ADD | |
| 142d | DUP15 | |
| 142e | DUP2 | |
| 142f | CALLDATASIZE | |
| 1430 | DUP3 | |
| 1431 | DUP9 | |
| 1432 | ADD | |
| 1433 | CALLDATACOPY | |
| 1434 | PUSH2 | 0x143f |
| 1437 | DUP6 | |
| 1438 | MLOAD | |
| 1439 | SWAP6 | |
| 143a | DUP7 | |
| 143b | PUSH2 | 0x2508 |
| 143e | JUMP | |
| 143f | JUMPDEST | |
| 1440 | PUSH1 | 0x01 |
| 1442 | DUP6 | |
| 1443 | MSTORE | |
| 1444 | CALLDATASIZE | |
| 1445 | SWAP1 | |
| 1446 | DUP6 | |
| 1447 | ADD | |
| 1448 | CALLDATACOPY | |
| 1449 | DUP13 | |
| 144a | PUSH1 | 0x01 |
| 144c | PUSH1 | 0x01 |
| 144e | PUSH1 | 0x40 |
| 1450 | SHL | |
| 1451 | SUB | |
| 1452 | PUSH1 | 0x04 |
| 1454 | DUP4 | |
| 1455 | ADD | |
| 1456 | SLOAD | |
| 1457 | PUSH1 | 0x80 |
| 1459 | SHR | |
| 145a | AND | |
| 145b | SWAP2 | |
| 145c | PUSH2 | 0x1464 |
| 145f | DUP4 | |
| 1460 | PUSH2 | 0x2792 |
| 1463 | JUMP | |
| 1464 | JUMPDEST | |
| 1465 | PUSH2 | 0x146d |
| 1468 | DUP8 | |
| 1469 | PUSH2 | 0x2a67 |
| 146c | JUMP | |
| 146d | JUMPDEST | |
| 146e | MSTORE | |
| 146f | DUP14 | |
| 1470 | DUP2 | |
| 1471 | SLOAD | |
| 1472 | PUSH1 | 0x01 |
| 1474 | PUSH1 | 0x03 |
| 1476 | DUP5 | |
| 1477 | ADD | |
| 1478 | SLOAD | |
| 1479 | SWAP4 | |
| 147a | ADD | |
| 147b | SLOAD | |
| 147c | SWAP4 | |
| 147d | PUSH1 | 0x01 |
| 147f | PUSH1 | 0x01 |
| 1481 | PUSH1 | 0x01 |
| 1483 | PUSH1 | 0x40 |
| 1485 | SHL | |
| 1486 | SUB | |
| 1487 | DUP1 | |
| 1488 | DUP5 | |
| 1489 | DUP2 | |
| 148a | DUP2 | |
| 148b | PUSH1 | 0x80 |
| 148d | SHR | |
| 148e | AND | |
| 148f | SWAP7 | |
| 1490 | SHR | |
| 1491 | AND | |
| 1492 | SWAP4 | |
| 1493 | AND | |
| 1494 | SWAP2 | |
| 1495 | PUSH2 | 0x26b0 |
| 1498 | JUMP | |
| 1499 | JUMPDEST | |
| 149a | PUSH2 | 0x14a2 |
| 149d | DUP3 | |
| 149e | PUSH2 | 0x2a67 |
| 14a1 | JUMP | |
| 14a2 | JUMPDEST | |
| 14a3 | MSTORE | |
| 14a4 | PUSH32 | 0x0000000000000000000000000636a51e796ba8311016fae2a74670d2fdeb33c8 |
| 14c5 | PUSH1 | 0x01 |
| 14c7 | PUSH1 | 0x01 |
| 14c9 | PUSH1 | 0xa0 |
| 14cb | SHL | |
| 14cc | SUB | |
| 14cd | AND | |
| 14ce | DUP1 | |
| 14cf | EXTCODESIZE | |
| 14d0 | ISZERO | |
| 14d1 | PUSH2 | 0x03fd |
| 14d4 | JUMPI | |
| 14d5 | DUP11 | |
| 14d6 | MLOAD | |
| 14d7 | PUSH4 | 0xabf1570d |
| 14dc | PUSH1 | 0xe0 |
| 14de | SHL | |
| 14df | DUP2 | |
| 14e0 | MSTORE | |
| 14e1 | PUSH1 | 0x07 |
| 14e3 | PUSH1 | 0x04 |
| 14e5 | DUP3 | |
| 14e6 | ADD | |
| 14e7 | MSTORE | |
| 14e8 | PUSH1 | 0x01 |
| 14ea | PUSH1 | 0x24 |
| 14ec | DUP3 | |
| 14ed | ADD | |
| 14ee | MSTORE | |
| 14ef | PUSH1 | 0x80 |
| 14f1 | PUSH1 | 0x44 |
| 14f3 | DUP3 | |
| 14f4 | ADD | |
| 14f5 | MSTORE | |
| 14f6 | SWAP14 | |
| 14f7 | DUP5 | |
| 14f8 | SWAP4 | |
| 14f9 | DUP16 | |
| 14fa | SWAP4 | |
| 14fb | DUP5 | |
| 14fc | SWAP3 | |
| 14fd | SWAP2 | |
| 14fe | DUP4 | |
| 14ff | SWAP2 | |
| 1500 | SWAP1 | |
| 1501 | PUSH2 | 0x150e |
| 1504 | SWAP1 | |
| 1505 | PUSH1 | 0x84 |
| 1507 | DUP5 | |
| 1508 | ADD | |
| 1509 | SWAP1 | |
| 150a | PUSH2 | 0x2a88 |
| 150d | JUMP | |
| 150e | JUMPDEST | |
| 150f | DUP3 | |
| 1510 | DUP2 | |
| 1511 | SUB | |
| 1512 | PUSH1 | 0x03 |
| 1514 | NOT | |
| 1515 | ADD | |
| 1516 | PUSH1 | 0x64 |
| 1518 | DUP5 | |
| 1519 | ADD | |
| 151a | MSTORE | |
| 151b | PUSH2 | 0x1523 |
| 151e | SWAP2 | |
| 151f | PUSH2 | 0x2a88 |
| 1522 | JUMP | |
| 1523 | JUMPDEST | |
| 1524 | SUB | |
| 1525 | SWAP3 | |
| 1526 | GAS | |
| 1527 | CALL | |
| 1528 | SWAP11 | |
| 1529 | DUP12 | |
| 152a | ISZERO | |
| 152b | PUSH2 | 0x15af |
| 152e | JUMPI | |
| 152f | DUP10 | |
| 1530 | SWAP11 | |
| 1531 | SWAP12 | |
| 1532 | SWAP10 | |
| 1533 | SWAP8 | |
| 1534 | SWAP9 | |
| 1535 | SWAP10 | |
| 1536 | PUSH2 | 0x158c |
| 1539 | JUMPI | |
| 153a | JUMPDEST | |
| 153b | POP | |
| 153c | POP | |
| 153d | DUP8 | |
| 153e | MLOAD | |
| 153f | PUSH1 | 0xc0 |
| 1541 | SWAP6 | |
| 1542 | DUP7 | |
| 1543 | SHR | |
| 1544 | DUP2 | |
| 1545 | MSTORE | |
| 1546 | SWAP5 | |
| 1547 | SHR | |
| 1548 | DUP10 | |
| 1549 | DUP6 | |
| 154a | ADD | |
| 154b | MSTORE | |
| 154c | PUSH1 | 0x01 |
| 154e | ADD | |
| 154f | CALLDATALOAD | |
| 1550 | PUSH1 | 0xf8 |
| 1552 | SHR | |
| 1553 | DUP4 | |
| 1554 | DUP8 | |
| 1555 | ADD | |
| 1556 | MSTORE | |
| 1557 | PUSH1 | 0x60 |
| 1559 | DUP4 | |
| 155a | ADD | |
| 155b | MSTORE | |
| 155c | PUSH1 | 0x80 |
| 155e | DUP3 | |
| 155f | ADD | |
| 1560 | MSTORE | |
| 1561 | PUSH32 | 0x24f7513addaa5e94cfcd9b75c20467f3408766ba4339ceb2e7f7670542bc0519 |
| 1582 | SWAP1 | |
| 1583 | PUSH1 | 0xa0 |
| 1585 | SWAP1 | |
| 1586 | LOG3 | |
| 1587 | MLOAD | |
| 1588 | SWAP1 | |
| 1589 | DUP2 | |
| 158a | MSTORE | |
| 158b | RETURN | |
| 158c | JUMPDEST | |
| 158d | DUP2 | |
| 158e | DUP1 | |
| 158f | SWAP4 | |
| 1590 | SWAP5 | |
| 1591 | SWAP6 | |
| 1592 | SWAP7 | |
| 1593 | SWAP8 | |
| 1594 | SWAP9 | |
| 1595 | POP | |
| 1596 | PUSH2 | 0x159e |
| 1599 | SWAP2 | |
| 159a | PUSH2 | 0x2508 |
| 159d | JUMP | |
| 159e | JUMPDEST | |
| 159f | PUSH2 | 0x02ed |
| 15a2 | JUMPI | |
| 15a3 | SWAP1 | |
| 15a4 | DUP2 | |
| 15a5 | DUP10 | |
| 15a6 | SWAP7 | |
| 15a7 | SWAP6 | |
| 15a8 | SWAP5 | |
| 15a9 | SWAP4 | |
| 15aa | SWAP3 | |
| 15ab | PUSH2 | 0x153a |
| 15ae | JUMP | |
| 15af | JUMPDEST | |
| 15b0 | POP | |
| 15b1 | DUP8 | |
| 15b2 | MLOAD | |
| 15b3 | SWAP1 | |
| 15b4 | RETURNDATASIZE | |
| 15b5 | SWAP1 | |
| 15b6 | DUP3 | |
| 15b7 | RETURNDATACOPY | |
| 15b8 | RETURNDATASIZE | |
| 15b9 | SWAP1 | |
| 15ba | REVERT | |
| 15bb | JUMPDEST | |
| 15bc | PUSH1 | 0x40 |
| 15be | MLOAD | |
| 15bf | PUSH2 | 0x15c7 |
| 15c2 | DUP2 | |
| 15c3 | PUSH2 | 0x24ed |
| 15c6 | JUMP | |
| 15c7 | JUMPDEST | |
| 15c8 | CALLER | |
| 15c9 | DUP1 | |
| 15ca | DUP3 | |
| 15cb | MSTORE | |
| 15cc | PUSH1 | 0x01 |
| 15ce | PUSH1 | 0x01 |
| 15d0 | PUSH1 | 0x58 |
| 15d2 | SHL | |
| 15d3 | SUB | |
| 15d4 | DUP4 | |
| 15d5 | AND | |
| 15d6 | DUP12 | |
| 15d7 | DUP4 | |
| 15d8 | ADD | |
| 15d9 | SWAP1 | |
| 15da | DUP2 | |
| 15db | MSTORE | |
| 15dc | PUSH1 | 0x40 |
| 15de | DUP1 | |
| 15df | DUP5 | |
| 15e0 | ADD | |
| 15e1 | DUP15 | |
| 15e2 | DUP2 | |
| 15e3 | MSTORE | |
| 15e4 | DUP13 | |
| 15e5 | DUP16 | |
| 15e6 | MSTORE | |
| 15e7 | PUSH1 | 0x04 |
| 15e9 | DUP15 | |
| 15ea | MSTORE | |
| 15eb | DUP2 | |
| 15ec | DUP16 | |
| 15ed | KECCAK256 | |
| 15ee | SWAP5 | |
| 15ef | MLOAD | |
| 15f0 | SWAP3 | |
| 15f1 | MLOAD | |
| 15f2 | SWAP1 | |
| 15f3 | MLOAD | |
| 15f4 | PUSH1 | 0x01 |
| 15f6 | PUSH1 | 0x01 |
| 15f8 | PUSH1 | 0xf8 |
| 15fa | SHL | |
| 15fb | SUB | |
| 15fc | NOT | |
| 15fd | SWAP1 | |
| 15fe | ISZERO | |
| 15ff | ISZERO | |
| 1600 | PUSH1 | 0xf8 |
| 1602 | SHL | |
| 1603 | AND | |
| 1604 | PUSH1 | 0x01 |
| 1606 | PUSH1 | 0x01 |
| 1608 | PUSH1 | 0xa0 |
| 160a | SHL | |
| 160b | SUB | |
| 160c | SWAP1 | |
| 160d | SWAP4 | |
| 160e | AND | |
| 160f | PUSH11 | 0xffffffffffffffffffffff |
| 161b | PUSH1 | 0xa0 |
| 161d | SHL | |
| 161e | PUSH1 | 0xa0 |
| 1620 | SWAP3 | |
| 1621 | SWAP1 | |
| 1622 | SWAP3 | |
| 1623 | SHL | |
| 1624 | SWAP2 | |
| 1625 | SWAP1 | |
| 1626 | SWAP2 | |
| 1627 | AND | |
| 1628 | OR | |
| 1629 | SWAP2 | |
| 162a | SWAP1 | |
| 162b | SWAP2 | |
| 162c | OR | |
| 162d | SWAP1 | |
| 162e | SWAP3 | |
| 162f | SSTORE | |
| 1630 | SWAP1 | |
| 1631 | MLOAD | |
| 1632 | SWAP2 | |
| 1633 | DUP3 | |
| 1634 | MSTORE | |
| 1635 | SWAP1 | |
| 1636 | DUP9 | |
| 1637 | SWAP1 | |
| 1638 | PUSH32 | 0xa7370d05155156bd5ea6efcbeb39806e27517011389f0fdecfc64cf5d00f405a |
| 1659 | SWAP1 | |
| 165a | DUP12 | |
| 165b | SWAP1 | |
| 165c | LOG3 | |
| 165d | PUSH0 | |
| 165e | PUSH2 | 0x1402 |
| 1661 | JUMP | |
| 1662 | JUMPDEST | |
| 1663 | ADD | |
| 1664 | MLOAD | |
| 1665 | SWAP1 | |
| 1666 | POP | |
| 1667 | PUSH0 | |
| 1668 | DUP1 | |
| 1669 | PUSH2 | 0x1323 |
| 166c | JUMP | |
| 166d | JUMPDEST | |
| 166e | DUP5 | |
| 166f | DUP2 | |
| 1670 | MSTORE | |
| 1671 | DUP14 | |
| 1672 | DUP2 | |
| 1673 | KECCAK256 | |
| 1674 | SWAP3 | |
| 1675 | SWAP4 | |
| 1676 | SWAP1 | |
| 1677 | PUSH1 | 0x1f |
| 1679 | NOT | |
| 167a | DUP6 | |
| 167b | AND | |
| 167c | SWAP1 | |
| 167d | DUP16 | |
| 167e | JUMPDEST | |
| 167f | DUP3 | |
| 1680 | DUP3 | |
| 1681 | LT | |
| 1682 | PUSH2 | 0x16ba |
| 1685 | JUMPI | |
| 1686 | POP | |
| 1687 | POP | |
| 1688 | SWAP1 | |
| 1689 | DUP5 | |
| 168a | PUSH1 | 0x01 |
| 168c | SWAP6 | |
| 168d | SWAP5 | |
| 168e | SWAP4 | |
| 168f | SWAP3 | |
| 1690 | LT | |
| 1691 | PUSH2 | 0x16a2 |
| 1694 | JUMPI | |
| 1695 | JUMPDEST | |
| 1696 | POP | |
| 1697 | POP | |
| 1698 | POP | |
| 1699 | DUP2 | |
| 169a | SHL | |
| 169b | ADD | |
| 169c | SWAP1 | |
| 169d | SSTORE | |
| 169e | PUSH2 | 0x13fc |
| 16a1 | JUMP | |
| 16a2 | JUMPDEST | |
| 16a3 | ADD | |
| 16a4 | MLOAD | |
| 16a5 | PUSH0 | |
| 16a6 | NOT | |
| 16a7 | PUSH1 | 0xf8 |
| 16a9 | DUP5 | |
| 16aa | PUSH1 | 0x03 |
| 16ac | SHL | |
| 16ad | AND | |
| 16ae | SHR | |
| 16af | NOT | |
| 16b0 | AND | |
| 16b1 | SWAP1 | |
| 16b2 | SSTORE | |
| 16b3 | PUSH0 | |
| 16b4 | DUP1 | |
| 16b5 | DUP1 | |
| 16b6 | PUSH2 | 0x1695 |
| 16b9 | JUMP | |
| 16ba | JUMPDEST | |
| 16bb | PUSH1 | 0x01 |
| 16bd | DUP6 | |
| 16be | SWAP7 | |
| 16bf | DUP3 | |
| 16c0 | SWAP4 | |
| 16c1 | SWAP7 | |
| 16c2 | DUP7 | |
| 16c3 | ADD | |
| 16c4 | MLOAD | |
| 16c5 | DUP2 | |
| 16c6 | SSTORE | |
| 16c7 | ADD | |
| 16c8 | SWAP6 | |
| 16c9 | ADD | |
| 16ca | SWAP4 | |
| 16cb | ADD | |
| 16cc | DUP16 | |
| 16cd | PUSH2 | 0x167e |
| 16d0 | JUMP | |
| 16d1 | JUMPDEST | |
| 16d2 | PUSH4 | 0x4e487b71 |
| 16d7 | PUSH1 | 0xe0 |
| 16d9 | SHL | |
| 16da | DUP14 | |
| 16db | MSTORE | |
| 16dc | PUSH1 | 0x41 |
| 16de | PUSH1 | 0x04 |
| 16e0 | MSTORE | |
| 16e1 | PUSH1 | 0x24 |
| 16e3 | DUP14 | |
| 16e4 | REVERT | |
| 16e5 | JUMPDEST | |
| 16e6 | PUSH1 | 0x01 |
| 16e8 | DUP7 | |
| 16e9 | ADD | |
| 16ea | DUP3 | |
| 16eb | MSTORE | |
| 16ec | DUP1 | |
| 16ed | DUP3 | |
| 16ee | KECCAK256 | |
| 16ef | SWAP4 | |
| 16f0 | SWAP3 | |
| 16f1 | SWAP2 | |
| 16f2 | SWAP1 | |
| 16f3 | JUMPDEST | |
| 16f4 | PUSH1 | 0x1f |
| 16f6 | NOT | |
| 16f7 | DUP7 | |
| 16f8 | AND | |
| 16f9 | DUP3 | |
| 16fa | LT | |
| 16fb | PUSH2 | 0x173f |
| 16fe | JUMPI | |
| 16ff | POP | |
| 1700 | POP | |
| 1701 | SWAP3 | |
| 1702 | PUSH1 | 0x40 |
| 1704 | SWAP5 | |
| 1705 | SWAP3 | |
| 1706 | PUSH1 | 0x01 |
| 1708 | SWAP3 | |
| 1709 | PUSH1 | 0x02 |
| 170b | SWAP6 | |
| 170c | DUP4 | |
| 170d | PUSH1 | 0x1f |
| 170f | NOT | |
| 1710 | DUP2 | |
| 1711 | AND | |
| 1712 | LT | |
| 1713 | PUSH2 | 0x1727 |
| 1716 | JUMPI | |
| 1717 | JUMPDEST | |
| 1718 | POP | |
| 1719 | POP | |
| 171a | POP | |
| 171b | DUP2 | |
| 171c | SHL | |
| 171d | ADD | |
| 171e | PUSH1 | 0x01 |
| 1720 | DUP3 | |
| 1721 | ADD | |
| 1722 | SSTORE | |
| 1723 | PUSH2 | 0x13a6 |
| 1726 | JUMP | |
| 1727 | JUMPDEST | |
| 1728 | ADD | |
| 1729 | MLOAD | |
| 172a | PUSH0 | |
| 172b | NOT | |
| 172c | PUSH1 | 0xf8 |
| 172e | DUP5 | |
| 172f | PUSH1 | 0x03 |
| 1731 | SHL | |
| 1732 | AND | |
| 1733 | SHR | |
| 1734 | NOT | |
| 1735 | AND | |
| 1736 | SWAP1 | |
| 1737 | SSTORE | |
| 1738 | PUSH0 | |
| 1739 | DUP1 | |
| 173a | DUP1 | |
| 173b | PUSH2 | 0x1717 |
| 173e | JUMP | |
| 173f | JUMPDEST | |
| 1740 | PUSH1 | 0x01 |
| 1742 | DUP5 | |
| 1743 | SWAP6 | |
| 1744 | DUP3 | |
| 1745 | SWAP4 | |
| 1746 | SWAP6 | |
| 1747 | DUP6 | |
| 1748 | ADD | |
| 1749 | MLOAD | |
| 174a | DUP2 | |
| 174b | SSTORE | |
| 174c | ADD | |
| 174d | SWAP5 | |
| 174e | ADD | |
| 174f | SWAP3 | |
| 1750 | ADD | |
| 1751 | DUP16 | |
| 1752 | PUSH2 | 0x16f3 |
| 1755 | JUMP | |
| 1756 | JUMPDEST | |
| 1757 | PUSH4 | 0x4e487b71 |
| 175c | PUSH1 | 0xe0 |
| 175e | SHL | |
| 175f | DUP15 | |
| 1760 | MSTORE | |
| 1761 | PUSH1 | 0x41 |
| 1763 | PUSH1 | 0x04 |
| 1765 | MSTORE | |
| 1766 | PUSH1 | 0x24 |
| 1768 | DUP15 | |
| 1769 | REVERT | |
| 176a | JUMPDEST | |
| 176b | DUP6 | |
| 176c | DUP6 | |
| 176d | MSTORE | |
| 176e | DUP1 | |
| 176f | DUP6 | |
| 1770 | KECCAK256 | |
| 1771 | SWAP3 | |
| 1772 | SWAP2 | |
| 1773 | SWAP1 | |
| 1774 | JUMPDEST | |
| 1775 | PUSH1 | 0x1f |
| 1777 | NOT | |
| 1778 | DUP6 | |
| 1779 | AND | |
| 177a | DUP7 | |
| 177b | LT | |
| 177c | PUSH2 | 0x17b5 |
| 177f | JUMPI | |
| 1780 | POP | |
| 1781 | PUSH1 | 0x01 |
| 1783 | SWAP5 | |
| 1784 | POP | |
| 1785 | DUP4 | |
| 1786 | PUSH1 | 0x1f |
| 1788 | NOT | |
| 1789 | DUP2 | |
| 178a | AND | |
| 178b | LT | |
| 178c | PUSH2 | 0x179d |
| 178f | JUMPI | |
| 1790 | JUMPDEST | |
| 1791 | POP | |
| 1792 | POP | |
| 1793 | POP | |
| 1794 | DUP2 | |
| 1795 | SHL | |
| 1796 | ADD | |
| 1797 | DUP2 | |
| 1798 | SSTORE | |
| 1799 | PUSH2 | 0x133a |
| 179c | JUMP | |
| 179d | JUMPDEST | |
| 179e | ADD | |
| 179f | MLOAD | |
| 17a0 | PUSH0 | |
| 17a1 | NOT | |
| 17a2 | PUSH1 | 0xf8 |
| 17a4 | DUP5 | |
| 17a5 | PUSH1 | 0x03 |
| 17a7 | SHL | |
| 17a8 | AND | |
| 17a9 | SHR | |
| 17aa | NOT | |
| 17ab | AND | |
| 17ac | SWAP1 | |
| 17ad | SSTORE | |
| 17ae | PUSH0 | |
| 17af | DUP1 | |
| 17b0 | DUP1 | |
| 17b1 | PUSH2 | 0x1790 |
| 17b4 | JUMP | |
| 17b5 | JUMPDEST | |
| 17b6 | DUP3 | |
| 17b7 | DUP3 | |
| 17b8 | ADD | |
| 17b9 | MLOAD | |
| 17ba | DUP5 | |
| 17bb | SSTORE | |
| 17bc | SWAP5 | |
| 17bd | DUP6 | |
| 17be | ADD | |
| 17bf | SWAP5 | |
| 17c0 | PUSH1 | 0x01 |
| 17c2 | SWAP1 | |
| 17c3 | SWAP4 | |
| 17c4 | ADD | |
| 17c5 | SWAP3 | |
| 17c6 | SWAP1 | |
| 17c7 | SWAP2 | |
| 17c8 | ADD | |
| 17c9 | SWAP1 | |
| 17ca | DUP16 | |
| 17cb | PUSH2 | 0x1774 |
| 17ce | JUMP | |
| 17cf | JUMPDEST | |
| 17d0 | PUSH4 | 0x4e487b71 |
| 17d5 | PUSH1 | 0xe0 |
| 17d7 | SHL | |
| 17d8 | DUP16 | |
| 17d9 | MSTORE | |
| 17da | PUSH1 | 0x41 |
| 17dc | PUSH1 | 0x04 |
| 17de | MSTORE | |
| 17df | PUSH1 | 0x24 |
| 17e1 | DUP16 | |
| 17e2 | REVERT | |
| 17e3 | JUMPDEST | |
| 17e4 | PUSH4 | 0x4e487b71 |
| 17e9 | PUSH1 | 0xe0 |
| 17eb | SHL | |
| 17ec | DUP15 | |
| 17ed | MSTORE | |
| 17ee | PUSH1 | 0x11 |
| 17f0 | PUSH1 | 0x04 |
| 17f2 | MSTORE | |
| 17f3 | PUSH1 | 0x24 |
| 17f5 | DUP15 | |
| 17f6 | REVERT | |
| 17f7 | JUMPDEST | |
| 17f8 | PUSH4 | 0x4ba85a6b |
| 17fd | PUSH1 | 0xe1 |
| 17ff | SHL | |
| 1800 | DUP13 | |
| 1801 | MSTORE | |
| 1802 | PUSH1 | 0x04 |
| 1804 | DUP4 | |
| 1805 | SWAP1 | |
| 1806 | MSTORE | |
| 1807 | CALLVALUE | |
| 1808 | PUSH1 | 0x24 |
| 180a | MSTORE | |
| 180b | PUSH1 | 0x44 |
| 180d | DUP13 | |
| 180e | REVERT | |
| 180f | JUMPDEST | |
| 1810 | PUSH4 | 0x4ba85a6b |
| 1815 | PUSH1 | 0xe1 |
| 1817 | SHL | |
| 1818 | DUP13 | |
| 1819 | MSTORE | |
| 181a | PUSH1 | 0x01 |
| 181c | PUSH1 | 0x01 |
| 181e | PUSH1 | 0x58 |
| 1820 | SHL | |
| 1821 | SUB | |
| 1822 | PUSH1 | 0x04 |
| 1824 | MSTORE | |
| 1825 | PUSH1 | 0x24 |
| 1827 | DUP4 | |
| 1828 | SWAP1 | |
| 1829 | MSTORE | |
| 182a | PUSH1 | 0x44 |
| 182c | DUP13 | |
| 182d | REVERT | |
| 182e | JUMPDEST | |
| 182f | SWAP1 | |
| 1830 | SWAP3 | |
| 1831 | SWAP1 | |
| 1832 | TIMESTAMP | |
| 1833 | PUSH1 | 0x01 |
| 1835 | PUSH1 | 0x01 |
| 1837 | PUSH1 | 0x40 |
| 1839 | SHL | |
| 183a | SUB | |
| 183b | AND | |
| 183c | PUSH1 | 0xc0 |
| 183e | DUP12 | |
| 183f | SWAP1 | |
| 1840 | SHR | |
| 1841 | SWAP1 | |
| 1842 | DUP2 | |
| 1843 | SUB | |
| 1844 | SWAP1 | |
| 1845 | DUP2 | |
| 1846 | GT | |
| 1847 | PUSH2 | 0x17e3 |
| 184a | JUMPI | |
| 184b | PUSH4 | 0x0a4cb800 |
| 1850 | SWAP1 | |
| 1851 | DUP2 | |
| 1852 | DUP2 | |
| 1853 | ADD | |
| 1854 | SWAP1 | |
| 1855 | DUP2 | |
| 1856 | LT | |
| 1857 | PUSH2 | 0x18a8 |
| 185a | JUMPI | |
| 185b | PUSH0 | |
| 185c | NOT | |
| 185d | DUP2 | |
| 185e | ADD | |
| 185f | SWAP1 | |
| 1860 | DUP2 | |
| 1861 | GT | |
| 1862 | PUSH2 | 0x18a8 |
| 1865 | JUMPI | |
| 1866 | DUP2 | |
| 1867 | ISZERO | |
| 1868 | PUSH2 | 0x1894 |
| 186b | JUMPI | |
| 186c | DIV | |
| 186d | DUP1 | |
| 186e | DUP4 | |
| 186f | MUL | |
| 1870 | SWAP3 | |
| 1871 | DUP4 | |
| 1872 | DIV | |
| 1873 | EQ | |
| 1874 | OR | |
| 1875 | ISZERO | |
| 1876 | PUSH2 | 0x1880 |
| 1879 | JUMPI | |
| 187a | SWAP2 | |
| 187b | PUSH0 | |
| 187c | PUSH2 | 0x106f |
| 187f | JUMP | |
| 1880 | JUMPDEST | |
| 1881 | PUSH4 | 0x4e487b71 |
| 1886 | PUSH1 | 0xe0 |
| 1888 | SHL | |
| 1889 | DUP13 | |
| 188a | MSTORE | |
| 188b | PUSH1 | 0x11 |
| 188d | PUSH1 | 0x04 |
| 188f | MSTORE |