@wangwuww/neo-market-cli 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/SKILL.md +81 -0
- package/artifacts/contracts/AgentRegistry.sol/AgentRegistry.dbg.json +4 -0
- package/artifacts/contracts/AgentRegistry.sol/AgentRegistry.json +400 -0
- package/artifacts/contracts/ArbitrationMultisig.sol/ArbitrationMultisig.dbg.json +4 -0
- package/artifacts/contracts/ArbitrationMultisig.sol/ArbitrationMultisig.json +243 -0
- package/artifacts/contracts/ArbitrationMultisig.sol/ITokenEscrowExecute.dbg.json +4 -0
- package/artifacts/contracts/ArbitrationMultisig.sol/ITokenEscrowExecute.json +24 -0
- package/artifacts/contracts/FeeManager.sol/FeeManager.dbg.json +4 -0
- package/artifacts/contracts/FeeManager.sol/FeeManager.json +53 -0
- package/artifacts/contracts/Marketplace.sol/IModuleRegistry.dbg.json +4 -0
- package/artifacts/contracts/Marketplace.sol/IModuleRegistry.json +30 -0
- package/artifacts/contracts/Marketplace.sol/ITokenEscrowMinimal.dbg.json +4 -0
- package/artifacts/contracts/Marketplace.sol/ITokenEscrowMinimal.json +120 -0
- package/artifacts/contracts/Marketplace.sol/Marketplace.dbg.json +4 -0
- package/artifacts/contracts/Marketplace.sol/Marketplace.json +746 -0
- package/artifacts/contracts/ModuleKeys.sol/ModuleKeys.dbg.json +4 -0
- package/artifacts/contracts/ModuleKeys.sol/ModuleKeys.json +10 -0
- package/artifacts/contracts/ModuleRegistry.sol/ModuleRegistry.dbg.json +4 -0
- package/artifacts/contracts/ModuleRegistry.sol/ModuleRegistry.json +169 -0
- package/artifacts/contracts/Reputation.sol/Reputation.dbg.json +4 -0
- package/artifacts/contracts/Reputation.sol/Reputation.json +265 -0
- package/artifacts/contracts/TokenEscrow.sol/IArbitration.dbg.json +4 -0
- package/artifacts/contracts/TokenEscrow.sol/IArbitration.json +59 -0
- package/artifacts/contracts/TokenEscrow.sol/IERC20Minimal.dbg.json +4 -0
- package/artifacts/contracts/TokenEscrow.sol/IERC20Minimal.json +64 -0
- package/artifacts/contracts/TokenEscrow.sol/IFeeManager.dbg.json +4 -0
- package/artifacts/contracts/TokenEscrow.sol/IFeeManager.json +37 -0
- package/artifacts/contracts/TokenEscrow.sol/IModuleRegistry.dbg.json +4 -0
- package/artifacts/contracts/TokenEscrow.sol/IModuleRegistry.json +30 -0
- package/artifacts/contracts/TokenEscrow.sol/TokenEscrow.dbg.json +4 -0
- package/artifacts/contracts/TokenEscrow.sol/TokenEscrow.json +1091 -0
- package/artifacts/contracts/USDCMock.sol/USDCMock.dbg.json +4 -0
- package/artifacts/contracts/USDCMock.sol/USDCMock.json +251 -0
- package/artifacts/contracts/interfaces/IAgentRegistry.sol/IAgentRegistry.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IAgentRegistry.sol/IAgentRegistry.json +203 -0
- package/artifacts/contracts/interfaces/IArbitration.sol/IArbitration.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IArbitration.sol/IArbitration.json +127 -0
- package/artifacts/contracts/interfaces/IEscrow.sol/IEscrow.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IEscrow.sol/IEscrow.json +431 -0
- package/artifacts/contracts/interfaces/IFeeManager.sol/IFeeManager.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IFeeManager.sol/IFeeManager.json +87 -0
- package/artifacts/contracts/interfaces/IMarketplace.sol/IMarketplace.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IMarketplace.sol/IMarketplace.json +427 -0
- package/artifacts/contracts/interfaces/IReputation.sol/IReputation.dbg.json +4 -0
- package/artifacts/contracts/interfaces/IReputation.sol/IReputation.json +151 -0
- package/artifacts/contracts/interfaces/ISignatures.sol/ISignatures.dbg.json +4 -0
- package/artifacts/contracts/interfaces/ISignatures.sol/ISignatures.json +414 -0
- package/artifacts/contracts/interfaces/ITokenEscrow.sol/ITokenEscrow.dbg.json +4 -0
- package/artifacts/contracts/interfaces/ITokenEscrow.sol/ITokenEscrow.json +245 -0
- package/deployed_addresses.json +11 -0
- package/dist/artifacts/build-info/263a967f7f3cd59c812a49b3d7012981.json +1 -0
- package/dist/artifacts/build-info/4a4ba527b0f3c1846c84e3e500a6db58.json +1 -0
- package/dist/artifacts/build-info/4e7053f3332c81b7a9916619c1b87388.json +1 -0
- package/dist/artifacts/build-info/50367a8838c4b3b556df951a374f59c7.json +1 -0
- package/dist/artifacts/build-info/61ca0f28829f90b00df26748203acea3.json +1 -0
- package/dist/artifacts/build-info/63fca17ade81ae3db2e066ca74f790d1.json +1 -0
- package/dist/artifacts/build-info/85f6bdb1a79bcf0154bb1562fa8e221e.json +1 -0
- package/dist/artifacts/contracts/AgentRegistry.sol/AgentRegistry.dbg.json +4 -0
- package/dist/artifacts/contracts/AgentRegistry.sol/AgentRegistry.json +400 -0
- package/dist/artifacts/contracts/ArbitrationMultisig.sol/ArbitrationMultisig.dbg.json +4 -0
- package/dist/artifacts/contracts/ArbitrationMultisig.sol/ArbitrationMultisig.json +243 -0
- package/dist/artifacts/contracts/ArbitrationMultisig.sol/ITokenEscrowExecute.dbg.json +4 -0
- package/dist/artifacts/contracts/ArbitrationMultisig.sol/ITokenEscrowExecute.json +24 -0
- package/dist/artifacts/contracts/FeeManager.sol/FeeManager.dbg.json +4 -0
- package/dist/artifacts/contracts/FeeManager.sol/FeeManager.json +53 -0
- package/dist/artifacts/contracts/Marketplace.sol/IModuleRegistry.dbg.json +4 -0
- package/dist/artifacts/contracts/Marketplace.sol/IModuleRegistry.json +30 -0
- package/dist/artifacts/contracts/Marketplace.sol/ITokenEscrowMinimal.dbg.json +4 -0
- package/dist/artifacts/contracts/Marketplace.sol/ITokenEscrowMinimal.json +120 -0
- package/dist/artifacts/contracts/Marketplace.sol/Marketplace.dbg.json +4 -0
- package/dist/artifacts/contracts/Marketplace.sol/Marketplace.json +746 -0
- package/dist/artifacts/contracts/ModuleKeys.sol/ModuleKeys.dbg.json +4 -0
- package/dist/artifacts/contracts/ModuleKeys.sol/ModuleKeys.json +10 -0
- package/dist/artifacts/contracts/ModuleRegistry.sol/ModuleRegistry.dbg.json +4 -0
- package/dist/artifacts/contracts/ModuleRegistry.sol/ModuleRegistry.json +169 -0
- package/dist/artifacts/contracts/Reputation.sol/Reputation.dbg.json +4 -0
- package/dist/artifacts/contracts/Reputation.sol/Reputation.json +265 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IArbitration.dbg.json +4 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IArbitration.json +59 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IERC20Minimal.dbg.json +4 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IERC20Minimal.json +64 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IFeeManager.dbg.json +4 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IFeeManager.json +37 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IModuleRegistry.dbg.json +4 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/IModuleRegistry.json +30 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/TokenEscrow.dbg.json +4 -0
- package/dist/artifacts/contracts/TokenEscrow.sol/TokenEscrow.json +1091 -0
- package/dist/artifacts/contracts/USDCMock.sol/USDCMock.dbg.json +4 -0
- package/dist/artifacts/contracts/USDCMock.sol/USDCMock.json +251 -0
- package/dist/artifacts/contracts/interfaces/IAgentRegistry.sol/IAgentRegistry.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IAgentRegistry.sol/IAgentRegistry.json +203 -0
- package/dist/artifacts/contracts/interfaces/IArbitration.sol/IArbitration.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IArbitration.sol/IArbitration.json +127 -0
- package/dist/artifacts/contracts/interfaces/IEscrow.sol/IEscrow.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IEscrow.sol/IEscrow.json +431 -0
- package/dist/artifacts/contracts/interfaces/IFeeManager.sol/IFeeManager.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IFeeManager.sol/IFeeManager.json +87 -0
- package/dist/artifacts/contracts/interfaces/IMarketplace.sol/IMarketplace.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IMarketplace.sol/IMarketplace.json +427 -0
- package/dist/artifacts/contracts/interfaces/IReputation.sol/IReputation.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/IReputation.sol/IReputation.json +151 -0
- package/dist/artifacts/contracts/interfaces/ISignatures.sol/ISignatures.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/ISignatures.sol/ISignatures.json +414 -0
- package/dist/artifacts/contracts/interfaces/ITokenEscrow.sol/ITokenEscrow.dbg.json +4 -0
- package/dist/artifacts/contracts/interfaces/ITokenEscrow.sol/ITokenEscrow.json +245 -0
- package/dist/cli.js +306 -0
- package/dist/deployed_addresses.json +11 -0
- package/dist/scripts/bridge_to_base.js +67 -0
- package/dist/scripts/check_balance.js +46 -0
- package/dist/scripts/count_agents.js +62 -0
- package/dist/scripts/demo_e2e.js +256 -0
- package/dist/scripts/deploy_prod.js +190 -0
- package/dist/scripts/deploy_sepolia.js +196 -0
- package/dist/scripts/issue_usdc.js +97 -0
- package/dist/scripts/issue_usdc_retry.js +92 -0
- package/dist/scripts/run_genesis_tx.js +127 -0
- package/dist/scripts/show_address.js +52 -0
- package/dist/scripts/test_encryption.js +65 -0
- package/dist/scripts/utils/encryption.js +80 -0
- package/dist/scripts/verify_and_run.js +130 -0
- package/dist/scripts/wire_and_verify.js +120 -0
- package/package.json +39 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const hardhat_1 = __importDefault(require("hardhat"));
|
|
40
|
+
const hardhat_2 = require("hardhat");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const ADDRS = {
|
|
44
|
+
ModuleRegistry: "0xF15d928954F9Ac529CF706027e5E1829B1aBed34",
|
|
45
|
+
AgentRegistry: "0xF040bE18dfb1f0ac50c599fb187668a0B428481C",
|
|
46
|
+
FeeManager: "0x2F6fB6bE3F176B2e424405C27E02fE0414237B83",
|
|
47
|
+
TokenEscrow: "0x93838551F77f732831F435A3C395805Ce8609be6",
|
|
48
|
+
Marketplace: "0x339f142deE647aD8518db6b7e2045B5F3d5aEeFc",
|
|
49
|
+
Reputation: "0xf9a166CaF953F6D50af3a63BC0D02084C832a791"
|
|
50
|
+
};
|
|
51
|
+
const FEE_BPS = 250;
|
|
52
|
+
const USDC_ADDRESS = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
|
|
53
|
+
async function verifyContract(name, address, args) {
|
|
54
|
+
try {
|
|
55
|
+
await hardhat_1.default.run("verify:verify", { address, constructorArguments: args });
|
|
56
|
+
console.log(`✅ Verified ${name}`);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
if (e.message?.includes("Already Verified"))
|
|
60
|
+
console.log(`✅ ${name} already verified`);
|
|
61
|
+
else
|
|
62
|
+
console.log(`⚠️ Verify failed for ${name}: ${e.message}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function main() {
|
|
66
|
+
const [deployer] = await hardhat_2.ethers.getSigners();
|
|
67
|
+
console.log("Resuming wiring & verification...");
|
|
68
|
+
console.log("Deployer:", deployer.address);
|
|
69
|
+
const registry = await hardhat_2.ethers.getContractAt("ModuleRegistry", ADDRS.ModuleRegistry);
|
|
70
|
+
const reputation = await hardhat_2.ethers.getContractAt("Reputation", ADDRS.Reputation);
|
|
71
|
+
const KEYS = {
|
|
72
|
+
AGENT: await registry.AGENT_REGISTRY(),
|
|
73
|
+
ESCROW: await registry.TOKEN_ESCROW(),
|
|
74
|
+
REPUTATION: await registry.REPUTATION(),
|
|
75
|
+
FEE: hardhat_2.ethers.id("FEE_MANAGER"),
|
|
76
|
+
TREASURY: hardhat_2.ethers.id("TREASURY")
|
|
77
|
+
};
|
|
78
|
+
// Helper to retry tx
|
|
79
|
+
const setModule = async (key, addr, label) => {
|
|
80
|
+
try {
|
|
81
|
+
const current = await registry.modules(key);
|
|
82
|
+
if (current === addr) {
|
|
83
|
+
console.log(` ${label} already set.`);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
console.log(` Setting ${label}...`);
|
|
87
|
+
const tx = await registry.setModule(key, addr);
|
|
88
|
+
await tx.wait();
|
|
89
|
+
console.log(` ✅ ${label} set.`);
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
console.error(` ❌ Failed to set ${label}:`, e);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
await setModule(KEYS.AGENT, ADDRS.AgentRegistry, "AgentRegistry");
|
|
96
|
+
await setModule(KEYS.ESCROW, ADDRS.TokenEscrow, "TokenEscrow");
|
|
97
|
+
await setModule(KEYS.FEE, ADDRS.FeeManager, "FeeManager");
|
|
98
|
+
await setModule(KEYS.TREASURY, deployer.address, "Treasury"); // Default to deployer
|
|
99
|
+
await setModule(KEYS.REPUTATION, ADDRS.Reputation, "Reputation");
|
|
100
|
+
console.log(" Setting Reputation updater...");
|
|
101
|
+
try {
|
|
102
|
+
const tx = await reputation.setUpdater(ADDRS.TokenEscrow);
|
|
103
|
+
await tx.wait();
|
|
104
|
+
console.log(" ✅ Reputation updater set.");
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
console.log(" ⚠️ Failed/Already set updater.");
|
|
108
|
+
}
|
|
109
|
+
console.log("\nVerifying...");
|
|
110
|
+
await verifyContract("ModuleRegistry", ADDRS.ModuleRegistry, []);
|
|
111
|
+
await verifyContract("AgentRegistry", ADDRS.AgentRegistry, []);
|
|
112
|
+
await verifyContract("FeeManager", ADDRS.FeeManager, [FEE_BPS, deployer.address]);
|
|
113
|
+
await verifyContract("TokenEscrow", ADDRS.TokenEscrow, [USDC_ADDRESS, ADDRS.ModuleRegistry]);
|
|
114
|
+
await verifyContract("Marketplace", ADDRS.Marketplace, [ADDRS.ModuleRegistry]);
|
|
115
|
+
await verifyContract("Reputation", ADDRS.Reputation, []);
|
|
116
|
+
const outPath = path.join(process.cwd(), "deployed_addresses.json");
|
|
117
|
+
fs.writeFileSync(outPath, JSON.stringify({ ...ADDRS, network: "sepolia", chainId: 11155111 }, null, 2));
|
|
118
|
+
console.log(`\n🎉 Done! Saved to ${outPath}`);
|
|
119
|
+
}
|
|
120
|
+
main().catch(console.error);
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wangwuww/neo-market-cli",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "CLI for Autonomous Agents to interact with the Agent Market",
|
|
5
|
+
"bin": {
|
|
6
|
+
"neo-market": "dist/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"artifacts/contracts/**/*.json",
|
|
11
|
+
"deployed_addresses.json",
|
|
12
|
+
"SKILL.md",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "hardhat compile",
|
|
20
|
+
"build:cli": "tsc -p tsconfig.cli.json && chmod +x dist/cli.js",
|
|
21
|
+
"prepublishOnly": "npm run build && npm run build:cli",
|
|
22
|
+
"deploy:prod": "hardhat run scripts/deploy_prod.ts",
|
|
23
|
+
"demo:e2e": "hardhat run scripts/demo_e2e.ts",
|
|
24
|
+
"test": "hardhat test"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
|
28
|
+
"@types/node": "^20.12.7",
|
|
29
|
+
"dotenv": "^17.2.4",
|
|
30
|
+
"hardhat": "^2.22.3",
|
|
31
|
+
"ts-node": "^10.9.2",
|
|
32
|
+
"typescript": "^5.4.5"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"commander": "^14.0.3",
|
|
36
|
+
"eth-crypto": "^3.1.0",
|
|
37
|
+
"ethers": "^6.13.5"
|
|
38
|
+
}
|
|
39
|
+
}
|