@bananapus/suckers-v6 0.0.53 → 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 +1 -1
- package/src/JBSuckerRegistry.sol +12 -16
package/package.json
CHANGED
package/src/JBSuckerRegistry.sol
CHANGED
|
@@ -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:
|
|
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
|
-
//
|
|
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
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
|
|
540
|
-
|
|
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
|
});
|