mirror of
https://github.com/luxfi/fhe.git
synced 2026-07-26 23:16:08 +00:00
- data-seal: Verifiable Data Integrity Seal (PIP-0010/LP-0535) FHE-encrypted tamper-proof sealing with Public/ZK/Private modes, batch sealing, homomorphic verification - content-provenance: AI & Media Content Provenance (PIP-0011/LP-7110) Model manifests, output attestation via homomorphic comparison, media derivation DAGs - encrypted-crdt: Encrypted CRDT (PIP-0013/LP-6500) LWW-Register with FHE values, OR-Set with tag-based add/remove, Lamport timestamp conflict resolution, deterministic merge - shadow-governance: Shadow Government Protocol (PIP-7010) Anonymous ministries, encrypted voting with homomorphic tallying, nullifier-based anti-fraud, quorum enforcement Each example includes Solidity contracts, Hardhat tests, CLI tasks, and README linking to corresponding PIP and LP specifications.
21 lines
933 B
TypeScript
21 lines
933 B
TypeScript
import { task } from "hardhat/config";
|
|
|
|
task("task:propose", "Create a governance proposal")
|
|
.addParam("contract", "ShadowGovernance contract address")
|
|
.addParam("content", "Proposal content text")
|
|
.addParam("ministry", "Ministry ID (hex)")
|
|
.addOptionalParam("blocks", "Voting period in blocks", "100")
|
|
.setAction(async ({ contract, content, ministry, blocks }, hre) => {
|
|
const [signer] = await hre.ethers.getSigners();
|
|
const gov = await hre.ethers.getContractAt("ShadowGovernance", contract);
|
|
|
|
const contentHash = hre.ethers.keccak256(hre.ethers.toUtf8Bytes(content));
|
|
const tx = await gov.connect(signer).createProposal(contentHash, ministry, parseInt(blocks));
|
|
await tx.wait();
|
|
|
|
const count = await gov.proposalCount();
|
|
console.log(`Proposal created. ID: ${(count - 1n).toString()}`);
|
|
console.log(`Content hash: ${contentHash}`);
|
|
console.log(`Voting period: ${blocks} blocks`);
|
|
});
|