跳到主要内容

JBSuckerDeployer

Git Source

Inherits: ERC2771Context, JBPermissioned, IJBSuckerDeployer

A base implementation for deploying suckers.

State Variables

DIRECTORY

The directory of terminals and controllers for projects.

IJBDirectory public immutable override DIRECTORY;

LAYER_SPECIFIC_CONFIGURATOR

Only this address can configure this deployer, can only be used once.

address public immutable override LAYER_SPECIFIC_CONFIGURATOR;

TOKENS

The contract that manages token minting and burning.

IJBTokens public immutable override TOKENS;

isSucker

A mapping of suckers deployed by this contract.

mapping(address => bool) public override isSucker;

singleton

The singleton used to clone suckers.

JBSucker public singleton;

Functions

constructor

constructor(
IJBDirectory directory,
IJBPermissions permissions,
IJBTokens tokens,
address configurator,
address trusted_forwarder
)
ERC2771Context(trusted_forwarder)
JBPermissioned(permissions);

Parameters

NameTypeDescription
directoryIJBDirectoryThe directory of terminals and controllers for projects.
permissionsIJBPermissionsThe permissions contract for the deployer.
tokensIJBTokensThe contract that manages token minting and burning.
configuratoraddressThe address of the configurator.
trusted_forwarderaddress

_layerSpecificConfigurationIsSet

Check if the layer specific configuration is set or not. Used as a sanity check.

function _layerSpecificConfigurationIsSet() internal view virtual returns (bool);

_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.

_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.

_contextSuffixLength

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

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

configureSingleton

Configure the singleton instance that is used to clone suckers.

Can only be called once by the layer specific configurator.

function configureSingleton(JBSucker _singleton) external;

Parameters

NameTypeDescription
_singletonJBSuckerThe address of the singleton.

createForSender

Create a new JBSucker for a specific project.

Uses the sender address as the salt, which means the same sender must call this function on both chains.

function createForSender(
uint256 localProjectId,
bytes32 salt
)
external
override(IJBSuckerDeployer)
returns (IJBSucker sucker);

Parameters

NameTypeDescription
localProjectIduint256The project's ID on the local chain.
saltbytes32The salt to use for the create2 address.

Returns

NameTypeDescription
suckerIJBSuckerThe address of the new sucker.