Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyAI Contracts

On-chain smart contracts for the MyAI distributed GPU compute marketplace.

Built with Foundry. Deployed on Base.


Contracts

MyAIPayments.sol

Escrow contract that handles compute job payments between consumers and GPU providers.

Payment flow:

Consumer deposits MYAI
       ↓
Coordinator escrows per job
       ↓
GPU agent completes inference
       ↓
Coordinator releases payment
       ↓
Provider withdraws earnings (80%)
Treasury receives platform fee (20%)
Function Caller Description
deposit(amount) Consumer Lock MYAI as compute credits
withdrawCredits(amount) Consumer Reclaim unused credits
escrowJob(jobId, consumer, payment) Coordinator Deduct credits, lock for job
completeJob(jobId, provider) Coordinator Pay provider 80%, treasury 20%
refundJob(jobId) Coordinator Return payment on job failure
withdraw() Provider Pull earned MYAI to wallet

Token

Token MYAI
Contract 0xaff22cc20434ce43b3ea10efe10e9360390d327c
Chain Base (8453)
Standard ERC-20
Supply 1,000,000,000 MYAI

Development

Prerequisites

curl -L https://foundry.paradigm.xyz | bash
foundryup

Build

forge build

Test

forge test -v

Deploy to Base Sepolia (testnet)

cp .env.example .env
# Fill in PRIVATE_KEY, OPERATOR_ADDRESS, TREASURY_ADDRESS, BASESCAN_API_KEY

forge script script/Deploy.s.sol \
  --rpc-url base_sepolia \
  --broadcast \
  --verify \
  -vvvv

Deploy to Base Mainnet

forge script script/Deploy.s.sol \
  --rpc-url base \
  --broadcast \
  --verify \
  -vvvv

Security

  • operator role (coordinator) is the only address that can escrow/complete/refund jobs
  • owner role can update operator, treasury, and platform fee
  • Platform fee capped at 50% in contract
  • All state changes emit events
  • No upgradeability — immutable deploy

License

MIT

About

MyAI on-chain smart contracts — Solidity, Foundry, Base

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages