zksync-ethers
Version:
A Web3 library for interacting with the ZkSync Layer 2 scaling solution.
1,302 lines (1,298 loc) • 25.3 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Interface, type ContractRunner } from "ethers";
import type { IBridgehub, IBridgehubInterface } from "../IBridgehub";
const _abi = [
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "assetInfo",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "_assetAddress",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "additionalData",
type: "bytes32",
},
{
indexed: false,
internalType: "address",
name: "sender",
type: "address",
},
],
name: "AssetRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
],
name: "BaseTokenAssetIdRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "receiver",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "BridgeBurn",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "address",
name: "receiver",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "BridgeMint",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "chainTypeManager",
type: "address",
},
],
name: "ChainTypeManagerAdded",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "chainTypeManager",
type: "address",
},
],
name: "ChainTypeManagerRemoved",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "zkChain",
type: "address",
},
],
name: "MigrationFinalized",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "uint256",
name: "settlementLayerChainId",
type: "uint256",
},
],
name: "MigrationStarted",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "oldAdmin",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newAdmin",
type: "address",
},
],
name: "NewAdmin",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: false,
internalType: "address",
name: "chainTypeManager",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "chainGovernance",
type: "address",
},
],
name: "NewChain",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "oldPendingAdmin",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newPendingAdmin",
type: "address",
},
],
name: "NewPendingAdmin",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bool",
name: "isWhitelisted",
type: "bool",
},
],
name: "SettlementLayerRegistered",
type: "event",
},
{
inputs: [],
name: "L1_CHAIN_ID",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "acceptAdmin",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_chainTypeManager",
type: "address",
},
],
name: "addChainTypeManager",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_baseTokenAssetId",
type: "bytes32",
},
],
name: "addTokenAssetId",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "admin",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_baseTokenAssetId",
type: "bytes32",
},
],
name: "assetIdIsRegistered",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "assetRouter",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "baseToken",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "baseTokenAssetId",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "_msgValue",
type: "uint256",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "address",
name: "_originalCaller",
type: "address",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "bridgeBurn",
outputs: [
{
internalType: "bytes",
name: "_bridgeMintData",
type: "bytes",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "bridgeMint",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "address",
name: "_depositSender",
type: "address",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "bridgeRecoverFailedTransfer",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "chainTypeManager",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_chainTypeManager",
type: "address",
},
],
name: "chainTypeManagerIsRegistered",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "address",
name: "_chainTypeManager",
type: "address",
},
{
internalType: "bytes32",
name: "_baseTokenAssetId",
type: "bytes32",
},
{
internalType: "uint256",
name: "_salt",
type: "uint256",
},
{
internalType: "address",
name: "_admin",
type: "address",
},
{
internalType: "bytes",
name: "_initData",
type: "bytes",
},
{
internalType: "bytes[]",
name: "_factoryDeps",
type: "bytes[]",
},
],
name: "createNewChain",
outputs: [
{
internalType: "uint256",
name: "chainId",
type: "uint256",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_ctmAddress",
type: "address",
},
],
name: "ctmAssetIdFromAddress",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "ctmAssetIdFromChainId",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_assetInfo",
type: "bytes32",
},
],
name: "ctmAssetIdToAddress",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_canonicalTxHash",
type: "bytes32",
},
{
internalType: "uint64",
name: "_expirationTimestamp",
type: "uint64",
},
],
name: "forwardTransactionOnGateway",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "getAllZKChainChainIDs",
outputs: [
{
internalType: "uint256[]",
name: "",
type: "uint256[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getAllZKChains",
outputs: [
{
internalType: "address[]",
name: "",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "getHyperchain",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "getZKChain",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "l1CtmDeployer",
outputs: [
{
internalType: "contract ICTMDeploymentTracker",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "_gasPrice",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2GasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2GasPerPubdataByteLimit",
type: "uint256",
},
],
name: "l2TransactionBaseCost",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "messageRoot",
outputs: [
{
internalType: "contract IMessageRoot",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "migrationPaused",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "pauseMigration",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_l2TxHash",
type: "bytes32",
},
{
internalType: "uint256",
name: "_l2BatchNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
{
internalType: "uint16",
name: "_l2TxNumberInBatch",
type: "uint16",
},
{
internalType: "bytes32[]",
name: "_merkleProof",
type: "bytes32[]",
},
{
internalType: "enum TxStatus",
name: "_status",
type: "uint8",
},
],
name: "proveL1ToL2TransactionStatus",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "_batchNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_index",
type: "uint256",
},
{
components: [
{
internalType: "uint8",
name: "l2ShardId",
type: "uint8",
},
{
internalType: "bool",
name: "isService",
type: "bool",
},
{
internalType: "uint16",
name: "txNumberInBatch",
type: "uint16",
},
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "bytes32",
name: "key",
type: "bytes32",
},
{
internalType: "bytes32",
name: "value",
type: "bytes32",
},
],
internalType: "struct L2Log",
name: "_log",
type: "tuple",
},
{
internalType: "bytes32[]",
name: "_proof",
type: "bytes32[]",
},
],
name: "proveL2LogInclusion",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "_batchNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_index",
type: "uint256",
},
{
components: [
{
internalType: "uint16",
name: "txNumberInBatch",
type: "uint16",
},
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
internalType: "struct L2Message",
name: "_message",
type: "tuple",
},
{
internalType: "bytes32[]",
name: "_proof",
type: "bytes32[]",
},
],
name: "proveL2MessageInclusion",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "address",
name: "_hyperchain",
type: "address",
},
],
name: "registerAlreadyDeployedZKChain",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "registerLegacyChain",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_newSettlementLayerChainId",
type: "uint256",
},
{
internalType: "bool",
name: "_isWhitelisted",
type: "bool",
},
],
name: "registerSettlementLayer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_chainTypeManager",
type: "address",
},
],
name: "removeChainTypeManager",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "mintValue",
type: "uint256",
},
{
internalType: "address",
name: "l2Contract",
type: "address",
},
{
internalType: "uint256",
name: "l2Value",
type: "uint256",
},
{
internalType: "bytes",
name: "l2Calldata",
type: "bytes",
},
{
internalType: "uint256",
name: "l2GasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "l2GasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "bytes[]",
name: "factoryDeps",
type: "bytes[]",
},
{
internalType: "address",
name: "refundRecipient",
type: "address",
},
],
internalType: "struct L2TransactionRequestDirect",
name: "_request",
type: "tuple",
},
],
name: "requestL2TransactionDirect",
outputs: [
{
internalType: "bytes32",
name: "canonicalTxHash",
type: "bytes32",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "mintValue",
type: "uint256",
},
{
internalType: "uint256",
name: "l2Value",
type: "uint256",
},
{
internalType: "uint256",
name: "l2GasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "l2GasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "address",
name: "refundRecipient",
type: "address",
},
{
internalType: "address",
name: "secondBridgeAddress",
type: "address",
},
{
internalType: "uint256",
name: "secondBridgeValue",
type: "uint256",
},
{
internalType: "bytes",
name: "secondBridgeCalldata",
type: "bytes",
},
],
internalType: "struct L2TransactionRequestTwoBridgesOuter",
name: "_request",
type: "tuple",
},
],
name: "requestL2TransactionTwoBridges",
outputs: [
{
internalType: "bytes32",
name: "canonicalTxHash",
type: "bytes32",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_sharedBridge",
type: "address",
},
{
internalType: "contract ICTMDeploymentTracker",
name: "_l1CtmDeployer",
type: "address",
},
{
internalType: "contract IMessageRoot",
name: "_messageRoot",
type: "address",
},
],
name: "setAddresses",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_additionalData",
type: "bytes32",
},
{
internalType: "address",
name: "_assetAddress",
type: "address",
},
],
name: "setCTMAssetAddress",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_newPendingAdmin",
type: "address",
},
],
name: "setPendingAdmin",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "settlementLayer",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "sharedBridge",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "unpauseMigration",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
],
name: "whitelistedSettlementLayers",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
] as const;
export class IBridgehub__factory {
static readonly abi = _abi;
static createInterface(): IBridgehubInterface {
return new Interface(_abi) as IBridgehubInterface;
}
static connect(address: string, runner?: ContractRunner | null): IBridgehub {
return new Contract(address, _abi, runner) as unknown as IBridgehub;
}
}