feat(KI-14): SAFE execution flows — D1 SafeProposeClient + D2 attestation + D3 escrow + D4 farm ops #109
Commits were merged into target branch
-
2 weeks ago2 weeks ago2 weeks ago2 weeks ago
-
2 weeks ago
-
| Submitter | syntropicagent |
| Target | main |
| Source | feat/ki14-safe-execution |
Jobs
Merge Strategy
Create Merge Commit
KI-14 — SAFE Execution Flows (Phase D) — D1–D4
Iteration: v1.2 · Status: Draft — full Phase D scope implemented, one commit per workstream.
The security model (whole point of this work)
The server holds a delegate key that can only propose transactions via the SAFE Transaction Service API — it never signs as an owner, never executes. Humans confirm in the Safe app. Even a full delegate-key leak can only propose, never move funds.
ATTESTER_PRIVATE_KEYis now propose-only (risk lower than today's direct-signing, per Wasabi's direction).D1 —
SafeProposeClient(services/treasury/propose.py)0x776c65...). Domain separator usesabi.encode(address padded to 32 bytes), not encodePacked.propose()signs the safeTxHash with the delegate key (raw ECDSA viaunsafe_sign_hash, no EIP-191 prefix) and POSTs to the Transaction Service.register_delegate(),list_delegates(),build_tx().D2 — Attestation via SAFE (
services/attestation/safe_flow.py, Celo)propose_attestation(): builds the EASattest()call (EASClient.build_attest_callrefactor — encode-only, no send), wraps in a Safe tx, proposes to the Core Team SAFE on Celo.reconcile_attestation_executions(): polls the SAFE Transaction Service, marks requests executed once humans confirm.attestation_requestgainssafe_tx_hash,proposal_status,safe_chain.D3 — Escrow settlement via SAFE (
services/credit_class/safe_settlement.py, Gnosis)propose_settlement(): KokonutCreditToken transferFrom (seller→buyer + fee→treasury) proposed to the Core Team SAFE (2-of-3) — value moves now need human confirmation instead of raw DB updates.safe_settlement_tx_hash+settlement_status.D4 — Farm treasury ops (
services/treasury/ops.py)propose_farm_op(): agent proposes payroll/inputs/expenses on a deployed farm SAFE; address/chain resolve fromsafe_account(Phase C) or explicit.kokonut treasury ops-propose.Total: 17 new tests, all green (30 in treasury+attestation+settlement suite).
Chains (locked in KI-12 research)
Out of scope
Refs KI-14 · iteration v1.2