Skip to main content

CTDeployer

Git Source

Inherits: ERC2771Context, IERC721Receiver, ICTDeployer

A contract that facilitates deploying a simple Juicebox project to receive posts from Croptop templates.

State Variables​

CONTROLLER​

The controller that projects are made from.

IJBController public immutable override CONTROLLER;

DEPLOYER​

The deployer to launch Croptop recorded collections from.

IJB721TiersHookProjectDeployer public immutable override DEPLOYER;

PUBLISHER​

The Croptop publisher.

ICTPublisher public immutable override PUBLISHER;

Functions​

constructor​

constructor(
IJBController controller,
IJB721TiersHookProjectDeployer deployer,
ICTPublisher publisher,
address trusted_forwarder
)
ERC2771Context(trusted_forwarder);

Parameters

NameTypeDescription
controllerIJBControllerThe controller that projects are made from.
deployerIJB721TiersHookProjectDeployerThe deployer to launch Croptop projects from.
publisherICTPublisherThe croptop publisher.
trusted_forwarderaddress

onERC721Received​

Make sure only mints can be received.

function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
)
external
view
returns (bytes4);

deployProjectFor​

Deploy a simple project meant to receive posts from Croptop templates.

function deployProjectFor(
address owner,
JBTerminalConfig[] memory terminalConfigurations,
string memory projectUri,
CTDeployerAllowedPost[] memory allowedPosts,
string memory contractUri,
string memory name,
string memory symbol,
bytes32 salt
)
external
returns (uint256 projectId, IJB721TiersHook hook);

Parameters

NameTypeDescription
owneraddressThe address that'll own the project.
terminalConfigurationsJBTerminalConfig[]The terminals that the network uses to accept payments through.
projectUristringThe metadata URI containing project info.
allowedPostsCTDeployerAllowedPost[]The type of posts that the project should allow.
contractUristringA link to the collection's metadata.
namestringThe name of the collection where posts will go.
symbolstringThe symbol of the collection where posts will go.
saltbytes32A salt to use for the deterministic deployment.

Returns

NameTypeDescription
projectIduint256The ID of the newly created project.
hookIJB721TiersHookThe hook that was created.

_configurePostingCriteriaFor​

Configure croptop posting.

function _configurePostingCriteriaFor(address hook, CTDeployerAllowedPost[] memory allowedPosts) internal;

Parameters

NameTypeDescription
hookaddressThe hook that will be posted to.
allowedPostsCTDeployerAllowedPost[]The type of posts that should be allowed.