Skip to content

feat: add MultiHookRouter for composable per-job hooks#21

Open
ariessa wants to merge 1 commit intoerc-8183:mainfrom
ariessa:feat/multi-hook-router
Open

feat: add MultiHookRouter for composable per-job hooks#21
ariessa wants to merge 1 commit intoerc-8183:mainfrom
ariessa:feat/multi-hook-router

Conversation

@ariessa
Copy link
Copy Markdown
Contributor

@ariessa ariessa commented Mar 29, 2026

Problem

Each ERC-8183 job can only attach one hook. Jobs needing multiple concerns (escrow, privacy, reputation) must cram everything into a single monolithic contract — hard to build, hard to audit, impossible to reuse.

Additionally, BaseACPHook's setBudget selector still used the old 3-param signature setBudget(uint256,uint256,bytes) while AgenticCommerce expects setBudget(uint256,address,uint256,bytes). This meant _preSetBudget and _postSetBudget callbacks silently never fired.

Solution

  • Add MultiHookRouter — implements IACPHook, fans out beforeAction/afterAction to an ordered list of sub-hooks per job. No core contract changes needed.
  • Fix BaseACPHook setBudget selector, abi.decode, and virtual signatures to include the token parameter
  • Update FundTransferHook and BiddingHook _preSetBudget overrides to match
  • Update acp submodule to latest (evaluation grace period, expired open jobs)
  • Add documentation with overview and flow diagrams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant