Documentation
How GENE works, the exact contract interfaces and parameters, and how to read and verify the protocol. Everything here is derived from the frozen RC4 source; each page lists its sources.
Learn
- What is GENEWhat GENE is made of, how its one pool works, and what its contracts can and cannot do.
- The pool and the hookWhy GENE uses exactly one Uniswap v4 pool with one hook, and what the hook does on each pool action.
- Fee anatomyWhich fees a GENE swap pays, who receives each one, and how the protocol collects its share into reserves.
- Permanent MassWhat Permanent Mass is, what "permanent" covers and what it does not, and how it grows.
- EpochsHow GENE divides time into epochs, what it records about each one, and when those records are written.
- GenesThe four genes, the states they move through, the conditions that express them, and what each one switches on.
- Net-flow budgetsHow GENE decides how much ETH it may place in an epoch, and why wash trading and round trips fund nothing near spot.
- AnchorsThe two price references GENE places liquidity against, how they move, and why every protocol buy is anchored at the all-time low.
- RegenerationHow REGENERATION funds and runs a bounded buyback-and-burn near the all-time-low price, and how it behaves on the genesis curve.
- ImmunityThe difference between IMMUNITY's expression, its pressure signal and an actual deployment, and what a deployment can place.
- Limitations explainedA plain-language walk through every known limitation of the RC4 candidate, section by section, with a link to the verbatim text.
Reference
- GeneHookEvery external and public function of GeneHook, with its signature, mutability, caller restrictions, behaviour, reverts and events.
- GeneLensThe optional, stateless read contract that decodes GeneHook storage into typed records, function by function.
- GeneTokenThe GENE ERC-20: a fixed-supply OpenZeppelin token with one addition, burn of the caller's own balance.
- EventsEvery event GeneHook and GeneToken emit, with full signature, indexed fields, topic0, when it fires and where in the code.
- ErrorsEvery custom error GENE contracts can raise, with its selector and the exact condition that throws it.
- Permissions and PoolKeyThe 14 Uniswap v4 hook flag bits and which ones GeneHook's address sets, what each implemented callback does, and how the PoolKey and poolId are formed.
- ParametersThe 43 Genome constants committed by genomeHash, and what each one governs in GeneHook.
- Storage layoutGeneHook's fixed storage layout, slot by slot and byte by byte, verified with forge at the frozen RC4 commit.
- SelectorsFunction selectors, event topics and error selectors for GeneHook, GeneToken and GeneLens, produced by forge at the frozen RC4 commit.
- AddressesThe canonical list of GENE contract addresses, what each entry is fixed by, and the third-party contracts GENE depends on.
Integrate
- Read stateHow to read GENE's on-chain state at one block, from GeneHook getters, deployless GeneLens calls, Uniswap v4 StateView and raw storage.
- Events and finalityWhich events GeneHook emits, when each one fires, and how to index them so that a reorganised block never leaves a wrong record.
- Rebuild the journalHow to rebuild GENE's history (epoch records, Mass, gene transitions, buybacks) from finalized GeneHook logs alone, and check it against the views.
- Verify evidence hashesHow to recompute the evidence hash of every expressed gene from stored epoch records and confirm it against GeneHook's storage, its events and GeneLens.
- Verify the deploymentA step-by-step procedure to confirm that a GeneHook deployment is the frozen RC4 source, with the committed Genome, the right PoolKey and a correct launch.
- KeepersHow to call evolve(), metabolize() and regenerate(): who may call them, the cooldown rules, the auto-evolve limit and the order that avoids wasted calls.
- SwappingHow to swap ETH and GENE in the canonical Uniswap v4 pool through the Universal Router, with the PoolKey to use and the fees a swap pays.