跳到主要内容

JB721TiersHookProjectDeployer

Git Source

Inherits: ERC2771Context, JBPermissioned, IJB721TiersHookProjectDeployer

Deploys a project and a 721 tiers hook for it. Can be used to queue rulesets for the project if given JBPermissionIds.QUEUE_RULESETS.

State Variables

DIRECTORY

The directory of terminals and controllers for projects.

IJBDirectory public immutable override DIRECTORY;

HOOK_DEPLOYER

The 721 tiers hook deployer.

IJB721TiersHookDeployer public immutable override HOOK_DEPLOYER;

Functions

constructor

constructor(
IJBDirectory directory,
IJBPermissions permissions,
IJB721TiersHookDeployer hookDeployer,
address trustedForwarder
)
JBPermissioned(permissions)
ERC2771Context(trustedForwarder);

Parameters

NameTypeDescription
directoryIJBDirectoryThe directory of terminals and controllers for projects.
permissionsIJBPermissionsA contract storing permissions.
hookDeployerIJB721TiersHookDeployerThe 721 tiers hook deployer.
trustedForwarderaddressThe trusted forwarder for the ERC2771Context.

launchProjectFor

Launches a new project with a 721 tiers hook attached.

function launchProjectFor(
address owner,
JBDeploy721TiersHookConfig calldata deployTiersHookConfig,
JBLaunchProjectConfig calldata launchProjectConfig,
IJBController controller,
bytes32 salt
)
external
override
returns (uint256 projectId, IJB721TiersHook hook);

Parameters

NameTypeDescription
owneraddressThe address to set as the owner of the project. The ERC-721 which confers this project's ownership will be sent to this address.
deployTiersHookConfigJBDeploy721TiersHookConfigConfiguration which dictates the behavior of the 721 tiers hook which is being deployed.
launchProjectConfigJBLaunchProjectConfigConfiguration which dictates the behavior of the project which is being launched.
controllerIJBControllerThe controller that the project's rulesets will be queued with.
saltbytes32A salt to use for the deterministic deployment.

Returns

NameTypeDescription
projectIduint256The ID of the newly launched project.
hookIJB721TiersHookThe 721 tiers hook that was deployed for the project.

launchRulesetsFor

Launches rulesets for a project with an attached 721 tiers hook.

Only a project's owner or an operator with the QUEUE_RULESETS & SET_TERMINALS permission can launch its rulesets.

function launchRulesetsFor(
uint256 projectId,
JBDeploy721TiersHookConfig calldata deployTiersHookConfig,
JBLaunchRulesetsConfig calldata launchRulesetsConfig,
IJBController controller,
bytes32 salt
)
external
override
returns (uint256 rulesetId, IJB721TiersHook hook);

Parameters

NameTypeDescription
projectIduint256The ID of the project that rulesets are being launched for.
deployTiersHookConfigJBDeploy721TiersHookConfigConfiguration which dictates the behavior of the 721 tiers hook which is being deployed.
launchRulesetsConfigJBLaunchRulesetsConfigConfiguration which dictates the project's new rulesets.
controllerIJBControllerThe controller that the project's rulesets will be queued with.
saltbytes32A salt to use for the deterministic deployment.

Returns

NameTypeDescription
rulesetIduint256The ID of the successfully created ruleset.
hookIJB721TiersHookThe 721 tiers hook that was deployed for the project.

queueRulesetsOf

Queues rulesets for a project with an attached 721 tiers hook.

Only a project's owner or an operator with the QUEUE_RULESETS permission can queue its rulesets.

function queueRulesetsOf(
uint256 projectId,
JBDeploy721TiersHookConfig calldata deployTiersHookConfig,
JBQueueRulesetsConfig calldata queueRulesetsConfig,
IJBController controller,
bytes32 salt
)
external
override
returns (uint256 rulesetId, IJB721TiersHook hook);

Parameters

NameTypeDescription
projectIduint256The ID of the project that rulesets are being queued for.
deployTiersHookConfigJBDeploy721TiersHookConfigConfiguration which dictates the behavior of the 721 tiers hook which is being deployed.
queueRulesetsConfigJBQueueRulesetsConfigConfiguration which dictates the project's newly queued rulesets.
controllerIJBControllerThe controller that the project's rulesets will be queued with.
saltbytes32A salt to use for the deterministic deployment.

Returns

NameTypeDescription
rulesetIduint256The ID of the successfully created ruleset.
hookIJB721TiersHookThe 721 tiers hook that was deployed for the project.

_launchProjectFor

Launches a project.

function _launchProjectFor(
address owner,
JBLaunchProjectConfig memory launchProjectConfig,
IJB721TiersHook dataHook,
IJBController controller
)
internal;

Parameters

NameTypeDescription
owneraddressThe address that will own the project.
launchProjectConfigJBLaunchProjectConfigConfiguration which dictates the behavior of the project which is being launched.
dataHookIJB721TiersHookThe data hook to use for the project.
controllerIJBControllerThe controller that the project's rulesets will be queued with.

_launchRulesetsFor

Launches rulesets for a project.

function _launchRulesetsFor(
uint256 projectId,
JBLaunchRulesetsConfig memory launchRulesetsConfig,
IJB721TiersHook dataHook,
IJBController controller
)
internal
returns (uint256);

Parameters

NameTypeDescription
projectIduint256The ID of the project to launch rulesets for.
launchRulesetsConfigJBLaunchRulesetsConfigConfiguration which dictates the behavior of the project's rulesets.
dataHookIJB721TiersHookThe data hook to use for the project.
controllerIJBControllerThe controller that the project's rulesets will be queued with.

Returns

NameTypeDescription
<none>uint256rulesetId The ID of the successfully created ruleset.

_queueRulesetsOf

Queues rulesets for a project.

function _queueRulesetsOf(
uint256 projectId,
JBQueueRulesetsConfig memory queueRulesetsConfig,
IJB721TiersHook dataHook,
IJBController controller
)
internal
returns (uint256);

Parameters

NameTypeDescription
projectIduint256The ID of the project to queue rulesets for.
queueRulesetsConfigJBQueueRulesetsConfigConfiguration which dictates the behavior of the project's rulesets.
dataHookIJB721TiersHookThe data hook to use for the project.
controllerIJBControllerThe controller that the project's rulesets will be queued with.

Returns

NameTypeDescription
<none>uint256The ID of the successfully created ruleset.

_msgData

The calldata. Preferred to use over msg.data.

function _msgData() internal view override(ERC2771Context, Context) returns (bytes calldata);

Returns

NameTypeDescription
<none>bytescalldata The msg.data of this call.

_msgSender

The message's sender. Preferred to use over msg.sender.

function _msgSender() internal view override(ERC2771Context, Context) returns (address sender);

Returns

NameTypeDescription
senderaddressThe address which sent this call.

_contextSuffixLength

ERC-2771 specifies the context as being a single address (20 bytes).

function _contextSuffixLength() internal view virtual override(ERC2771Context, Context) returns (uint256);