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
Member | Type |
---|---|
account | PrivateKeyAccount |
params | CreateRollupParams |
parentChainPublicClient | PublicClient <Transport , TChain > |
Source
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
Member | Type |
---|---|
coreContracts | CoreContracts |
transaction | CreateRollupTransaction |
transactionReceipt | CreateRollupTransactionReceipt |
Source
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.
- Example 1: Create an ETH gas token chain
- Example 2: Create a custom gas token chain
Type parameters
Type parameter |
---|
TChain extends undefined | Chain <undefined | ChainFormatters > |
Parameters
Parameter | Type | Description |
---|---|---|
createRollupFunctionParams | CreateRollupFunctionParams <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,
});