Fix SEL_FUND selector mismatch and getJob abi.decode in BaseACPHook#3
Open
PRXVT wants to merge 1 commit intoerc-8183:mainfrom
Open
Fix SEL_FUND selector mismatch and getJob abi.decode in BaseACPHook#3PRXVT wants to merge 1 commit intoerc-8183:mainfrom
PRXVT wants to merge 1 commit intoerc-8183:mainfrom
Conversation
|
we have removed baseACPHook, closing this issue ya |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bugs in the hook helper layer that prevent
_preFund/_postFundfrom ever firing and causegetJob()staticcalls from hooks to revert.
Bug 1 — SEL_FUND selector mismatch (
BaseACPHook.sol)SEL_FUNDusesfund(uint256,bytes)(2 params) butAgenticCommerceHooked.fund()has signaturefund(uint256,uint256,bytes)(3 params). The selectors don't match (0xe25ba707vs0xd2e13f50), so the routernever routes to
_preFund/_postFund. This breaks FundTransferHook's capital transfer and BiddingHook's budgetvalidation during fund.
Bug 2 — Flat-tuple abi.decode of getJob() return (
BaseACPHook.sol,BiddingHook.sol,FundTransferHook.sol)getJob()returnsJob memorywhich contains astringfield, making it a dynamic tuple. The ABI encoding wraps itwith a 32-byte offset prefix. The existing flat-tuple decode reads that offset as the
idfield, shifts allsubsequent fields, and reverts when the
hookaddress is misinterpreted as a string data pointer.Fixed by defining a matching
ACPJobstruct and usingabi.decode(data, (ACPJob))which correctly handles theoffset.
Changes
BaseACPHook.sol: FixSEL_FUNDtofund(uint256,uint256,bytes), addACPJobstruct, fix_getJobClientdecodeBiddingHook.sol: Fix_getJobBudgetdecodeFundTransferHook.sol: Fix_getJobProviderAndStatusdecodeWhat's NOT changed
AgenticCommerceHooked.sol— untouchedIACPHook.sol— untouchedTesting
36 integration tests passing including full BiddingHook lifecycle, FundTransferHook two-phase transfer with rejection,
and multi-hook coexistence on the same AgenticCommerceHooked instance.