Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Contracts

Source: clc-protocol. Spec: docs/SPEC.md.

License: AGPL-3.0 (Solady snippets stay MIT).

Units

Fees and rates use PPM: 1_000_000 = 100%. 10_000 = 1%. 100_000 = 10%.

Deployment pattern

Stateful contracts: implementation (_disableInitializers in constructor) + ERC-1967 proxy from Solady ERC1967Factory + one-time initialize.

Plain (no proxy): ERC1967Factory, DecimalQuoter, SwapRouter, RescueVault, Calibur.

ge-publish refuses --admin == --owner. Seal on SwapPool / EthFaucet is only a commitment if a different key can upgradeTo.

ContractCountJob
GiftableTokenmanyVoucher ERC-20
SwapPoolmanyVault + swap
TokenUniqueSymbolIndexper pool + network Token/Pool indexeshave(token) whitelist
Limiterper poolDeposit caps
FeePolicyper poolSwap fee PPM
DecimalQuoter / RelativeQuoter / OracleQuotershared or per poolvalueFor / reverseValueFor
ProtocolFeeControllerone per networkNetwork fee
SwapRouteroneMulti-hop quotes (eth_call only)
ContractRegistryoneIdentifier → address
AccountsIndexoneRegistered users
Caliburone implEIP-7702 account

All proxied contracts reject owner == address(0) in initialize.

Writer role

Owner grants limited write access without handing over ownership: GiftableToken (minters), Limiter, CAT, AccountsIndex, TokenUniqueSymbolIndex.

isWriter includes the owner except on TokenUniqueSymbolIndex, where it is the raw flag.

Quoter interface

valueFor(out, in, amount)            // forward
reverseValueFor(out, in, desiredOut) // inverse, rounded up

Guarantee: valueFor(out, in, reverseValueFor(out, in, x)) >= x. SwapPool uses the forward path for swaps / getAmountOut and the reverse path for getAmountIn.