Skip to content

AiFinPay/contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

AiFinPay — Smart Contracts

The autonomous payment layer for AI agents. AiFinPay enables AI agents to hold wallets, make payments, and pay for services (GPU compute, APIs, SaaS) without any human in the loop.

Live on Polygon mainnet and Solana mainnet.


Protocol Overview

AI Agent → AiFinPay SDK → x402 Payment Gateway → Smart Contract → Merchant

Every agent gets:

  • Agent Seat — on-chain identity + mSECCO balance
  • Agent Passport — verified identity NFT for B2B payments
  • mSECCO token — protocol credit unit ($1 = 100 mSECCO)

Deployed Contracts

Polygon Mainnet (Chain ID: 137)

Contract Address Polygonscan
AiFinPayCore 0x8Ad9830D16b1f10333866a3f38C949CbB19f4BAD View
AgentPassport 0x66fFe91eE0B80f386EB07F97354e2889CD162185 View
MSECCOToken 0x83936231c80fdF17eC2786BD7DcF09014552182B View
B2BSplitter 0xE34Fc0E6694821c600Fa0955C0F74720ea6d8440 View
Gnosis Safe (multisig owner) 0xD31d82c4b35DABaA2ad7023C89A78A052D1f3c8e View

All contracts verified on Polygonscan + Sourcify.

Solana Mainnet

Program ID 5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2
Solscan View
Framework Anchor (Rust)
Version v0.5.3

Contract Architecture

AiFinPayCore (Polygon)

  • Seat reservation (MATIC, USDC, USDT)
  • mSECCO minting (1 USD cent = 1 mSECCO)
  • Pyth Pull Oracle for MATIC/USD pricing (max 60s staleness)
  • Partner registry
  • B2B payment with atomic split

AgentPassport (Polygon)

  • Non-transferable ERC-721 identity NFT per agent
  • Statuses: Inactive → Active → Verified_B2B → Suspended
  • Daily spending limits
  • IP creator royalty address

MSECCOToken (Polygon)

  • ERC-20 protocol credit token
  • Minted only by AiFinPayCore
  • Non-transferable (soulbound)

B2BSplitter (Polygon)

  • Standalone payment splitter
  • Splits: 98.99% merchant / 1% treasury / 0.01% IP creator
  • Supports MATIC + USDC + USDT
  • Owned by Gnosis Safe 4-of-4 multisig

Solana Program

  • Seat reservation (SOL, USDC, USDT)
  • mSECCO minting
  • Agent Passport (PDA per agent)
  • B2B payment with atomic split
  • ARP referral tier system (Scout → Partner → Ambassador → Oracle)
  • Pyth oracle for SOL/USD pricing
  • Emergency pause

x402 Payment Flow

1. Agent calls x402-protected API endpoint
2. Server returns HTTP 402 + payment manifest
3. AiFinPay SDK signs challenge (Ed25519)
4. SDK submits payment transaction on-chain
5. Server verifies payment + returns response

B2B Split (Both Chains)

Recipient Share
Merchant 98.99%
AiFinPay Treasury 1.00%
IP Creator (royalty) 0.01%

SDK

Agent-side SDKs: github.com/AiFinPay/sdk

  • Python: pip install aifinpay-agent --pre
  • Node/TypeScript: npm install @aifinpay/agent@alpha
  • MCP server for Claude Desktop: npx @aifinpay/mcp

Security

  • Pyth Pull Oracle — price data verified on-chain, max 60s staleness
  • Reentrancy guards on all payment functions
  • Non-transferable passport + mSECCO tokens
  • Gnosis Safe 4-of-4 multisig owns all admin functions
  • All contracts verified on Polygonscan + Sourcify

Links

About

AiFinPay smart contracts — Polygon (Solidity) + Solana (Rust/Anchor). Live on mainnet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors