aere-contracts/scripts/conformanta-locala-8004.js
Aere Network 1b50878368
Some checks failed
contracts-ci / Install (lockfile) → compile → full test suite (push) Failing after 16m0s
contracts-ci / Ethereum interop (EIP-2537 BLS, prague hardfork) (push) Failing after 27s
contracts-ci / PQC known-answer tests (NIST vectors) (push) Failing after 16m53s
contracts-ci / Coverage (scoped, with artifacts) (push) Has been cancelled
ERC-8004 V2 registries transcribed from the current draft (identity ERC-721+metadata+agentWallet, reputation, validation), 17 unit tests, local conformance deployment script; fixtures provenance; the MPC verifier moves to contracts/mpc (the publish gate refuses any 'confidential' path by structure)
2026-09-02 17:52:51 +03:00

36 lines
2.2 KiB
JavaScript

// Desfasoara cele trei registre ERC-8004 V2 pe reteaua data (implicit: nodul hardhat local) si scrie fisierul
// de adrese pe care suita de conformitate il primeste prin AERE_CONFORMANCE_ADDR_FILE. Asa conformitatea
// CODULUI se masoara inainte sa desfasoare cineva ceva pe 2800 (care e semnatura fondatorului).
// npx hardhat run scripts/conformanta-locala-8004.js --network localhost
const { ethers, network } = require("hardhat");
const fs = require("fs");
const path = require("path");
async function main() {
const [deployer] = await ethers.getSigners();
const idr = await (await ethers.getContractFactory("AereIdentityRegistry8004V2")).deploy();
await idr.waitForDeployment();
const rep = await (await ethers.getContractFactory("AereReputationRegistry8004V2")).deploy(await idr.getAddress());
await rep.waitForDeployment();
const val = await (await ethers.getContractFactory("AereValidationRegistry8004V2")).deploy(await idr.getAddress());
await val.waitForDeployment();
// un agent inregistrat si o cerere de validare, ca POP-1 sa aiba ce numara
await (await idr["register(string)"]("ipfs://agent-local")).wait();
const h = ethers.keccak256(ethers.toUtf8Bytes("local-request"));
await (await val.validationRequest(deployer.address, 1, "ipfs://req", h)).wait();
await (await val.validationResponse(h, 100, "", ethers.ZeroHash, "hard")).wait();
const out = {
identity8004: await idr.getAddress(),
validation8004: await val.getAddress(),
reputation8004: await rep.getAddress(),
// primitivele vii ale lui 2800 nu exista pe reteaua locala; se lasa pe cele de mainnet doar ca sa aiba forma,
// iar verificarile lor (PQC, x402) NU sunt tinta rularii locale si raman cum ies
agentDID: await idr.getAddress(), pqcKeyRegistry: await idr.getAddress(), aiReputation: await rep.getAddress(), aere402V2: await val.getAddress(),
};
const p = path.join(__dirname, "..", "reports", "adrese-conformanta-locala.json");
fs.mkdirSync(path.dirname(p), { recursive: true });
fs.writeFileSync(p, JSON.stringify(out, null, 2));
console.log(`retea ${network.name}: identity ${out.identity8004}, reputation ${out.reputation8004}, validation ${out.validation8004}; adrese in ${p}`);
}
main().catch((e) => { console.error(e); process.exit(1); });