Contracts
Addresses, key functions, events and deployment facts for every MEZONK contract, and how to confirm them on-chain.
MEZONK's on-chain part is one deployment of MezonkExchange, which creates MezonkResolution,
MezonkMarketFactory and MezonkIncentives in its constructor. All four are Solidity 0.8.24 (via-IR, London EVM,
OpenZeppelin), live on Mezo Mainnet since 2026-11-18, and not upgradeable. MezonkBtcRounds (BTC up/down rounds
staked in native BTC) is live too. MezonkPriceResolver is live at 0xc58D8A13B1e6f1614508ca20124A9d0F60520354. Source: github.com/prajalsharma/mezonk, contracts/src.
Live addresses
These come from the app's configuration, so they're the contracts this site is using right now.
| Contract | Address | Holds or does |
|---|---|---|
| MezonkExchange | 0x4555…49B9 | Shares, orders, collateral, graduation |
| MezonkMarketFactory | 0x3d59…D689 | Roles, curator approvals, opening markets |
| MezonkResolution | 0x6Da5…b944 | Proposals, challenges, rulings, bonds |
| MezonkIncentives | 0xF1a0…f06B | Seeder rebates and referral credit |
| MezonkPriceResolver | Not deployed yet | Settles BTC price markets from Mezo's PriceFeed |
| MezonkBtcRounds | Not deployed yet | BTC up/down rounds, paid in BTC |
| MUSD (collateral) | 0x1189…c503 | Mezo's bitcoin-backed dollar |
On Mezo Mainnet (chain 31612), deployed at block 13301975:
| Contract | Address |
|---|---|
| MezonkExchange | 0x102C908dCA719742f1958D18021B7C1c0092Ddf0 |
| MezonkMarketFactory | 0x056F302D8AA87A4a1F4062a6c53EFe6425A6Bbc8 |
| MezonkResolution | 0xaB7d8e1F4b2fF15a23dE463B041F98483B73b28f |
| MezonkIncentives | 0x506F1FD8F0418beEdcFD5bDE7b1d8Dd56481d8A5 |
| MezonkBtcRounds | 0xc27f434195e4aF70782817A280A5D3Cb5de2ECa8 |
| MezonkPriceResolver | 0xc58D8A13B1e6f1614508ca20124A9d0F60520354 |
The owner of the exchange, factory, rounds and price resolver contracts is 0x017FF5FB886E90f9e5ADb405D8eFddffC1162dD2.
How it works exactly
Derived addresses at nonces 1 to 3
The exchange constructor runs, in this order:
resolution = new MezonkResolution(collateral_); // exchange nonce 1
factory = new MezonkMarketFactory(owner_, config_); // nonce 2
incentives = new MezonkIncentives(collateral_); // nonce 3So the other three addresses are the CREATE addresses of the exchange at nonces 1, 2 and 3. The app derives them
instead of configuring them (protocolAddresses in lib/chain/config.ts), and each one is also a public immutable on
the exchange. Check both ways:
EX=0x102C908dCA719742f1958D18021B7C1c0092Ddf0
RPC=https://mezo-mainnet.boar.network
cast compute-address $EX --nonce 1 # 0xaB7d8e1F4b2fF15a23dE463B041F98483B73b28f
cast compute-address $EX --nonce 2 # 0x056F302D8AA87A4a1F4062a6c53EFe6425A6Bbc8
cast compute-address $EX --nonce 3 # 0x506F1FD8F0418beEdcFD5bDE7b1d8Dd56481d8A5
cast call $EX "resolution()(address)" --rpc-url $RPC
cast call $EX "factory()(address)" --rpc-url $RPC
cast call $EX "incentives()(address)" --rpc-url $RPCBecause they're created by the exchange, the exchange accepts openMarket only from that factory and settle only
from that resolution contract, and neither can ever be swapped.
Size and gas
- Deploying the exchange (which creates the other three) uses about 9.05M gas. Mezo blocks allow 10M, so deploy with
--gas-estimate-multiplier 105; Foundry's default 30% buffer would exceed the block limit. Re-measure after any contract change. MezonkExchangemust stay under the 24,576-byte runtime and 49,152-byte init code limits. Check withforge build --sizes.MezonkPriceResolverdeploys on its own; the deployment simulated against the live exchange used 1.68M gas.
Units
- MUSD has 18 decimals. Share quantities also use 18 decimals and must be multiples of
LOT = 1e16(0.01 share). - Prices are whole cents, 1 to 99. Cost of
qshares atpcents isq × p / 100, exact at lot granularity, so nothing rounds. - Outcomes:
None 0,Yes 1,No 2,Invalid 3. Share index:0Yes,1No. Side:0Buy,1Sell.
MezonkExchange
Holds all trading collateral. Ownable2Step, Pausable, ReentrancyGuard, EIP-712 domain ("MEZONK Exchange", "1").
| Function | Who | Does |
|---|---|---|
split(marketId, amount) | anyone, live markets | Lock amount MUSD, receive amount Yes + amount No |
merge(marketId, amount) | holder, after launch until final | Burn one Yes + one No per MUSD returned |
placeOrder(marketId, outcome, side, price, qty) | anyone, seeding or live | Escrowed resting order; seeding allows buys only; can't cross the book |
cancelOrder(orderId) | maker | Refund the unfilled part; seed orders locked for minRest after placing and again after launch |
take(params, sources) | taker, live | Fill against given resting ids and signed orders, best first, within limit and minFill |
cancelSignedOrders(orders), raiseMinNonce(n) | maker | Invalidate signed orders |
transferShares(marketId, outcome, to, amount) | holder | Move free shares |
graduate(marketId) | anyone | Move seeding to live if the escrowed book meets the policy |
redeem(marketId) | holder, final | Burn all your shares; Yes/No pay 1 if they won, Invalid pays 0.5 each |
settle(marketId, outcome) | resolution contract only | Record the final outcome once |
openMarket(...) | factory only | Open a market in seeding |
addPolicy, setPolicyActive, pause, unpause, withdrawProtocolFees(to) | owner | Policies for new markets, pause, fee withdrawal |
Key views: getMarket, getPolicy, getResting, stageOf, bestPrices, graduationCheck, orderHash,
sharesOf(marketId, index, account), depthAt, filledOf, seedWeight, totalCollateral, escrowedCollateral,
protocolFees, plus rebateWeight(marketId, seeder) and totalRebateWeight(marketId).
Pause blocks openMarket, graduate, split, placeOrder and take. It never blocks cancelling, merging,
transferring shares, resolution or redeeming.
| Event | When |
|---|---|
MarketCreated(marketId, creator, resolver, policyId, seedingDeadline, closeTime, metadataHash, metadata) | Market published |
Graduated(marketId, bestBid, bestAsk, bidDepth, askDepth, seeders) | Seeding met the policy |
OrderPlaced(orderId, marketId, maker, outcome, side, price, quantity, seed) | Resting order escrowed |
OrderCancelled(orderId, marketId, maker, remaining) | Resting order refunded |
Fill(marketId, orderRef, taker, maker, resting, makerOutcome, makerSide, makerPrice, quantity, complement, takerFee) | One maker filled |
TakeSettled(marketId, taker, outcome, side, filled, notional, fee, rebatePart, referralPart) | One take finished |
Split, Merged, SharesTransferred, Redeemed | Share movements |
MarketSettled(marketId, outcome) | Outcome recorded |
SignedOrderCancelled, MinNonceRaised | Signed orders invalidated |
PolicyAdded, PolicyActiveSet, ProtocolFeesWithdrawn | Owner actions |
Signed orders use the type
Order(address maker,address taker,uint256 marketId,uint8 outcome,uint8 side,uint8 price,uint128 quantity,uint64 expiry,uint256 nonce,uint256 salt).
A non-zero taker restricts who may fill it.
MezonkMarketFactory
Publication authority. Ownable2Step, EIP-712 domain ("MEZONK Markets", "2").
| Function | Who | Does |
|---|---|---|
createMarket(params, approval, curator, sig) | approved creator | Verify the curator's approval and open the market |
cancelApproval(nonce) | curator or owner | Void an approval before use |
setCreator, setCurator, setResolver | owner | Role lists |
setConfig(config) | owner | Windows, bonds and arbitrator for markets published afterwards |
config(), approvalDigest(approval), isCreator, isCurator, isResolver, approvalUsed | view |
createMarket reverts unless: metadata is 1 to 8,192 bytes, the resolver is allowlisted, the caller is a creator, the
curator is a curator and isn't the caller, the approval hasn't expired or been used, and the approval's metadata
hash, creator, resolver, close time and policy all match. Signatures may come from an EOA or an ERC-1271 contract.
Config bounds: challenge window 1 hour to 30 days, other windows up to 30 days, dispute bond above zero, arbitrator set.
Events: MarketApprovalUsed(marketId, curator, nonce), MarketApprovalCancelled, ConfigUpdated,
ResolverUpdated, CreatorUpdated, CuratorUpdated.
MezonkResolution
Holds bonds only.
| Function | Who | Does |
|---|---|---|
proposeOutcome(marketId, outcome, evidenceHash, uri) | the market's resolver; anyone after half the proposal window; before the window ends | Post the proposer bond and propose |
dispute(marketId, evidenceHash, uri) | anyone except the proposer, resolver and arbitrator, inside the challenge window | Post the dispute bond |
arbitrate(marketId, outcome, rationaleHash, uri) | the market's arbitrator, inside the arbitration window | Rule on a dispute |
finalize(marketId) | anyone, after a deadline | Undisputed → proposed outcome; no proposal or no ruling → Invalid |
withdrawBond() | anyone with credit | Withdraw credited bonds |
sweepSlashed(to) | the exchange owner | Move slashed half-bonds out |
stageOf(marketId) | view | NotClosed, AwaitingProposal, Proposed, Disputed, Finalized |
An upheld proposal credits both bonds to the proposer. An overturned one credits the dispute bond plus half the
proposer bond to the disputer, and the other half goes to slashedBonds, so disputing your own false proposal from a
second wallet costs money. Timeouts refund both.
Events: OutcomeProposed(marketId, resolver, outcome, evidenceHash, evidenceURI, challengeDeadline),
OutcomeDisputed, DisputeArbitrated, MarketFinalized(marketId, outcome, reason), BondCredited,
BondWithdrawn, BondSlashed, SlashedSwept.
MezonkIncentives
Holds only the rebate and referral share of taker fees the exchange actually collected.
| Function | Who | Does |
|---|---|---|
accrue(...) | exchange only, inside take | Split a fee into rebate and referral parts within the policy caps |
claimRebate(marketId) | seeder | Claim a pro-rata share of the market's rebate pool, capped per wallet |
sweepRebates(marketId) | anyone, after the claim window | Return unclaimed rebates to the exchange as protocol fees |
setReferrer(referrer) | anyone, once, before their first trade | Link a referrer; no self or two-way referral |
claimReferral() | referrer | Claim referral credit |
Rebate weight is the seeder's seed escrow inside the price band graduation measured; far-off orders count for nothing.
Events: ReferrerSet, RebateAccrued, ReferralAccrued, RebateClaimed, RebatesSwept, ReferralClaimed.
MezonkPriceResolver
| Function | Who | Does |
|---|---|---|
setRule(marketId, strike, direction) | owner, once, before close | Record the strike and direction |
settle(marketId) | anyone, inside the capture window | Read Mezo's PriceFeed and propose |
proposeManual(marketId, outcome, evidenceHash, uri) | owner, after the window | Fallback proposal |
withdrawBonds() / sweep(to, amount) | anyone / owner | Bond housekeeping |
Events: RuleSet, PriceCaptured, ManualProposal, Swept. Details: BTC price markets.
MezonkBtcRounds
Live on Mezo Mainnet at 0xc27f434195e4aF70782817A280A5D3Cb5de2ECa8: one-hour rounds, 10-minute capture window, 1% fee,
stakes worth $8 to $125.
Standalone: it needs nothing from the exchange and holds nothing but native BTC stakes. Timing (genesis,
interval, captureWindow) and the PriceFeed are immutable.
| Function | Who | Does |
|---|---|---|
bet(round, side) payable | anyone, during the open round's betting window | Stake BTC on Up or Down; msg.value must be worth minStakeUsd..maxStakeUsd at fetchPrice() now; one side per wallet per round |
roll(round) | anyone, from lockTime(round) for captureWindow seconds | Capture one price: locks round and settles round − 1; takes the fee on a decided round |
claim(roundIds) | anyone with a stake | Pay winnings or refunds in BTC for settled or void rounds; never expires |
result(round), claimable(round, account), btcForUsd(usd), getRound, getBet, currentRound, betStart, lockTime, closeTime | view | What the page reads |
setStakeLimits, setFee (≤ 500 bps), setPaused | owner | Limits for new bets; pause stops bets only |
sweep(to) | owner | Move accrued fees out; stakes can't be swept |
Events: BetPlaced(round, account, side, amount, usd, price), Rolled(round, price, updatedAt, settledRound, settledResult), Claimed(account, round, amount), StakeLimitsSet, FeeSet, PausedSet, FeesSwept.
Details: BTC up or down, with BTC.
ABIs
The app's ABIs are generated from the Foundry build into apps/web/src/lib/contracts/abi.ts (exchangeAbi,
factoryAbi, resolutionAbi, incentivesAbi, priceResolverAbi, btcRoundsAbi). After changing a contract:
forge build && node scripts/export-abi.mjs.