@bananapus/omnichain-deployers-v6 1.0.0 → 1.0.1

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": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@bananapus/721-hook-v6": "^1.0.0",
28
- "@bananapus/core-v6": "^1.0.0",
28
+ "@bananapus/core-v6": "^1.0.2",
29
29
  "@bananapus/ownable-v6": "^1.0.0",
30
30
  "@bananapus/permission-ids-v6": "^1.0.0",
31
31
  "@bananapus/suckers-v6": "^1.0.0",
@@ -7,9 +7,11 @@ import {JBApprovalStatus} from "@bananapus/core-v6/src/enums/JBApprovalStatus.so
7
7
  import {JBPermissioned} from "@bananapus/core-v6/src/abstract/JBPermissioned.sol";
8
8
  import {IJBController} from "@bananapus/core-v6/src/interfaces/IJBController.sol";
9
9
  import {IJBDirectory} from "@bananapus/core-v6/src/interfaces/IJBDirectory.sol";
10
+ import {IJBPayerTracker} from "@bananapus/core-v6/src/interfaces/IJBPayerTracker.sol";
10
11
  import {IJBPermissions} from "@bananapus/core-v6/src/interfaces/IJBPermissions.sol";
11
12
  import {IJBProjects} from "@bananapus/core-v6/src/interfaces/IJBProjects.sol";
12
13
  import {IJBRulesetDataHook} from "@bananapus/core-v6/src/interfaces/IJBRulesetDataHook.sol";
14
+ import {JBPayerTrackerLib} from "@bananapus/core-v6/src/libraries/JBPayerTrackerLib.sol";
13
15
  import {JBBeforeCashOutRecordedContext} from "@bananapus/core-v6/src/structs/JBBeforeCashOutRecordedContext.sol";
14
16
  import {JBBeforePayRecordedContext} from "@bananapus/core-v6/src/structs/JBBeforePayRecordedContext.sol";
15
17
  import {JBCashOutHookSpecification} from "@bananapus/core-v6/src/structs/JBCashOutHookSpecification.sol";
@@ -50,6 +52,7 @@ contract JBOmnichainDeployer is
50
52
  IJBOmnichainDeployer,
51
53
  IJBRulesetDataHook,
52
54
  IJBPeerChainAdjustedAccounts,
55
+ IJBPayerTracker,
53
56
  IERC721Receiver
54
57
  {
55
58
  //*********************************************************************//
@@ -97,6 +100,16 @@ contract JBOmnichainDeployer is
97
100
  /// @notice Deploys and tracks suckers for projects.
98
101
  IJBSuckerRegistry public immutable SUCKER_REGISTRY;
99
102
 
103
+ //*********************************************************************//
104
+ // ------------------- public transient properties ------------------- //
105
+ //*********************************************************************//
106
+
107
+ /// @notice The account that paid the creation fee for the project currently being launched.
108
+ /// @dev Set to the resolved fee payer (this contract's caller, or that caller's upstream payer when the caller is
109
+ /// itself an `IJBPayerTracker`) while `JBProjects.createFor` runs, so `JBProjects` attributes the fee to the true
110
+ /// payer instead of this deployer. Cleared back to `address(0)` once the call returns.
111
+ address public transient override originalPayer;
112
+
100
113
  //*********************************************************************//
101
114
  // -------------------- internal stored properties ------------------- //
102
115
  //*********************************************************************//
@@ -728,7 +741,8 @@ contract JBOmnichainDeployer is
728
741
  return interfaceId == type(IJBOmnichainDeployer).interfaceId
729
742
  || interfaceId == type(IJBRulesetDataHook).interfaceId
730
743
  || interfaceId == type(IJBPeerChainAdjustedAccounts).interfaceId
731
- || interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC165).interfaceId;
744
+ || interfaceId == type(IJBPayerTracker).interfaceId || interfaceId == type(IERC721Receiver).interfaceId
745
+ || interfaceId == type(IERC165).interfaceId;
732
746
  }
733
747
 
734
748
  //*********************************************************************//
@@ -775,7 +789,11 @@ contract JBOmnichainDeployer is
775
789
  returns (uint256 projectId, IJB721TiersHook hook, address[] memory suckers)
776
790
  {
777
791
  // Reserve the project ID up front so permissionless project creations cannot invalidate hook deployment.
792
+ // Expose the resolved fee payer so `JBProjects` attributes the creation fee to the true payer, not this
793
+ // deployer (the project's launch-time owner). Cleared immediately after.
794
+ originalPayer = JBPayerTrackerLib.resolve(_msgSender());
778
795
  projectId = PROJECTS.createFor{value: msg.value}(address(this));
796
+ originalPayer = address(0);
779
797
 
780
798
  // A fresh project can start without a controller, but it must not already be assigned elsewhere.
781
799
  _requireController({projectId: projectId, allowUnset: true});