createTokenBridge
Type Aliases
CreateTokenBridgeParams<TParentChain, TOrbitChain>
type CreateTokenBridgeParams<TParentChain, TOrbitChain>: WithTokenBridgeCreatorAddressOverride<object>;
Type declaration
Member | Type |
---|---|
account | PrivateKeyAccount |
gasOverrides | TransactionRequestGasOverrides |
nativeTokenAddress | Address |
orbitChainPublicClient | PublicClient <Transport , TOrbitChain > |
parentChainPublicClient | PublicClient <Transport , TParentChain > |
retryableGasOverrides | TransactionRequestRetryableGasOverrides |
rollupAddress | Address |
rollupOwner | Address |
setWethGatewayGasOverrides | TransactionRequestRetryableGasOverrides |
Type parameters
Type parameter |
---|
TParentChain extends Chain | undefined |
TOrbitChain extends Chain | undefined |
Source
CreateTokenBridgeResults<TParentChain, TOrbitChain>
type CreateTokenBridgeResults<TParentChain, TOrbitChain>: object;
Type parameters
Type parameter |
---|
TParentChain extends Chain | undefined |
TOrbitChain extends Chain | undefined |
Type declaration
Member | Type | Description |
---|---|---|
retryables | WaitForRetryablesResult | Retryable transaction receipts of createTokenBridgePrepareTransactionReceipt (WaitForRetryablesResult) |
setWethGateway | object | Optional: createTokenBridgePrepareSetWethGatewayTransaction's result |
setWethGateway.retryables | [TransactionReceipt ] | Retryable transaction receipt of createTokenBridgePrepareSetWethGatewayTransactionReceipt (WaitForRetryablesResult) |
setWethGateway.transaction | Transaction | Transaction of createTokenBridgePrepareSetWethGatewayTransactionReceipt (Transaction) |
setWethGateway.transactionReceipt | CreateTokenBridgeSetWethGatewayTransactionReceipt <TOrbitChain > | Transaction receipt of createTokenBridgePrepareSetWethGatewayTransactionReceipt (createTokenBridgePrepareSetWethGatewayTransactionReceipt) |
tokenBridgeContracts | TokenBridgeContracts | Core token bridge contracts (TokenBridgeContracts) |
transaction | Transaction | Transaction of createTokenBridgePrepareTransactionRequest |
transactionReceipt | CreateTokenBridgeTransactionReceipt <TParentChain , TOrbitChain > | Transaction receipt of createTokenBridgePrepareTransactionReceipt (CreateTokenBridgeTransactionReceipt) |
Source
Functions
createTokenBridge()
function createTokenBridge<TParentChain, TOrbitChain>(createTokenBridgeParams: CreateTokenBridgeParams<TParentChain, TOrbitChain>): Promise<CreateTokenBridgeResults<TParentChain, TOrbitChain>>
Performs the transactions to deploy the token bridge core contracts
For chain with custom gas token, it checks the custom gas token allowance token allowance and approve if necessary.
Returns the token bridge core contracts.
Type parameters
Type parameter |
---|
TParentChain extends undefined | Chain <undefined | ChainFormatters > |
TOrbitChain extends undefined | Chain <undefined | ChainFormatters > |
Parameters
Parameter | Type | Description |
---|---|---|
createTokenBridgeParams | CreateTokenBridgeParams <TParentChain , TOrbitChain > |
Returns
Promise
<CreateTokenBridgeResults
<TParentChain
, TOrbitChain
>>
Promise<CreateTokenBridgeResults>
Example
const tokenBridgeCreator = await deployTokenBridgeCreator({
publicClient: l2Client,
});
const tokenBridgeContracts = await createTokenBridge({
rollupOwner: rollupOwner.address,
rollupAddress: rollupAddress,
account: deployer,
parentChainPublicClient: l1Client,
orbitChainPublicClient: l2Client,
tokenBridgeCreatorAddressOverride: tokenBridgeCreator,
gasOverrides: {
gasLimit: {
base: 6_000_000n,
},
},
retryableGasOverrides: {
maxGasForFactory: {
base: 20_000_000n,
},
maxGasForContracts: {
base: 20_000_000n,
},
maxSubmissionCostForFactory: {
base: 4_000_000_000_000n,
},
maxSubmissionCostForContracts: {
base: 4_000_000_000_000n,
},
},
setWethGatewayGasOverrides: {
gasLimit: {
base: 100_000n,
},
},
});