Contracts
Every Solidity contract in the Motoswap system, grouped by concern, with which are deployed.
Every Solidity contract in the Motoswap system, grouped by concern. Some are
not deployed (retired or unscheduled contracts); the addresses page has the status of each. Full per-contract surface (functions, events, errors, structs,
access controls, notes) is in
reference/contracts-full-inventory.
Fetch live addresses from GET /config (see addresses).
/config.addresses has a key for every contract in this inventory: the
DEX core, fees, staking, the Motocat set, the buyback and vesting peripherals, and
the phase venues (vampChef, uniswapZap, uniswapV2Router,
uniswapV2Factory). The only contract not exposed is the Snapshotter
(operational tooling). A zero address means the contract is unset for the
current launchPhase. Never integrate against a zero address.
Deployment status
Status is per contract. The deployment status table on the addresses page says, for each one,
whether the page pins its address or you read it from /config.
While launchPhase was vamp, /config served the launch farm address under both
vampChef and masterChef. The launch farm is a VampChef, not a
MasterChef: use the VampChef ABI for it.
The reference describes the contracts at the current source. Some deployed proxies run an implementation that predates it, and the inventory marks the functions that are not on the deployed implementation yet. They arrive with a contract upgrade.
DEX core
| Contract | What it does | Upgradeable |
|---|---|---|
MotoSwapFactory | Deploys pairs (beacon proxies at deterministic CREATE2 addresses; the init code hash is pairCodeHash(), read it live). Holds the swap perimeter (swapAllowed) and the pair fee (swapFeeBps). | UUPS (factory + separately renounceable pair beacon). |
MotoSwapPair | Per-pair AMM. Uniswap-V2 math with an EIP-1153 transient-storage reentrancy lock and the fee read live from the factory. swap is perimeter-gated and flash swaps are closed (MotoSwap: FLASH_SWAPS_CLOSED). | Beacon (all pairs upgrade in one call). |
MotoSwapERC20 | LP-token base (inherited by pair). ERC-20 + EIP-2612 permit. | Baked into pair impl. |
MotoSwapRouter02 | Uniswap-V2-shape router. Add/remove liquidity permissionless; every swap entrypoint requires factory.swapAllowed(msg.sender). | Immutable. |
MotoSwapLibrary | Pure/view helpers (sortTokens, pairFor, quote, getAmountOut/In, getAmountsOut/In). | Immutable. |
The swap perimeter
MotoSwapPair.swap and every MotoSwapRouter02 swap entrypoint require
factory.swapAllowed(msg.sender). The deploy admits two addresses: the core
router and the FeeRouter. Outside integrators swap through the FeeRouter
and pay the full fee. See
swap-via-fee-router.
The pair fee
factory.swapFeeBps is one global value that every pair reads live on each
swap. The contract default, set in initialize, is 100 bps. The deploy
scripts then call setSwapFee(30) and setFeeTo(address(0)), so a
pair charges 0.30% and all of it accrues to LPs. The factory admin can move
it anywhere from 0 to MAX_SWAP_FEE_BPS = 200, so read swapFeeBps() live
rather than quoting a number, and use MotoSwapRouter02.getAmountsOut, which
already applies it.
Fees
| Contract | What it does | Upgradeable |
|---|---|---|
FeeRouter | The swap entrypoint for users and integrators. Exact input only, no quote view. Charges the protocol fee (protocolFeeBps, owner-set, launch value 70 bps, cap 100 - read it live) on the quote leg, then routes through MotoSwapRouter02. Also skims the creator fee. | UUPS. |
Collector | Fee splitter. Receives quote-asset fees, splits into weighted buckets (staking notify / treasury / Rakeback / buyback and burn). Handles per-bucket earmarks on failed payouts. | UUPS. |
QuoteAssetRegistry | The allowlist + rank of quote assets (WETH/USDT/USDC/MOTO). | Immutable Ownable2Step. |
RakebackV2 | Merkle claim contract for accrued Rakeback. One root per weekly epoch, posted on chain by an automated poster; a claim is a proof against it, with no signature and no off-chain service on the claim path. | UUPS. |
BuybackBurner | MOTO buyback and burn to 0x…dEaD, driven by a keeper role. Every sale runs a pinned route and must clear the contract's own TWAP floor. | UUPS. |
BuybackDistributor | Merkle-tree distributor with a fixed allocation and a claim deadline. | Immutable Ownable2Step. |
CreatorFeeRegistry | Allowlist of tokens eligible for creator fees + their creator addresses. | Immutable Ownable2Step. |
CreatorFeeVault | Per-token, per-quote-asset accrual escrow for creator fees. | Immutable Ownable2Step. |
Farming
| Contract | What it does | Upgradeable |
|---|---|---|
VampChef | The launch farming contract: stake Uniswap V2 LP tokens, earn MOTO. One flat 14-day campaign (DURATION), instant withdraw, no deposit fee. Rewards paid 50% liquid / 50% streamed. | UUPS. |
MasterChef | Deployed; no emission campaign is running and none is planned. Contract reference: fixed-supply LP-farming with halving emissions (halving period is settable state, seeded at 42 days; read it live). 24-hour withdraw cooldown while the pool earns (none at weight 0); withdraw is queue then claim. Rewards paid 50% liquid / 50% streamed. | UUPS. |
RewardVestingEscrow | One 180-day linear schedule per wallet for the streamed half of farm rewards. Each new deposit banks what was released and re-spreads the rest over a fresh 180 days. | UUPS. |
Staking
| Contract | What it does | Upgradeable |
|---|---|---|
MotoStaking | Locked MOTO staking (3/6/12/24 mo, 1x/2x/4x/8x boost) with multi-token revshare from Collector. | UUPS. |
MotocatStaking | Pure NFT escrow with per-block checkpoints; no rewards surface (PvE airdrops pay from PveVault against its snapshots). Feeds the Points boost. | UUPS, with a one-way renounceUpgradeability(). |
PveVault | Escrow holding PvE-bought tokens for Motocat stakers. One credit per launched token; stakers claim pull-based via claimable / claim / claimMany. | UUPS. |
moto.fun
The bonding-curve launch surface. Deployed separately from the DEX set, and served by its own
/config keys. Full detail: moto.fun contracts.
| Contract | What it does | Upgradeable |
|---|---|---|
LaunchpadCurve | The singleton. Every coin's curve lives here: launch, buy, sell, graduate, PvE escrow, fee routing. Graduation seeds TOKEN/WETH + TOKEN/MOTO and burns both LP positions. | Immutable Ownable2Step. |
LaunchpadToken | The coin template: 1B fixed supply, no owner, no tax, deployed as an EIP-1167 clone per launch. | Immutable. |
LaunchpadLens | Read-only companion: quotes, spot price, bonding progress, graduation readiness. Split out to fit EIP-170. | Immutable. |
CreatorFeeRegistry and CreatorFeeVault above are shared: the curve is a registrar on the first and
a depositor on the second, and the FeeRouter is a depositor too, so a coin's creator claims curve
fees and DEX fees through the same vault.
Token & vesting
| Contract | What it does | Upgradeable |
|---|---|---|
MotoToken | Fixed 10B supply MOTO with EIP-2612 permit. No owner (owner() returns the zero address), no mint. Carries a launch gate that closed for good when trading opened: tradingOpen() returns true on the deployed token and cannot go back, so it behaves as a plain ERC-20. | Immutable. |
MotoTokenUnwrapper | Helper deployed by MotoToken. Unwraps WETH to ETH for the token's own sell path. Callable by the token only. | Immutable. |
TreasuryVesting | Step-vester: 10 equal tranches, one every 180 days, about 5 years in total (1,800 days). Lazy funding (top-ups join the schedule). | UUPS. |
Peripherals
| Contract | What it does | Upgradeable |
|---|---|---|
MotoSwapZap | Single-sided liquidity entry into Motoswap pairs + optional zap-and-stake into MasterChef, which has no emission campaign running. Swap leg goes through the FeeRouter. Rejects fee-on-transfer tokens. | Immutable. |
UniswapZap | The same for Uniswap V2 pairs, staking into the launch farm. No owner, no state. Note its AndStake argument order differs from MotoSwapZap. | Immutable. |
Snapshotter | One-shot on-chain snapshot marker (block + timestamp) for off-chain census jobs. | Immutable Ownable2Step. |
Ownership + upgrade model
UUPS contracts
Have a one-way renounceUpgradeability() - call it and the implementation
is frozen forever. upgradesRenounced() reads the state.
Seven of them split the upgrade path from ownership: RakebackV2,
Collector, BuybackBurner, MasterChef, RewardVestingEscrow,
MotoStaking and PveVault expose upgradeAuthority() and
setUpgradeAuthority(address). While the authority is zero the owner
upgrades. Once set, only the authority can upgrade, renounce, or move the
authority, and it can never be set back to zero. The upgrade authority is a
timelock. Its delay is zero for the first 72 hours after the DEX opens, then
24 hours. FeeRouter, VampChef and TreasuryVesting keep upgrades on
the owner, and the factory keeps them on feeToSetter.
Beacon (pair)
MotoSwapFactory.renouncePairUpgradeability() freezes every live pair at
once by renouncing beacon ownership.
Ownable2Step
Ownership transfers are two-step (transferOwnership → beneficiary calls
acceptOwnership) or, for the factory, setFeeToSetter →
acceptFeeToSetter. In the current source every ownable contract is two-step,
FeeRouter, RewardVestingEscrow and TreasuryVesting included. The deployed
RewardVestingEscrow and TreasuryVesting implementations predate that
change: they have no pendingOwner() until a contract upgrade.
Where each contract lives in the docs
- Deep dive →
reference/contracts-full-inventoryhas every function, event, error, struct, constant per contract. - Guides → Swap via FeeRouter and the other guides walk each end-to-end flow through the relevant contracts.
- Fee constants →
reference/addresses-config-events#4-fee-schedule--rakeback-constants. - Event signatures →
reference/addresses-config-events#5-events---integrator-reference.