@croptop/core-v6 0.0.31 → 0.0.32

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/README.md CHANGED
@@ -90,4 +90,6 @@ script/
90
90
  - fee routing depends on the designated fee project remaining correctly configured; if its terminal rejects payments,
91
91
  Croptop refunds the fee to `_msgSender()` instead of trapping ETH in `CTPublisher`
92
92
  - burn-lock ownership is intentionally irreversible and should only be used when immutability is desired
93
+ - after burn-locking into `CTProjectOwner`, the previous owner no longer holds the project NFT directly; control is
94
+ intentionally mediated through Croptop's owner helper and hook-admin surface instead of remaining a plain owner EOA
93
95
  - duplicate-content and stale-tier edge cases are guarded by tests, but integrations should still treat metadata reuse carefully
package/USER_JOURNEYS.md CHANGED
@@ -52,6 +52,17 @@
52
52
  2. Restrict future edits to the paths Croptop intentionally exposes.
53
53
  3. Accept that this is a product-shaping choice, not a cosmetic deployment detail.
54
54
 
55
+ ## Journey 5: Support Cross-Chain Payments Through Data Hooks
56
+
57
+ **Starting state:** a sucker pays the Croptop project on behalf of a remote user via `payRemote`, and `CTDeployer.beforePayRecordedWith` needs to forward the correct beneficiary to downstream hooks.
58
+
59
+ **Success:** downstream data hooks see the real remote user so any hook-specific accounting accrues to the right person.
60
+
61
+ **Flow**
62
+ 1. The sucker calls `terminal.pay()` with relay-beneficiary metadata.
63
+ 2. `CTDeployer.beforePayRecordedWith()` resolves the relay beneficiary when the payer is a registered sucker.
64
+ 3. The swapped beneficiary is forwarded to the downstream data hook.
65
+
55
66
  ## Hand-Offs
56
67
 
57
68
  - Use [nana-721-hook-v6](../nana-721-hook-v6/USER_JOURNEYS.md) for the underlying tier issuance behavior Croptop wraps.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croptop/core-v6",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,18 +16,18 @@
16
16
  "artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'croptop-core-v5'"
17
17
  },
18
18
  "dependencies": {
19
- "@bananapus/721-hook-v6": "^0.0.32",
20
- "@bananapus/buyback-hook-v6": "^0.0.26",
21
- "@bananapus/core-v6": "^0.0.32",
19
+ "@bananapus/721-hook-v6": "^0.0.33",
20
+ "@bananapus/buyback-hook-v6": "^0.0.27",
21
+ "@bananapus/core-v6": "^0.0.34",
22
22
  "@bananapus/ownable-v6": "^0.0.17",
23
- "@bananapus/permission-ids-v6": "^0.0.15",
23
+ "@bananapus/permission-ids-v6": "^0.0.17",
24
24
  "@bananapus/router-terminal-v6": "^0.0.26",
25
- "@bananapus/suckers-v6": "^0.0.22",
25
+ "@bananapus/suckers-v6": "^0.0.25",
26
26
  "@openzeppelin/contracts": "^5.6.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@bananapus/address-registry-v6": "^0.0.17",
30
- "@rev-net/core-v6": "^0.0.28",
30
+ "@rev-net/core-v6": "^0.0.30",
31
31
  "@sphinx-labs/plugins": "^0.33.3"
32
32
  }
33
- }
33
+ }
@@ -28,6 +28,7 @@ import {JBRulesetConfig} from "@bananapus/core-v6/src/structs/JBRulesetConfig.so
28
28
  import {JBOwnable} from "@bananapus/ownable-v6/src/JBOwnable.sol";
29
29
  import {JBPermissionIds} from "@bananapus/permission-ids-v6/src/JBPermissionIds.sol";
30
30
  import {IJBSuckerRegistry} from "@bananapus/suckers-v6/src/interfaces/IJBSuckerRegistry.sol";
31
+ import {JBRelayBeneficiary} from "@bananapus/suckers-v6/src/libraries/JBRelayBeneficiary.sol";
31
32
 
32
33
  import {ICTDeployer} from "./interfaces/ICTDeployer.sol";
33
34
  import {ICTPublisher} from "./interfaces/ICTPublisher.sol";
@@ -172,6 +173,24 @@ contract CTDeployer is ERC2771Context, JBPermissioned, IJBRulesetDataHook, IERC7
172
173
  if (address(hook) == address(0)) {
173
174
  return (context.weight, hookSpecifications);
174
175
  }
176
+
177
+ // Resolve the relay beneficiary — if the payer is a sucker with relay metadata,
178
+ // swap the beneficiary so downstream hooks see the real user.
179
+ address effectiveBeneficiary = JBRelayBeneficiary.resolve({
180
+ payer: context.payer,
181
+ beneficiary: context.beneficiary,
182
+ projectId: context.projectId,
183
+ metadata: context.metadata,
184
+ registry: SUCKER_REGISTRY
185
+ });
186
+
187
+ // If the beneficiary was swapped, create a memory copy with the new beneficiary.
188
+ if (effectiveBeneficiary != context.beneficiary) {
189
+ JBBeforePayRecordedContext memory hookContext = context;
190
+ hookContext.beneficiary = effectiveBeneficiary;
191
+ return hook.beforePayRecordedWith(hookContext);
192
+ }
193
+
175
194
  // slither-disable-next-line unused-return
176
195
  return hook.beforePayRecordedWith(context);
177
196
  }