@bananapus/omnichain-deployers-v6 0.0.61 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/omnichain-deployers-v6",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "@bananapus/core-v6": "^0.0.86",
29
29
  "@bananapus/ownable-v6": "^0.0.39",
30
30
  "@bananapus/permission-ids-v6": "^0.0.31",
31
- "@bananapus/suckers-v6": "^0.0.73",
31
+ "@bananapus/suckers-v6": "^0.0.76",
32
32
  "@openzeppelin/contracts": "5.6.1"
33
33
  },
34
34
  "devDependencies": {
@@ -11,11 +11,14 @@
11
11
  3. On pay, it calls the 721 hook first, then the optional extra hook with the adjusted amount context.
12
12
  4. On cash out, it can short-circuit for suckers, otherwise it forwards into the configured hook stack in order.
13
13
  5. Mint permission queries can be granted by suckers or by the configured extra hook.
14
+ 6. Peer-chain adjusted account queries forward to the configured extra hook, but missing or malformed returns are
15
+ treated as no contribution.
14
16
 
15
17
  ## High-risk areas
16
18
 
17
19
  - Ruleset ID prediction: if the predicted ID is wrong, hook config can be stored under the wrong key.
18
20
  - Hook composition order: 721 logic runs before any extra hook, which affects both specs and accounting.
21
+ - Hook metadata decoding: split-credit metadata must satisfy the full ABI tuple minimum before it is decoded.
19
22
  - Sucker exemptions: early-return cash-out behavior is intentional and should not be removed casually.
20
23
  - Carry-forward logic: queueing rulesets without new tiers intentionally reuses the latest 721 hook.
21
24
  - Meta-transaction sender handling: salt derivation uses `_msgSender()`, not raw `msg.sender`.
@@ -22,6 +22,7 @@ import {JBOwnable} from "@bananapus/ownable-v6/src/JBOwnable.sol";
22
22
  import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
23
23
  import {IJBPeerChainAdjustedAccounts} from "@bananapus/suckers-v6/src/interfaces/IJBPeerChainAdjustedAccounts.sol";
24
24
  import {IJBSuckerRegistry} from "@bananapus/suckers-v6/src/interfaces/IJBSuckerRegistry.sol";
25
+ import {JBPeerChainAdjustedAccountsLib} from "@bananapus/suckers-v6/src/libraries/JBPeerChainAdjustedAccountsLib.sol";
25
26
  import {JBSourceContext} from "@bananapus/suckers-v6/src/structs/JBSourceContext.sol";
26
27
  import {ERC2771Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
27
28
  import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
@@ -557,7 +558,8 @@ contract JBOmnichainDeployer is
557
558
  // When issueTokensForSplits is true and splits exist, this holds the weight portion
558
559
  // attributable to tier splits — used to prevent split credit erasure if the extra
559
560
  // hook (e.g. buyback) returns weight=0.
560
- if (tiered721HookSpec.metadata.length >= 128) {
561
+ // The tuple's minimum ABI encoding is 160 bytes: 4 head words plus an empty `bytes` tail.
562
+ if (tiered721HookSpec.metadata.length >= 160) {
561
563
  (,,, splitCreditWeight) = abi.decode(tiered721HookSpec.metadata, (address, address, bytes, uint256));
562
564
  }
563
565
  }
@@ -709,12 +711,9 @@ contract JBOmnichainDeployer is
709
711
  (bool success, bytes memory data) = address(extraHook.dataHook)
710
712
  .staticcall(abi.encodeCall(IJBPeerChainAdjustedAccounts.peerChainAdjustedAccountsOf, (projectId)));
711
713
 
712
- // A well-formed `(uint256, JBSourceContext[])` return is at least three words: the supply, the array offset,
713
- // and the array length. Anything shorter (an empty return, a hook with no code, or a mismatched ABI) is
714
- // treated as no contribution rather than letting the decode revert.
715
- if (!success || data.length < 96) return (0, new JBSourceContext[](0));
714
+ if (!success) return (0, new JBSourceContext[](0));
716
715
 
717
- return abi.decode(data, (uint256, JBSourceContext[]));
716
+ return JBPeerChainAdjustedAccountsLib.decode(data);
718
717
  }
719
718
 
720
719
  //*********************************************************************//