Documentation · Reference
Selectors
Function selectors, event topics and error selectors for GeneHook, GeneToken and GeneLens, produced by forge at the frozen RC4 commit.
Verified commit. Every value on this page was produced by forge inspect on a detached checkout of tag rc4-audit-candidate at commit aca5fcd3bbc9ecb1026de58bea431d406d8ecfff (git rev-parse HEAD checked; working tree clean), forge 1.5.1-stable (b0a9dd9c), solc 0.8.26 as pinned in foundry.toml:11-15. Commands:
forge inspect src/GeneHook.sol:GeneHook methodIdentifiers --json
forge inspect src/GeneHook.sol:GeneHook events --json
forge inspect src/GeneHook.sol:GeneHook errors --json
forge inspect src/GeneToken.sol:GeneToken methodIdentifiers | events | errors --json
forge inspect src/GeneLens.sol:GeneLens methodIdentifiers | events | errors --jsonThe build artifacts in that checkout reproduce the bytecode hashes recorded at the freeze exactly (GeneHook runtime sha256 17e1418e…84b4d4, creation sha256 50bd04f6…2ef373; GeneLens and GeneToken likewise).
Citation keys. H = src/GeneHook.sol, L = src/GeneLens.sol, T = src/GeneToken.sol.
Event topic note. forge inspect prints events with source type names (GeneHook.EpochRecord, GeneHook.State, PoolId). The topic is the keccak256 of the canonical ABI signature, in which a struct is a tuple, an enum is uint8 and PoolId is bytes32. Each canonical signature below was re-hashed with cast keccak and matches the forge output.
#GeneHook functions
27 functions. The count matches the list pinned by test/unit/HookAbi.t.sol:22-51. Behaviour is documented on GeneHook.
#State-changing
| Selector | Signature | Caller | Source |
|---|---|---|---|
0x01339c21 |
launch() |
launcher only, once |
H:252-273 |
0x4764d4e2 |
metabolize() |
anyone, after launch, METABOLISM expressed, COOLDOWN_BLOCKS elapsed | H:281-291 |
0x17377f68 |
regenerate() |
anyone, after launch, REGENERATION expressed, cooldown after a full-allotment buyback | H:296-309 |
0xf119f567 |
evolve(uint256) |
anyone, after launch | H:312-316 |
0x91dd7346 |
unlockCallback(bytes) |
PoolManager only, with the hook's own transient action set | H:395-407 |
#Hook callbacks
| Selector | Canonical signature | Behaviour | Source |
|---|---|---|---|
0xdc98354e |
beforeInitialize(address,(address,address,uint24,int24,address),uint160) |
always reverts Forbidden() |
H:332-334 |
0x259982e5 |
beforeAddLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256,bytes32),bytes) |
always reverts Forbidden() |
H:337-343 |
0x21d0ee70 |
beforeRemoveLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256,bytes32),bytes) |
always reverts Forbidden() |
H:346-352 |
0x575e24b4 |
beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes) |
PoolManager only; canonical-key field check | H:355-366 |
0xb47b2fb1 |
afterSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),int256,bytes) |
PoolManager only; accumulators | H:368-390 |
#Views, constant and immutables
| Selector | Signature | Returns | Source |
|---|---|---|---|
0x8549d9be |
REQUIRED_FLAGS() |
uint160 = 0x2AC0 |
H:148-149 |
0xdc4c90d3 |
poolManager() |
address |
H:161 |
0xfc0c546a |
token() |
address |
H:162 |
0x16eebd1e |
launcher() |
address |
H:163 |
0xbcc4a516 |
genomeHash() |
bytes32 |
H:164 |
0x3e0dc34e |
poolId() |
bytes32 |
H:165 |
0x8091f3bf |
launched() |
bool |
H:173 |
0xd62ccb3f |
ethReserve() |
uint128 |
H:181 |
0x19280e3e |
regenReserve() |
uint128 |
H:182 |
0xa2e34a7c |
geneReserve() |
uint128 |
H:183 |
0xafc60bf7 |
ethCommitted() |
uint128 |
H:184 |
0xe716f40e |
geneCommitted() |
uint128 |
H:185 |
0x3a8b8a21 |
massLiquidity() |
uint256 |
H:186 |
0x0f75b8dc |
ethBudget() |
uint256 |
H:812-817 |
0xdbd035ff |
extsload(bytes32[]) |
bytes32[] |
H:953-963 |
0x182148ef |
poolKey() |
(address,address,uint24,int24,address) |
H:965-973 |
0x606f287b |
immunityActive() |
bool |
H:990-992 |
#GeneHook events
| topic0 | Canonical signature | Indexed | Emitted at |
|---|---|---|---|
0xe1b51be66a2ef6be7dcd41a89830cfd13b149b5b2a8414acff3ae3732823b944 |
Genesis(bytes32,address,bytes32) |
genomeHash |
H:131, H:247 (constructor) |
0x91e0e355c54aa11c2da9794288faa5736a5c94771a77469ca23177a9b732e8ac |
Launched(bytes32,int24,int24,uint128,uint256,uint256) |
poolId |
H:132, H:272 |
0xb16b0e10b517ac061f1c0df34b8573fea184e51931288d06ad20fce4958cb732 |
EpochClosed(uint32,(uint96,uint32,uint32,uint88,bool),int256,int24,int24) |
epoch |
H:133, H:757 |
0xe8e65271f07193dfb398d3d3644cc35404e121f1e199e65d6518ed82c83e26f3 |
FlowBudgets(uint32,uint256,uint256,int24) |
epoch |
H:135, H:868, H:871 |
0x12df5d9409e23faf7d1a247f463a53b569c8612910e1992bd14f27bf273ef34d |
GeneTransition(uint8,uint8,uint8,uint32,bytes32) |
gene, epoch |
H:136, H:271, H:908, H:915, H:928, H:931, H:945-946 |
0x68d793b46909dd71f01302cc73514e67391ab192095cf26aec99f08ccca271e2 |
FeesHarvested(uint256,uint256,uint256) |
none | H:137, H:688 |
0x4a3afe13ff7bf157ccf7a73bdbdee5453c57a3bebf8d96bb80f101315b1717fa |
MassAdded(uint8,int24,int24,uint128,uint256,int24,int24) |
kind |
H:141, H:433, H:626 |
0x8f66a7348a1e8268a4e1a335ac52f8ecef5ff290996535e55038d644ccada7ec |
PlacementSkipped(uint8,int24,int24,uint256) |
kind |
H:144, H:620 |
0x555d7b94fe7b81e06ec0371158979666f0b647c9f1bcb65e1ce53dc4c1667771 |
Regenerated(uint256,uint256,int24,int24) |
none | H:145, H:589 |
MassAdded.kind values: 0 genesis, 1 METABOLISM bid, 2 IMMUNITY bid, 3 ask, 4 churn-tier bid (H:138; emitted with those literals at H:433, H:485, H:501, H:518, H:546). Field meanings are on Events.
Index only logs whose emitting address is the GeneHook address. A contract elsewhere can emit the same topic.
#GeneHook errors
| Selector | Signature | Raised at |
|---|---|---|
0xae18210a |
NotPoolManager() |
H:359, H:372, H:396 |
0x9e6ff739 |
NotLauncher() |
H:253 |
0xcfa6d878 |
AlreadyLaunched() |
H:254 |
0x8dda39df |
NotLaunched() |
H:1000 |
0xee90c468 |
Forbidden() |
H:333, H:342, H:351 |
0xd3c913ea |
WrongPool() |
H:363 |
0xdab1e993 |
UnexpectedCallback() |
H:403 |
0xf0dd0d55 |
HookAddressInvalid() |
H:226, H:228, H:229 |
0x2abc0a56 |
GeneNotExpressed(uint8) |
H:283, H:298 |
0xff658a1c |
Cooldown(uint256) |
H:285, H:300 |
0xb2151907 |
InvariantBroken() |
H:425, H:660, H:694 |
Conditions are on Errors. Errors raised inside the PoolManager or OpenZeppelin ERC20 during a GENE call carry their own selectors and are not listed here, except GeneToken's below.
#GeneToken
#GeneToken functions
| Selector | Signature | Source |
|---|---|---|
0x06fdde03 |
name() |
OpenZeppelin ERC20 (T:4, T:15) |
0x95d89b41 |
symbol() |
OpenZeppelin ERC20 |
0x313ce567 |
decimals() |
OpenZeppelin ERC20 |
0x18160ddd |
totalSupply() |
OpenZeppelin ERC20 |
0x70a08231 |
balanceOf(address) |
OpenZeppelin ERC20 |
0xdd62ed3e |
allowance(address,address) |
OpenZeppelin ERC20 |
0x095ea7b3 |
approve(address,uint256) |
OpenZeppelin ERC20 |
0xa9059cbb |
transfer(address,uint256) |
OpenZeppelin ERC20 |
0x23b872dd |
transferFrom(address,address,uint256) |
OpenZeppelin ERC20 |
0x42966c68 |
burn(uint256) |
T:21-23 (caller's own balance) |
0x2ff2e9dc |
INITIAL_SUPPLY() |
T:12 |
0xc89dc74b |
GENESIS_HOLDER() |
T:13 |
#GeneToken events
| topic0 | Signature |
|---|---|
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef |
Transfer(address,address,uint256) |
0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 |
Approval(address,address,uint256) |
#GeneToken errors
| Selector | Signature |
|---|---|
0xe450d38c |
ERC20InsufficientBalance(address,uint256,uint256) |
0xfb8f41b2 |
ERC20InsufficientAllowance(address,uint256,uint256) |
0xe602df05 |
ERC20InvalidApprover(address) |
0xec442f05 |
ERC20InvalidReceiver(address) |
0x96c6fd1e |
ERC20InvalidSender(address) |
0x94280d62 |
ERC20InvalidSpender(address) |
#GeneLens
20 functions; no events and no custom errors. GeneLens is optional, stateless and not called by GeneHook (L:12-19). Every function except genome() takes the hook address first.
| Selector | Signature | Source |
|---|---|---|
0x6679f15d |
geneStatus(address,uint8) |
L:46-56 |
0xacbeb55d |
epochRecord(address,uint32) |
L:58-60 |
0x00fcebbb |
blockState(address) |
L:62-76 |
0x66d97b21 |
caps(address) |
L:78-87 |
0x42fd3880 |
positionCount(address) |
L:89-91 |
0xc5e3b2dd |
positionAt(address,uint256) |
L:93-98 |
0x0736e19f |
currentEpoch(address) |
L:100-105 |
0x4ce706f5 |
launchBlock(address) |
L:109-111 |
0x43be3509 |
evolveCursor(address) |
L:113-115 |
0xd1fef796 |
immuneStressBits(address) |
L:117-119 |
0x66259799 |
lastMetabolizeBlock(address) |
L:121-123 |
0xd86b85aa |
lastRegenerateBlock(address) |
L:125-127 |
0x62e7a58c |
harvestCursor(address) |
L:129-131 |
0x02086670 |
evidenceHashFor(address,uint8,uint32,uint32) |
L:135-147 |
0x692374e3 |
anchors(address) |
L:152-156 |
0xa0d6321f |
flowBudgets(address,uint32) |
L:160-165 |
0x392122b9 |
ethBudgets(address) |
L:170-191 |
0x757873cf |
cumulativeFlow(address) |
L:195-200 |
0xd5ba0428 |
genome() |
L:204-206 |
0xe053ea31 |
report(address) |
L:209-227 |
positionAt reverts with the string "index" for an out-of-range index (L:94).
#PoolManager events
These are PoolManager events, not GENE events. Topics were computed with cast keccak over the canonical signatures of the vendored v4-core interface (lib/v4-core/src/interfaces/IPoolManager.sol:60, 78, 91; v4-core 59d3ecf5, foundry.toml:2).
| topic0 | Canonical signature | Filter |
|---|---|---|
0xdd466e674ea557f56295e2d0218a125ea4b4f0f6f3307b95f85e6110838d6438 |
Initialize(bytes32,address,address,uint24,int24,address,uint160,int24) |
topic1 = poolId |
0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f |
Swap(bytes32,address,int128,int128,uint160,uint128,int24,uint24) |
topic1 = poolId |
0xf208f4912782fd25c7f114ca3723a2d5dd6f3bcc3ac8db5af63baa85f711d5ec |
ModifyLiquidity(bytes32,address,int24,int24,int256,bytes32) |
topic1 = poolId |
Sources (12)
- foundry.toml:11-15
- test/unit/HookAbi.t.sol:22-51
- src/GeneHook.sol:52-62
- src/GeneHook.sol:131-186
- src/GeneHook.sol:252-316
- src/GeneHook.sol:332-407
- src/GeneHook.sol:812-817
- src/GeneHook.sol:953-992
- src/GeneLens.sol:12-19
- src/GeneLens.sol:46-227
- src/GeneToken.sol:4-23
- lib/v4-core/src/interfaces/IPoolManager.sol:60-91
Paths are relative to the GENE repository at tag rc4-audit-candidate (aca5fcd).