跳到主要内容

JBOmnichainDeployer

Git Source

Inherits: ERC2771Context, JBPermissioned

JBOmnichainDeployer deploys, manages, and operates Juicebox projects with suckers.

State Variables

CONTROLLER

The controller used to create and manage Juicebox projects.

IJBController public immutable CONTROLLER;

PROJECTS

Mints ERC-721s that represent Juicebox project ownership and transfers.

IJBProjects public immutable PROJECTS;

HOOK_PROJECT_DEPLOYER

Deploys tiered ERC-721 hooks for projects.

IJB721TiersHookProjectDeployer public immutable HOOK_PROJECT_DEPLOYER;

SUCKER_REGISTRY

Deploys and tracks suckers for projects.

IJBSuckerRegistry public immutable SUCKER_REGISTRY;

Functions

constructor

constructor(
IJBController controller,
IJBSuckerRegistry suckerRegistry,
IJB721TiersHookProjectDeployer hookProjectDeployer,
address trustedForwarder
)
JBPermissioned(IJBPermissioned(address(controller)).PERMISSIONS())
ERC2771Context(trustedForwarder);

Parameters

NameTypeDescription
controllerIJBControllerThe controller to use for launching and operating the Juicebox projects.
suckerRegistryIJBSuckerRegistryThe registry to use for deploying and tracking each project's suckers.
hookProjectDeployerIJB721TiersHookProjectDeployerThe deployer to use for project's tiered ERC-721 hooks.
trustedForwarderaddressThe trusted forwarder for the ERC2771Context.

deploySuckersFor

Deploy new suckers for an existing project.

Only the juicebox's owner can deploy new suckers.

function deploySuckersFor(
uint256 projectId,
REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
)
external
returns (address[] memory suckers);

Parameters

NameTypeDescription
projectIduint256The ID of the project to deploy suckers for.
suckerDeploymentConfigurationREVSuckerDeploymentConfigThe suckers to set up for the project.

launchProjectFor

Creates a project with suckers.

This will mint the project's ERC-721 to the owner's address, queue the specified rulesets, and set up the specified splits and terminals. Each operation within this transaction can be done in sequence separately.

Anyone can deploy a project to any owner's address.

function launchProjectFor(
address owner,
string calldata projectUri,
JBRulesetConfig[] calldata rulesetConfigurations,
JBTerminalConfig[] calldata terminalConfigurations,
string calldata memo,
REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
)
external
returns (uint256 projectId, address[] memory suckers);

Parameters

NameTypeDescription
owneraddressThe project's owner. The project ERC-721 will be minted to this address.
projectUristringThe project's metadata URI. This is typically an IPFS hash, optionally with the ipfs:// prefix. This can be updated by the project's owner.
rulesetConfigurationsJBRulesetConfig[]The rulesets to queue.
terminalConfigurationsJBTerminalConfig[]The terminals to set up for the project.
memostringA memo to pass along to the emitted event.
suckerDeploymentConfigurationREVSuckerDeploymentConfigThe suckers to set up for the project. Suckers facilitate cross-chain token transfers between peer projects on different networks.

Returns

NameTypeDescription
projectIduint256The project's ID.
suckersaddress[]

launch721ProjectFor

Launches a new project with a 721 tiers hook attached, and with suckers.

function launch721ProjectFor(
address owner,
JBDeploy721TiersHookConfig calldata deployTiersHookConfig,
JBLaunchProjectConfig calldata launchProjectConfig,
bytes32 salt,
REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
)
external
returns (uint256 projectId, IJB721TiersHook hook, address[] memory suckers);

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.
saltbytes32A salt to use for the deterministic deployment.
suckerDeploymentConfigurationREVSuckerDeploymentConfig

Returns

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

_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);