Build self-hosted upgradeable KGP reputation protocol #30
Merged
wasabi opened 1 week ago

Implements the self-hosted Kokonut Guild protocol on Gnosis/Chiado, with PostgreSQL as the canonical governed ledger. The upgradeable KGP implementation is the non-transferable, domain-scoped reputation projection; the operational Guild layer is hardened against the initial security audit findings.

Implemented phases:

  • Define KGP protocol and security model.
  • Implement upgradeable KGP with automatic awards, EIP-712 claims, reversals, pause controls, standard ERC-1155 metadata events, and UUPS state-preservation tests.
  • Add Gnosis, Chiado, and Anvil deployment/upgrade scripts with temporary bootstrap custody, production role handoff, post-deployment assertions, and multisig resolver ownership.
  • Add canonical PostgreSQL KGP/Guild projections, append-only reputation protections, bounded reversal triggers, identity constraints, chain/deployment validation, and review event history.
  • Add Guild registry, domains, task board, evidence review/disputes, and selector-scoped lazy-consensus governance.
  • Add deterministic reputation services, human verification transition, precision checks, Moloch read-only integration, CLI support, multi-contract event decoding/projection, idempotency, confirmation cursors, and reorg rewind handling.
  • Add KokonutGuildUpgradeTimelock with separate proposer/executor roles, delayed UUPS execution, cancellation, production deployment enforcement, and queue/execute scripts.
  • Remediate audit findings: registered-Guild validation, execution-time governance permission checks, privileged deployer separation, signer-safe Foundry scripts, and explicit audit report.
  • Upgrade project contracts, scripts, and tests to Solidity 0.8.34.

Treasury remains with the existing Kokonut Moloch DAO. Guild contracts cannot move treasury funds, mint $vKKN, mint Loot, or treat KGP as treasury voting power.

Verification:

  • forge build --sizes with Solc 0.8.34: passed.
  • forge test --fuzz-runs 1000: 27 passed.
  • Python migration, KGP, and Guild service tests: 246 passed, 1 skipped.
  • git diff --check: passed.
  • Slither/Mythril/Aderyn/Echidna/Solhint: unavailable in the local environment.

No live deployment is included. Chiado deployment, external-contract fork validation, explorer verification, static analysis, invariant testing, and independent security review remain required release gates.

Commits were merged into target branch
1/1
Submitter wasabi
Target main
Source feat/kgp-protocol
Jobs
Merge Strategy
Create Merge Commit
Watchers (1)
Reference
pull request KI-30
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover