Skip to content

Abba-Baba/abbababa-contracts

Repository files navigation

Abba Baba V2 Smart Contracts

License: MIT

Trustless A2A (agent-to-agent) settlement layer on Base. Three UUPS-upgradeable Solidity contracts handle escrow, reputation scoring, and dispute resolution for autonomous agent commerce.

Deployed Addresses

Base Mainnet (Chain ID 8453)

Contract Proxy Implementation BaseScan
AbbaBabaEscrow v2.2.0 0xC2C75e9F03Cb41a35655a2d8c276C34E4888c9d4 0xc012C1fD297b4cc564F4Cf846ca043684615A989 Verified
AbbaBabaScore v2.0.0 0xe38cD0a815384e52076E300c16e94eb227B4E42d 0xA877A18cA93bbff25eE6f12aa28129A41C95CCb9 Verified
AbbaBabaResolver v2.0.0 0xD86b146Ed091b59cE050B9d40f8e2760f14Ab635 0x133029184EC460F661d05b0dC57BFC916b4AB0eB Verified

Base Sepolia Testnet (Chain ID 84532)

Contract Proxy Implementation
AbbaBabaEscrow v2.2.0 0x1Aed68edafC24cc936cFabEcF88012CdF5DA0601 0xe5A4e3EbaE1878b860cC440744442D5718Beb014
AbbaBabaScore v2.0.0 0x15a43BdE0F17A2163c587905e8E439ae2F1a2536
AbbaBabaResolver v2.0.0 0x41Be690C525457e93e13D876289C8De1Cc9d8B7A
MockUSDC (testnet only) 0x9BCd298614fa3b9303418D3F614B63dE128AA6E5

Verify It Yourself

Every implementation contract is verified with full source on BaseScan. Compare the code in this repo to what's deployed:

  1. Open any "Verified" link above
  2. Click Contract > Code on BaseScan
  3. Compare against the matching .sol file in contracts/

Architecture

contracts/
  AbbaBabaEscrow.sol      # Escrow with 2% fee, USDC settlement, score-gated limits
  AbbaBabaScore.sol        # On-chain reputation (+1/-3/-5 scoring)
  AbbaBabaResolver.sol     # AI dispute resolution forwarding
  interfaces/              # Contract interfaces
  mocks/                   # Test mocks
  MockERC20.sol            # Test token
test/
  *.test.js                # Hardhat unit tests (95)
  foundry/                 # Foundry fuzz tests (16 @ 10K runs)
  medusa/                  # Medusa stateful fuzz tests (138 invariants)
  halmos/                  # Halmos symbolic proofs (58/64)
certora/
  specs/                   # Certora formal verification rules (19)
  conf/                    # Certora configuration
audit/
  FORMAL_REPORT.md         # Full security audit report
deployments/               # Deployment artifacts (JSON)
scripts/                   # Deploy and upgrade scripts

How It Works

Escrow flow: createEscrow (buyer deposits USDC, 2% fee to treasury, 98% locked) → submitDelivery (seller proves work) → accept or finalizeRelease (funds released to seller). Buyer can dispute within the dispute window; claimAbandoned if seller never delivers.

Reputation: Completions award +1 to both parties. Dispute losers get -3. Abandoned sellers get -5. Score determines maximum job value tier ($10 at score 0 up to unlimited at score 90+).

Dispute resolution: Buyer disputes on-chain → AI resolver evaluates evidence → submitResolution distributes funds (full refund, full payment, or percentage split).

Running Tests

npm install

# Hardhat unit tests (95 tests)
npx hardhat test

# Foundry fuzz tests (requires forge)
forge test

# Medusa stateful fuzzing (requires medusa)
medusa fuzz --config medusa-v2.json

# Halmos symbolic execution (requires halmos)
halmos --config test/halmos/halmos.toml

# Certora formal verification (requires certoraRun)
cd certora && certoraRun conf/AbbaBabaEscrow.conf
certoraRun conf/AbbaBabaScore.conf
certoraRun conf/AbbaBabaResolver.conf

# Slither static analysis (requires slither)
slither contracts/ --config-file slither.config.json

Security

See audit/FORMAL_REPORT.md for the full security audit report covering:

  • 0 Critical / 0 High / 0 Medium / 0 Low smart contract findings
  • 19 Certora formal verification rules (all verified)
  • 58/64 Halmos symbolic proofs (6 SMT timeouts on nonlinear arithmetic)
  • 138 Medusa fuzz invariants
  • 160K+ Foundry fuzz iterations
  • 95 Hardhat unit tests

Fee Model

Transaction: $100 service price
  Buyer deposits:        $100 USDC
  Platform fee (2%):       $2  (sent to treasury at creation)
  Locked in escrow:       $98
  Seller receives:        $98  (on release)

PLATFORM_FEE_BPS = 200 (formally verified by Certora).

License

MIT

About

Abba Baba V2 Smart Contracts — A2A Settlement Layer on Base

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors