Skip to main content

Contract reference

These pages are derived from the interfaces in contracts/src/interfaces/ and the NatSpec in the implementations. When a page and the source disagree, the source wins.

ContractLicensePage
ZkPadFactoryGPL-2.0-or-laterFactory
ZkPadTokenMITToken
ZkPadHook / ZkPadHookBaseGPL-2.0-or-later (imports Infinity)Hook
ZkPadLpLockerGPL-2.0-or-laterLP locker
ZkPadMevDescendingFeesGPL-2.0-or-laterMEV module
ZkPadSwapRouterGPL-2.0-or-laterSwap router
FeeVaultMITFeeVault
RailgunShieldAdapter, ShieldSenderMITRailgun adapter
QuoteRegistry, PancakeV3RouteExecutorMITConsolidation
InfinityCLRouteExecutorGPL-2.0-or-later (imports Infinity)Consolidation

Conventions​

  • Solidity 0.8.26, EVM cancun, via-IR, OpenZeppelin v5.4.
  • Custom errors everywhere, nonReentrant on external state changers, SafeERC20, CEI.
  • Admin contracts use Ownable2Step. On mainnet the owner is currently the deployer EOA; a hand-over to a multisig (and a timelock) is planned. See addresses.
  • Fees are in pips: 1,000,000 = 100%, so 10,000 = 1% and 50,000 = 5%.
  • Ticks in configuration are in token0 orientation (as if the new token were token0); the contracts negate them when the token sorts above the quote.

Constants at a glance​

ConstantValueWhere
TOKEN_SUPPLY1_000_000_000e18Factory
TICK_SPACING200Factory
MIN_FEE / MAX_FEE10_000 / 50_000 pips (1% / 5%)Hook
MAX_MEV_FEE800_000 pips (80%)Hook
MAX_MEV_MODULE_DELAY2 minutesHook
PROTOCOL_SHARE_BPS2_500 (25%)Hook
MAX_LP_POSITIONS7Locker
BASIS_POINTS10_000Locker
ID_TAGkeccak256("zkpad.beneficiary.v1")FeeVault
KIND_STEALTH / KIND_HANDLE1 / 2FeeVault
MIN_FALLBACK_DELAY180 daysFeeVault
MIN_BIND_DELAY / MAX_BIND_DELAY1 days / 30 daysFeeVault
DELAY_GUARD1 secondMEV module

Deployed addresses: see addresses.