Docs
The same ten chapters, told two ways. Pick how deep you want to go. You can switch at any time.
Core
- It is a token. Its trading fee can be adjusted by an AI.
- The AI can only move the fee inside fixed limits.
- Every change is public, tested, and undone if it fails.
evmgen ($eGEN) is a fixed-supply ERC-20 paired with ETH in a Uniswap v4 pool. A hook contract sets the swap fee per swap via the dynamic-fee flag. Parameters of the hook are written by a controller contract that accepts changes only from the AI signer and only inside the limits contract.
- Standard
- ERC-20, 18 decimals
- Supply
- 1,000,000,000 (fixed)
- Pool
- Uniswap v4, ETH / $eGEN
- Hook
- beforeSwap dynamic fee override
- Controller
- Accepts signed parameter updates
- Source
- contracts/Hook.sol, Controller.sol
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Fees
- Each swap pays a fee. Now it is 2.20% plus 0.30%.
- The fee is split four ways: burn, liquidity, treasury, games.
- The fee can never go above 5%.
The total fee is feetotal = feehook + feeext with feehook ≤ 5.00% and feeext = 0.30% fixed. Fees accrue as ETH in the vault and are distributed by distribute() with shares (sburn, sliq, stre, sgame) summing to 10,000 bps.
| Parameter | Live | Bounds |
|---|---|---|
| fee_hook | 220 bps | 0 – 500 bps |
| fee_ext | 30 bps | fixed |
| s_burn | 3500 | ≥ 1000 |
| s_liq | 3500 | ≥ 1000 |
| s_tre | 3000 | ≤ 4000 |
| s_game | 0 | ≤ 2500 |
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Mutation lifecycle
- The AI proposes a change and explains why.
- It waits an hour, tests quietly, then tests on a few real swaps.
- If the numbers beat the baseline it stays. If not it is undone.
States: PROPOSED → PUBLIC → SHADOW → LIVE → KEPT | REVERTED. A proposal enters PUBLIC for 3,600 s. Shadow runs 6 h with fee_applied = baseline and fee_shadow = proposal logged. Live runs up to 16 h with exposure p ≤ 0.25 of swaps.
- Gate: revenue
- Δrevenue ≥ 0%
- Gate: retention
- retention ≥ baseline − 1.0 pp
- Gate: failures
- module failures = 0
- Gate: gas
- Δgas ≤ +12,000 per swap
- Abort
- Any gate false for 3 consecutive windows
- Source
- contracts/Mutation.sol
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Voting
- Every two days there is a vote with three options.
- Stakers choose. It needs 1% of supply staked to count.
- The winner is tested, not just applied.
Ballot bn is posted every 172,800 s with three candidates. Voting opens after the snapshot and lasts 86,400 s. Voting power is w = staked(addr, snapshot). A ballot is valid only if Σw ≥ 1% of supply. The winner enters the lifecycle at SHADOW but still passes through PUBLIC.
- Quorum
- 1% of supply staked
- Tie-break
- Lowest fee change wins
- Snapshot
- Block at ballot post
- Source
- contracts/Ballot.sol
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Games
- Hold the token and you can win ETH in a weekly draw.
- Ten winners share the prize equally.
- Staking and streaks give you more tickets.
Jackpot tickets: T = min(balstart, balend) / 250,000 × m with m = min(4, mstake × (1 + 0.1·streak)). Draw: Chainlink VRF returns a word, winners are chosen by successive weighted draws without replacement, then prize = pool·cap / 10 each.
- Window
- 7 days
- Winners
- 10, distinct
- Cap
- 5% of treasury ETH
- Randomness
- Chainlink VRF v2.5
- Source
- contracts/Jackpot.sol
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Security
- The AI cannot take your tokens.
- Big changes wait 48 hours and the Safe can cancel.
- The code was reviewed and the findings are public.
Threat model: compromised AI signer, malicious idea, hook griefing, oracle/VRF failure, front-running of fee changes. Mitigations: bounded parameters, timelocks, per-swap gas limits in the hook, exposure caps and a cancel-only Safe.
| Threat | Mitigation |
|---|---|
| AI signer compromised | Parameter bounds and 1 h public delay |
| Hook reverts | Swap falls back to baseline fee |
| VRF stalls | 24 h timeout, window cancelled |
| Fee front-running | Fee changes only at block start |
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Governance
- There is a Safe wallet that can cancel scheduled changes.
- It cannot spend or edit anything.
- Stakers vote on fee options.
The Safe is a 3-of-5 multisig with exactly one power: cancel(opId) on queued operations. The timelock (48 h) applies to changes outside the AI’s bounded range, for example raising maxLiveGames.
- Safe
- 0x0000…0000 demo
- Threshold
- 3 of 5
- Powers
- cancel only
- Timelock
- 48 h
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Rewards
- Good ideas get paid.
- So do fee changes that pass and builds that ship.
- Payment goes to the wallet that staked.
Reward events: IdeaAccepted, MutationKept, BuildShipped. Each pays a fixed number of tokens from the rewards allocation to the stakers of the originating proposal pro rata to their stake.
| Event | Reward |
|---|---|
| Idea accepted | 50,000 eGEN |
| Mutation kept (author) | 25,000 eGEN |
| Build shipped | 200,000 eGEN |
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Contracts
- A handful of contracts do all the work.
- Their addresses are listed on the Trade page.
- Right now they are placeholders.
Addresses below are the all-zero demo placeholder. No contracts are deployed.
| Contract | Address | Upgradable |
|---|---|---|
| Token | 0x0000…0000 | No |
| Hook | 0x0000…0000 | No |
| Controller | 0x0000…0000 | No |
| Jackpot | 0x0000…0000 | No |
Values shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.
Verification
- You can check what the AI did.
- Logs are linked in a hash chain.
- The Proof page lets you re-check the chain in your browser.
Each log record is hi = SHA-256(json(i, ts, kind, text, hi−1)). Any edit breaks every later hash. Signatures and enclave attestation are listed as unavailable in this demo.
Open ProofValues shown are the sample deployment. Parameter names match the controller interface. Source references are descriptive; there is no published repository in this demo.