Skip to content

feat: initial protocol manager interface + CredibleSafeGuard integration - #95

Merged
makemake-kbo merged 5 commits into
masterfrom
makemake/eng-4072-faetstd-add-initial-protocol-manager-interface-to-std
Jul 27, 2026
Merged

feat: initial protocol manager interface + CredibleSafeGuard integration#95
makemake-kbo merged 5 commits into
masterfrom
makemake/eng-4072-faetstd-add-initial-protocol-manager-interface-to-std

Conversation

@makemake-kbo

Copy link
Copy Markdown
Contributor

What

Adds the initial protocol manager primitive to credible-std and wires it into CredibleSafeGuard.

A protected contract exposes initialProtocolManager() to declare the address allowed to manage its assertions in the Credible Layer. The state oracle reads it when the protocol is initialized, so deploying the contract is the ownership proof — no separate manual review/claim round.

Changes

New primitive (src/protection/initial_protocol_manager/)

  • IInitialProtocolManager — the read interface the state oracle calls.
  • InitialProtocolManager — abstract base fixing the manager immutably at deployment, with a zero-address guard.
  • README documenting the concept and the inherit-and-forward usage.

CredibleSafeGuard integration (src/protection/safe/CredibleSafeGuard.sol)

  • Now is ITransactionGuard, InitialProtocolManager; constructor takes the manager address and forwards it to the base.
  • Deploy script + example wiring read a new INITIAL_PROTOCOL_MANAGER env var.

Tests

  • InitialProtocolManager.t.sol — construction, fuzz over non-zero managers, and interface conformance (readable through the IInitialProtocolManager type).
  • CredibleSafeGuard.t.sol — asserts the getter, zero-manager revert, and interface conformance.
  • Updated example suites for the new constructor arg.

Verification

  • forge build: compiles (pre-existing lint notes only).
  • Safe guard suite: 31 passed. Initial-protocol-manager suite: 4 passed. Example safe-guard suites: 20 passed.

@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

ENG-4072

Comment thread src/protection/credible_block/IInitialProtocolManager.sol
Comment thread src/protection/safe/CredibleSafeGuard.sol
Comment thread examples/safe-guard/script/DeployCredibleSafeGuard.s.sol
Comment thread src/protection/safe/CredibleSafeGuard.sol Outdated
Comment thread examples/safe-guard/script/DeployCredibleSafeGuard.s.sol
…ct base

Expose the intended Credible Layer protocol manager on the protected
contract itself so the state oracle can set it without manual review.

- IInitialProtocolManager: read interface the state oracle calls
- InitialProtocolManager: abstract base fixing the manager immutably at
  deployment, with a zero-address guard
Inherit InitialProtocolManager so a deployed guard declares the address
allowed to manage its assertions in the Credible Layer. The state oracle
reads initialProtocolManager() during onboarding, so deploying the guard
is itself the ownership proof — no manual review round.

- CredibleSafeGuard constructor takes the manager address and forwards it
  to the base (non-zero enforced there)
- Deploy script + example wiring read INITIAL_PROTOCOL_MANAGER
- Add InitialProtocolManager base test (construction, fuzz, interface
  conformance) and a guard interface-conformance test
Dedicated guard-level coverage that the guard implements
IInitialProtocolManager correctly:
- returns the constructor value (fuzzed over registry/threshold/manager)
- stored independently of the registry and threshold immutables
- per-deployment, not shared state
- stable across calls
- readable through the IInitialProtocolManager interface type
@makemake-kbo
makemake-kbo force-pushed the makemake/eng-4072-faetstd-add-initial-protocol-manager-interface-to-std branch from 6c75625 to 39f0797 Compare July 27, 2026 10:00
@makemake-kbo
makemake-kbo marked this pull request as ready for review July 27, 2026 10:01
ENG-4072 specifies the public import as
credible-std/protection/credible_block/IInitialProtocolManager.sol and asks for
the usage example in that module's README. Relocate the interface, the abstract
base, and their test into protection/credible_block, and fold the docs into the
existing credible_block README instead of a separate module README.
@makemake-kbo
makemake-kbo merged commit 5f258a2 into master Jul 27, 2026
10 checks passed
@makemake-kbo
makemake-kbo deleted the makemake/eng-4072-faetstd-add-initial-protocol-manager-interface-to-std branch July 27, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants