Skip to main content

createRollup

Type Aliases

CreateRollupFunctionParams<TChain>

type CreateRollupFunctionParams<TChain>: object;

This type is for the params of the createRollup function

Type parameters

Type parameter
TChain extends Chain | undefined

Type declaration

MemberType
accountPrivateKeyAccount
paramsCreateRollupParams
parentChainPublicClientPublicClient<Transport, TChain>

Source

src/createRollup.ts:76


CreateRollupResults

type CreateRollupResults: object;

Param

results of the createRollup function

Param

the transaction for deploying the core contracts

Param

the transaction receipt

Param

the core contracts

Type declaration

MemberType
coreContractsCoreContracts
transactionCreateRollupTransaction
transactionReceiptCreateRollupTransactionReceipt

Source

src/createRollup.ts:88

Functions

createRollup()

function createRollup<TChain>(createRollupFunctionParams: CreateRollupFunctionParams<TChain>): Promise<CreateRollupResults>

Performs the tx to deploy the chain's core contracts.

Before creating a custom gas token chain, it checks the custom gas token allowance granted to the rollup creator contract. Runs an approval tx for insufficient allowance.

Accepts rollup creation config, rollup owner, and the parent chain public client.

Returns the transaction, the transaction receipt, and the core contracts.

Type parameters

Type parameter
TChain extends undefined | Chain<undefined | ChainFormatters>

Parameters

ParameterTypeDescription
createRollupFunctionParamsCreateRollupFunctionParams<TChain>CreateRollupFunctionParams

Returns

Promise<CreateRollupResults>

Promise<CreateRollupResults> - the transaction, the transaction receipt, and the core contracts.

Example

const createRollupConfig = createRollupPrepareDeploymentParamsConfig(parentChainPublicClient, {
chainId: BigInt(chainId),
owner: deployer.address,
chainConfig: prepareChainConfig({
chainId,
arbitrum: {
InitialChainOwner: deployer.address,
DataAvailabilityCommittee: true,
},
}),
});

const {
transaction,
transactionReceipt,
coreContracts,
} = await createRollup({
params: {
config: createRollupConfig,
batchPoster,
validators,
},
account: deployer,
parentChainPublicClient,
});

Source

src/createRollup.ts:154