On-chain smart contracts for the MyAI distributed GPU compute marketplace.
Built with Foundry. Deployed on Base.
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 | MYAI |
| Contract | 0xaff22cc20434ce43b3ea10efe10e9360390d327c |
| Chain | Base (8453) |
| Standard | ERC-20 |
| Supply | 1,000,000,000 MYAI |
curl -L https://foundry.paradigm.xyz | bash
foundryupforge buildforge test -vcp .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 \
-vvvvforge script script/Deploy.s.sol \
--rpc-url base \
--broadcast \
--verify \
-vvvvoperatorrole (coordinator) is the only address that can escrow/complete/refund jobsownerrole can update operator, treasury, and platform fee- Platform fee capped at 50% in contract
- All state changes emit events
- No upgradeability — immutable deploy
MIT