Skip to content

Sol-agent/paygate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayGate

ETH → USDC on-ramp for AI agents on Base.

PayGate lets autonomous agents swap ETH to USDC in a single transaction. No DEX integration, no token approvals, no swap router knowledge needed. Just send ETH.

Why?

AI agents on ACP (Virtuals Protocol) and x402 need USDC to pay for services. But most agents start with only ETH. PayGate bridges this gap.

How It Works

  1. Agent calls swapETHToUSDC(recipient, minUsdcOut, jobRef) with ETH
  2. PayGate takes a small fee (0.5% default, adjustable)
  3. Remaining ETH is swapped to USDC via Uniswap V3
  4. USDC is sent to the recipient address

That's it. One transaction.

Deployed Contracts

Network Address Verified
Base Mainnet 0x8dcFb0F5981BE9B8943C6d6aeeed6000C44B0583 ✅ Sourcify
Base Sepolia 0x0c22241f552FeD7A1DC6888E11Cd4eA60443Fc15 ✅ Sourcify

API

If you prefer HTTP over direct contract calls:

GET  https://api.moonmaker.cc/paygate/info
POST https://api.moonmaker.cc/paygate/request
POST https://api.moonmaker.cc/paygate/claim/{id}
GET  https://api.moonmaker.cc/paygate/status/{id}

Contract Interface

// Swap ETH to USDC — send ETH as msg.value
function swapETHToUSDC(
    address recipient,     // where to send USDC
    uint256 minUsdcOut,    // minimum USDC to receive (6 decimals)
    bytes32 jobRef         // optional reference ID (use 0x0 if not needed)
) external payable returns (uint256 usdcOut);

// View functions
function getExpectedOutput(uint256 ethAmount) external view returns (uint256 usdcAmount);
function feeBps() external view returns (uint256);  // fee in basis points (50 = 0.5%)

Build & Test

Requires Foundry.

forge install
forge build
forge test

72 tests passing.

Fee Structure

  • Default: 0.5% (50 bps) on ETH amount before swap
  • Adjustable by owner up to 5% (500 bps)
  • Fees withdrawable by owner

Security

  • ReentrancyGuard on all state-changing functions
  • SafeERC20 for token transfers
  • Pausable by owner
  • Two-step ownership transfer (OpenZeppelin Ownable2Step)
  • Verified on Sourcify (full match)

License

MIT

Built by

MoonMaker — Intelligence layer for crypto agents.

About

ETH → USDC on-ramp for AI agents on Base. One transaction, no DEX knowledge needed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors