@bananapus/omnichain-deployers-v6 0.0.55 → 0.0.57

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.55",
3
+ "version": "0.0.57",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,16 +24,16 @@
24
24
  "artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'nana-omnichain-deployers-v6'"
25
25
  },
26
26
  "dependencies": {
27
- "@bananapus/721-hook-v6": "^0.0.59",
28
- "@bananapus/core-v6": "^0.0.72",
29
- "@bananapus/ownable-v6": "^0.0.32",
30
- "@bananapus/permission-ids-v6": "^0.0.27",
31
- "@bananapus/suckers-v6": "^0.0.60",
27
+ "@bananapus/721-hook-v6": "^0.0.65",
28
+ "@bananapus/core-v6": "^0.0.78",
29
+ "@bananapus/ownable-v6": "^0.0.34",
30
+ "@bananapus/permission-ids-v6": "^0.0.28",
31
+ "@bananapus/suckers-v6": "^0.0.69",
32
32
  "@openzeppelin/contracts": "5.6.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@bananapus/address-registry-v6": "^0.0.29",
36
- "@bananapus/buyback-hook-v6": "^0.0.64",
35
+ "@bananapus/address-registry-v6": "^0.0.32",
36
+ "@bananapus/buyback-hook-v6": "^0.0.66",
37
37
  "@sphinx-labs/plugins": "0.33.3",
38
38
  "@uniswap/v4-core": "1.0.2"
39
39
  }
@@ -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 {JBSourceContext} from "@bananapus/suckers-v6/src/structs/JBSourceContext.sol";
25
26
  import {ERC2771Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
26
27
  import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
27
28
  import {Context} from "@openzeppelin/contracts/utils/Context.sol";
@@ -434,7 +435,7 @@ contract JBOmnichainDeployer is
434
435
  // If the ruleset aggregates cross-chain state, add remote supply and surplus.
435
436
  if (!context.scopeCashOutsToLocalBalances) {
436
437
  totalSupply += SUCKER_REGISTRY.remoteTotalSupplyOf(context.projectId);
437
- effectiveSurplusValue += SUCKER_REGISTRY.remoteSurplusOf({
438
+ effectiveSurplusValue += SUCKER_REGISTRY.totalRemoteSurplusOf({
438
439
  projectId: context.projectId,
439
440
  decimals: context.surplus.decimals,
440
441
  currency: uint256(context.surplus.currency)
@@ -682,44 +683,38 @@ contract JBOmnichainDeployer is
682
683
  }
683
684
 
684
685
  /// @notice Forwards peer-chain adjusted accounts from the stored extra data hook. Suckers call this on the active
685
- /// data hook (which is this deployer after wrapping) to learn about additional supply/surplus/balance that should
686
- /// be included in cross-chain snapshots. Without forwarding, the extra hook's peer-chain adjustments are silently
687
- /// masked, causing the bonding curve to use only local values and over-reclaiming on peer chains.
686
+ /// data hook (which is this deployer after wrapping) to learn about additional supply and per-context surplus and
687
+ /// balance that should be included in cross-chain snapshots. Without forwarding, the extra hook's peer-chain
688
+ /// adjustments are silently masked, causing the bonding curve to use only local values and over-reclaiming on peer
689
+ /// chains.
688
690
  /// @dev Part of `IJBPeerChainAdjustedAccounts`. Uses staticcall to safely handle extra hooks that do not implement
689
691
  /// this interface.
690
692
  /// @param projectId The ID of the project to snapshot.
691
- /// @param decimals The decimals the returned surplus and balance should use.
692
- /// @param currency The currency the returned surplus and balance should be in terms of.
693
693
  /// @return supply The extra supply to include in `sourceTotalSupply`.
694
- /// @return surplus The extra surplus to include in `sourceSurplus`.
695
- /// @return balance The extra balance to include in `sourceBalance`.
696
- function peerChainAdjustedAccountsOf(
697
- uint256 projectId,
698
- uint256 decimals,
699
- uint256 currency
700
- )
694
+ /// @return contexts The extra per-context surplus and balance to include in the snapshot, un-valued.
695
+ function peerChainAdjustedAccountsOf(uint256 projectId)
701
696
  external
702
697
  view
703
698
  override
704
- returns (uint256 supply, uint256 surplus, uint256 balance)
699
+ returns (uint256 supply, JBSourceContext[] memory contexts)
705
700
  {
706
701
  // Get the current ruleset from the canonical controller to look up the stored extra hook.
707
702
  (JBRuleset memory ruleset,) = CONTROLLER.currentRulesetOf(projectId);
708
703
 
709
704
  // Look up the extra data hook for this project's current ruleset.
710
705
  JBDeployerHookConfig memory extraHook = _extraDataHookOf[projectId][ruleset.id];
711
- if (address(extraHook.dataHook) == address(0)) return (0, 0, 0);
706
+ if (address(extraHook.dataHook) == address(0)) return (0, new JBSourceContext[](0));
712
707
 
713
708
  // Forward via staticcall — the extra hook may or may not implement IJBPeerChainAdjustedAccounts.
714
709
  (bool success, bytes memory data) = address(extraHook.dataHook)
715
- .staticcall(
716
- abi.encodeCall(
717
- IJBPeerChainAdjustedAccounts.peerChainAdjustedAccountsOf, (projectId, decimals, currency)
718
- )
719
- );
720
- if (!success || data.length < 96) return (0, 0, 0);
721
-
722
- return abi.decode(data, (uint256, uint256, uint256));
710
+ .staticcall(abi.encodeCall(IJBPeerChainAdjustedAccounts.peerChainAdjustedAccountsOf, (projectId)));
711
+
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));
716
+
717
+ return abi.decode(data, (uint256, JBSourceContext[]));
723
718
  }
724
719
 
725
720
  //*********************************************************************//