@bananapus/suckers-v6 0.0.52 → 0.0.54

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/suckers-v6",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@arbitrum/nitro-contracts": "3.2.0",
29
- "@bananapus/core-v6": "^0.0.59",
30
- "@bananapus/permission-ids-v6": "^0.0.26",
29
+ "@bananapus/core-v6": "^0.0.60",
30
+ "@bananapus/permission-ids-v6": "^0.0.27",
31
31
  "@chainlink/contracts-ccip": "1.6.4",
32
32
  "@chainlink/local": "0.2.7",
33
33
  "@openzeppelin/contracts": "5.6.1",
@@ -500,8 +500,13 @@ contract JBSuckerRegistry is ERC2771Context, Ownable, JBPermissioned, IJBSuckerR
500
500
  override
501
501
  returns (address[] memory suckers)
502
502
  {
503
+ // Cache the project owner so deployment and explicit-peer authorization are both checked against the same
504
+ // project authority, not a delegated operator.
505
+ address projectOwner = PROJECTS.ownerOf(projectId);
506
+
507
+ // `DEPLOY_SUCKERS` authorizes creating suckers and applying their launch-time token mappings.
503
508
  _requirePermissionFrom({
504
- account: PROJECTS.ownerOf(projectId), projectId: projectId, permissionId: JBPermissionIds.DEPLOY_SUCKERS
509
+ account: projectOwner, projectId: projectId, permissionId: JBPermissionIds.DEPLOY_SUCKERS
505
510
  });
506
511
 
507
512
  // Create an array to store the suckers as they are deployed.
@@ -516,16 +521,9 @@ contract JBSuckerRegistry is ERC2771Context, Ownable, JBPermissioned, IJBSuckerR
516
521
  // default peer symmetry assumption will not hold.
517
522
  salt = keccak256(abi.encode(sender, salt));
518
523
 
519
- // Cache the project owner so the explicit-peer gate can check against the original authority, not a
520
- // delegated operator. The default same-address peering invariant (peer == 0 or peer == address(this))
521
- // does not need this stronger gate, but a non-symmetric explicit peer authorizes that arbitrary address
522
- // to deliver outbox roots and mint project tokens — so it must require a permission strictly broader
523
- // than ops automation's `DEPLOY_SUCKERS`.
524
- address projectOwner = PROJECTS.ownerOf(projectId);
525
-
526
524
  // Iterate through the configurations and deploy the suckers.
527
525
  for (uint256 i; i < configurations.length;) {
528
- // Get the configuration being iterated over.
526
+ // Copy the configuration once because its deployer, peer, mappings, and event payload are all reused below.
529
527
  JBSuckerDeployerConfig memory configuration = configurations[i];
530
528
 
531
529
  // Make sure the deployer is allowed.
@@ -533,13 +531,11 @@ contract JBSuckerRegistry is ERC2771Context, Ownable, JBPermissioned, IJBSuckerR
533
531
  revert JBSuckerRegistry_InvalidDeployer({deployer: configuration.deployer});
534
532
  }
535
533
 
536
- // If the configuration specifies a non-symmetric explicit peer, require the additional
537
- // `SET_SUCKER_PEER` permission. Default peering (peer == 0 or peer == bytes32 of address(this)) is
538
- // unaffected. Without this gate, a delegated operator with only `DEPLOY_SUCKERS` could register an
539
- // attacker peer and use the resulting sucker's mint authority to deliver fabricated outbox roots.
540
- // forge-lint: disable-next-line(unsafe-typecast)
541
- bytes32 selfPeer = bytes32(uint256(uint160(address(this))));
542
- if (configuration.peer != bytes32(0) && configuration.peer != selfPeer) {
534
+ // `peer == 0` tells the sucker to use its own clone address as the deterministic same-address peer, so the
535
+ // deploy permission is enough for that default path.
536
+ // Every nonzero value is an explicit remote authority, including this registry's address.
537
+ if (configuration.peer != bytes32(0)) {
538
+ // Only a caller with `SET_SUCKER_PEER` may choose that explicit remote authority.
543
539
  _requirePermissionFrom({
544
540
  account: projectOwner, projectId: projectId, permissionId: JBPermissionIds.SET_SUCKER_PEER
545
541
  });