Skip to content

Repository files navigation

MozaikPay Contracts

This document covers deploying the MozaikPay smart contracts to Base Sepolia (testnet) and Base mainnet.

Prerequisites

  • Foundry installed (forge, cast)
  • A deployer wallet with ETH on the target chain (for gas)
  • A sponsor wallet (hot wallet) whose private key signs paymaster approvals
  • An RPC endpoint for the target chain. The Makefile defaults to the public Base endpoints (https://sepolia.base.org, https://mainnet.base.org); set BASE_SEPOLIA_RPC / BASE_MAINNET_RPC to use your own (recommended for mainnet)

Chain Reference

Parameter Base Sepolia (testnet) Base Mainnet
Chain ID 84532 8453
RPC (Infura) https://base-sepolia.infura.io/v3/<API_KEY> https://base-mainnet.infura.io/v3/<API_KEY>
EntryPoint v0.9 0x433709009B8330FDa32311DF1C2AFA402eD8D009 0x433709009B8330FDa32311DF1C2AFA402eD8D009
USDC 0x036CbD53842c5426634e7929541eC2318f3dCF7e 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Block explorer https://sepolia.basescan.org https://basescan.org

The EntryPoint v0.9 is already deployed at the canonical address on both chains via deterministic CREATE2. You do not need to deploy it.

Contracts Overview

Four contracts are deployed per environment on Base, plus one on Ethereum L1:

  1. MozaikAccountFactory -- CREATE2 factory for deploying ERC-4337 smart accounts. The canonical EntryPoint v0.9 is hardcoded (not a constructor argument), matching the account, so deployment and runtime authority cannot diverge.
  2. MozaikVerifyingPaymaster -- Sponsors gas for UserOperations. Constructor takes the sponsor wallet address; the canonical EntryPoint v0.9 is hardcoded.
  3. MozaikAccount (implementation) -- Deployed automatically by the factory constructor. Not called directly.
  4. MozaikPaylinks -- Non-upgradeable USDC escrow for payment links. Deployed by 01_Deploy.s.sol alongside the account/paymaster stack, bound to the chain's USDC. Constructor takes the USDC token address; immutable thereafter. Lifecycle: create (sender locks USDC under an ephemeral claimSigner), claim (recipient redeems with an EIP-712 signature over the claim payload), reclaim (sender returns funds; sender-only pre-expiry, permissionless at or after expiry).
  5. MozaikL1Resolver (Ethereum, src/ens/) -- ENS resolver for mozaikpay.eth. Subnames resolve through a CCIP-read gateway; the resolver only checks the gateway's signature. Vendored from Basenames.

About

Solidity contracts for MozaikPay, the mobile wallet that works for you

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages