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

ContractWhat it doesUpgradeable
MotoSwapFactoryDeploys 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).
MotoSwapPairPer-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).
MotoSwapERC20LP-token base (inherited by pair). ERC-20 + EIP-2612 permit.Baked into pair impl.
MotoSwapRouter02Uniswap-V2-shape router. Add/remove liquidity permissionless; every swap entrypoint requires factory.swapAllowed(msg.sender).Immutable.
MotoSwapLibraryPure/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

ContractWhat it doesUpgradeable
FeeRouterThe 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.
CollectorFee splitter. Receives quote-asset fees, splits into weighted buckets (staking notify / treasury / Rakeback / buyback and burn). Handles per-bucket earmarks on failed payouts.UUPS.
QuoteAssetRegistryThe allowlist + rank of quote assets (WETH/USDT/USDC/MOTO).Immutable Ownable2Step.
RakebackV2Merkle 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.
BuybackBurnerMOTO 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.
BuybackDistributorMerkle-tree distributor with a fixed allocation and a claim deadline.Immutable Ownable2Step.
CreatorFeeRegistryAllowlist of tokens eligible for creator fees + their creator addresses.Immutable Ownable2Step.
CreatorFeeVaultPer-token, per-quote-asset accrual escrow for creator fees.Immutable Ownable2Step.

Farming

ContractWhat it doesUpgradeable
VampChefThe 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.
MasterChefDeployed; 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.
RewardVestingEscrowOne 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

ContractWhat it doesUpgradeable
MotoStakingLocked MOTO staking (3/6/12/24 mo, 1x/2x/4x/8x boost) with multi-token revshare from Collector.UUPS.
MotocatStakingPure 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().
PveVaultEscrow 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.

ContractWhat it doesUpgradeable
LaunchpadCurveThe 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.
LaunchpadTokenThe coin template: 1B fixed supply, no owner, no tax, deployed as an EIP-1167 clone per launch.Immutable.
LaunchpadLensRead-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

ContractWhat it doesUpgradeable
MotoTokenFixed 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.
MotoTokenUnwrapperHelper deployed by MotoToken. Unwraps WETH to ETH for the token's own sell path. Callable by the token only.Immutable.
TreasuryVestingStep-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

ContractWhat it doesUpgradeable
MotoSwapZapSingle-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.
UniswapZapThe same for Uniswap V2 pairs, staking into the launch farm. No owner, no state. Note its AndStake argument order differs from MotoSwapZap.Immutable.
SnapshotterOne-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

On this page