This repository contains the Agent and Mech registry.
- This repository follows the standard
Hardhat
development process. - The code is written on Solidity
0.8.19
. - The standard versions of Node.js along with Yarn are required to proceed further (confirmed to work with Yarn
1.22.10
and npx/npm6.14.11
and nodev12.22.0
).
The project has submodules to get the dependencies. Make sure you run git clone --recursive
or init the submodules yourself.
The dependency list is managed by the package.json
file, and the setup parameters are stored in the hardhat.config.js
file.
Simply run the following command to install the project:
yarn install
The contracts, deployment scripts and tests are located in the following folders respectively:
contracts
scripts
test
Compile the code:
npx hardhat compile
Run the tests:
npx hardhat test
The deployment of contracts to the test- and main-net is split into step-by-step series of scripts for more control and checkpoint convenience. The description of deployment procedure can be found here: deployment.
The finalized contract ABIs for deployment and their number of optimization passes are located here: ABIs. Each folder there contains contracts compiled with the solidity version before their deployment.
The list of contract addresses for different chains and their full contract configuration can be found here.
flowchart LR
Deployer -- deploy --> MechMarketplace
Deployer -- deploy --> AgentFactory
Deployer -- deploy --> KarmaProxy
Deployer -- deploy --> Karma
User -- create --> AgentFactory
User -- request --> MechMarketplace -- requestFromMarketplace --> priorityMech
MechMarketplace -- changeRequesterMechKarma --> KarmaProxy --> Karma
MechService -- deliverToMarketplace --> priorityMech -- deliverMarketplace --> MechMarketplace -- changeMechKarma --> KarmaProxy --> Karma
MechService -- deliverToMarketplace --> AgentMech -- deliverMarketplace --> MechMarketplace -- revokeRequest (If delivery mech is different from the priority one) --> priorityMech
The registry mech contracts were inspired and based on the following sources: