githubEdit

Smart Contracts

Who this is for: Integrators and auditors who need the contract layout and behavior of Mento V3 (FPMM pools, oracles, limits, strategies). The Mento protocol consists of a set of smart contracts deployed on supported chains (e.g. Celoarrow-up-right).

For app and frontend developers: This section describes the Solidity internals and is intended for smart contract developers. To quote swaps, discover pools, and execute trades from JavaScript/TypeScript, the Mento SDK is usually the easiest path. Each contract page below includes code snippets showing how to call the contracts directly from Solidity when you are building on-chain integrations or tooling.

See also: Integration — integration paths; Mento SDK — JS/TS library; Deployments — addresses and verification.

Mento V3: FPMM-based exchange

In V3, the main exchange is built from FPMM (Fixed-Price Market Maker) pools. The following pages give precise contract-level documentation:

Contract / topic
Doc
Role

FPMM

Pool: two-token reserves, swap at oracle rate (minus fee), value protection, mint/burn, rebalance by allowlisted strategies, TradingLimitsV2.

FPMMFactory

Deploys FPMM proxies, token order, default params and caps, pool registry.

OracleAdapter

Supplies the pool with a valid rate: getFXRateIfValid(rateFeedID); combines SortedOracles, BreakerBox (trading mode), and FX market hours.

Router

Quoting (getAmountsOut) and executing swaps; multihop via pool getAmountOut; uses FactoryRegistry and default factory.

Liquidity strategies

Base + ReserveLiquidityStrategy + CDPLiquidityStrategy; who may call rebalance, callback flow, incentive split.

TradingLimitsV2

Per-token 5-min and 1-day net-flow caps; applied after each swap.

BreakerBox

Circuit breakers; OracleAdapter reads trading mode; FPMM reverts when rate invalid.

Reserve

Holds collateral for Reserve-backed stables; used by ReserveLiquidityStrategy.

StableToken

ERC-20 Mento stables (USDm, EURm, GBPm, …).

CDPs

Collateralized debt positions (troves): borrow stables against collateral. Mento CDPs are a fork of Liquity v2 — see Liquity v2 docsarrow-up-right for full contract and protocol documentation.

Audits

ChainSecurity V3 and Liquity v2 fork; historical audits.

Contracts: mento-protocol/mento-corearrow-up-right

Last updated