Capabilities for integrating, creating, and managing ZKsync wallets.

Hierarchy

  • Adapters
    • ZKsyncWallet

Constructors

  • Parameters

    • privateKey: string

      The private key of the account.

    • OptionalproviderL2: Web3ZKsyncL2

      The provider instance for connecting to a L2 network.

    • OptionalproviderL1: Web3ZKsyncL1

      The provider instance for connecting to a L1 network.

    Returns ZKsyncWallet

    import { Web3ZKsyncL1, Web3ZKsyncL2, ZKsyncWallet } from "web3-plugin-zksync";

    const PRIVATE_KEY = "<WALLET_PRIVATE_KEY>";
    const l2Provider = new Web3ZKsyncL2("https://sepolia.era.zksync.dev");
    const l1Provider = new Web3ZKsyncL1("https://rpc.sepolia.org");
    const wallet = new ZKsyncWallet(PRIVATE_KEY, l2Provider, l1Provider);
    import { Web3 } from "web3";
    import { ZkSyncPlugin } from "web3-plugin-zksync";

    const web3 = new Web3("https://rpc.sepolia.org");
    web3.registerPlugin(new ZkSyncPlugin("https://sepolia.era.zksync.dev"));

    const PRIVATE_KEY = "<WALLET_PRIVATE_KEY>";
    const zkWallet = new web3.ZKsync.ZkWallet(PRIVATE_KEY);

Properties

account: Web3Account
adapterL2: AdapterL2
provider: Web3ZKsyncL2
providerL1?: Web3ZKsyncL1

Accessors

Methods

  • Parameters

    Returns Promise<
        {
            mintValue: bigint;
            tx: {
                amount: Numbers;
                approveBaseERC20?: boolean;
                approveBaseOverrides?: TransactionOverrides;
                approveERC20?: boolean;
                approveOverrides?: TransactionOverrides;
                bridgeAddress?: string;
                calldata: string;
                contractAddress: undefined
                | string;
                customBridgeData?: Bytes;
                gasPerPubdataByte?: Numbers;
                l2GasLimit?: Numbers;
                l2Value: Numbers;
                mintValue: bigint;
                operatorTip?: Numbers;
                overrides?: TransactionOverrides;
                refundRecipient?: string;
                to?: string;
                token: string;
            };
        },
    >

  • Parameters

    Returns Promise<
        {
            amount: Numbers;
            approveBaseERC20?: boolean;
            approveBaseOverrides?: TransactionOverrides;
            approveERC20?: boolean;
            approveOverrides?: TransactionOverrides;
            bridgeAddress?: string;
            calldata: string;
            contractAddress: undefined
            | string;
            customBridgeData?: Bytes;
            gasPerPubdataByte?: Numbers;
            l2GasLimit?: Numbers;
            l2Value: Numbers;
            mintValue: Numbers;
            operatorTip?: Numbers;
            overrides?: TransactionOverrides;
            refundRecipient?: string;
            to?: string;
            token: string;
        },
    >

  • Parameters

    Returns Promise<
        {
            mintValue: bigint;
            overrides: TransactionOverrides;
            tx: PayableMethodObject<
                [
                    {
                        chainId: MatchPrimitiveType<"uint256", unknown>;
                        l2GasLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2GasPerPubdataByteLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2Value: MatchPrimitiveType<"uint256", unknown>;
                        mintValue: MatchPrimitiveType<"uint256", unknown>;
                        refundRecipient: string;
                        secondBridgeAddress: string;
                        secondBridgeCalldata: MatchPrimitiveType<"bytes", unknown>;
                        secondBridgeValue: MatchPrimitiveType<"uint256", unknown>;
                    },
                ],
                Bytes,
            >;
        },
    >

  • Parameters

    Returns Promise<
        {
            mintValue: bigint;
            overrides: TransactionOverrides;
            tx: PayableMethodObject<
                [
                    {
                        chainId: MatchPrimitiveType<"uint256", unknown>;
                        l2GasLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2GasPerPubdataByteLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2Value: MatchPrimitiveType<"uint256", unknown>;
                        mintValue: MatchPrimitiveType<"uint256", unknown>;
                        refundRecipient: string;
                        secondBridgeAddress: string;
                        secondBridgeCalldata: MatchPrimitiveType<"bytes", unknown>;
                        secondBridgeValue: MatchPrimitiveType<"uint256", unknown>;
                    },
                ],
                Bytes,
            >;
        },
    >

  • Parameters

    • withdrawalHash: Bytes
    • index: number = 0

    Returns Promise<
        {
            l2ToL1Log: {
                blockHash: string;
                blockNumber: string
                | number
                | bigint;
                isService: boolean;
                key: string;
                l1BatchNumber: string | number | bigint;
                logIndex: string | number | bigint;
                sender: string;
                shardId: string | number | bigint;
                transactionHash: string;
                transactionIndex: string | number | bigint;
                value: string;
            };
            l2ToL1LogIndex: number;
        },
    >

  • Bridging ERC20 tokens from L1 requires approving the tokens to the ZKsync Era smart contract.

    Parameters

    • token: string

      The L1 address of the token.

    • amount: Numbers

      The amount of the token to be approved.

    • Optionaloverrides: TransactionOverrides & { bridgeAddress?: string }

      Transaction's overrides which may be used to pass L1 gasLimit, gasPrice, value, etc.

    Returns Promise<
        {
            blockHash: string;
            blockNumber: bigint;
            contractAddress?: string;
            cumulativeGasUsed: bigint;
            effectiveGasPrice?: bigint;
            events?: {
                [key: string]: {
                    address: string;
                    blockHash?: string;
                    blockNumber?: bigint;
                    data: string;
                    event: string;
                    id?: string;
                    logIndex?: bigint;
                    raw?: { data: string; topics: unknown[] };
                    returnValues: { [key: string]: unknown };
                    signature?: string;
                    topics: string[];
                    transactionHash?: string;
                    transactionIndex?: bigint;
                };
            };
            from: string;
            gasUsed: bigint;
            logs: {
                address?: string;
                blockHash?: string;
                blockNumber?: bigint;
                data?: string;
                id?: string;
                logIndex?: bigint;
                removed?: boolean;
                topics?: string[];
                transactionHash?: string;
                transactionIndex?: bigint;
            }[];
            logsBloom: string;
            root: string;
            status: bigint;
            to: string;
            transactionHash: string;
            transactionIndex: bigint;
            type?: bigint;
        },
    >

    A promise that resolves to the response of the approval transaction.

    If attempting to approve an ETH token.

  • Withdraws funds from the initiated deposit, which failed when finalizing on L2. If the deposit L2 transaction has failed, it sends an L1 transaction calling claimFailedDeposit method of the L1 bridge, which results in returning L1 tokens back to the depositor.

    Parameters

    • depositHash: Bytes

      The L2 transaction hash of the failed deposit.

    • Optionaloverrides: TransactionOverrides

      Transaction's overrides which may be used to pass L1 gasLimit, gasPrice, value, etc.

    Returns Promise<TransactionReceipt>

    A promise that resolves to the response of the claimFailedDeposit transaction.

    If attempting to claim successful deposit.

  • Transfers the specified token from the associated account on the L1 network to the target account on the L2 network. The token can be either ETH or any ERC20 token. For ERC20 tokens, enough approved tokens must be associated with the specified L1 bridge (default one or the one defined in transaction.bridgeAddress). In this case, depending on is the chain ETH-based or not transaction.approveERC20 or transaction.approveBaseERC20 can be enabled to perform token approval. If there are already enough approved tokens for the L1 bridge, token approval will be skipped. To check the amount of approved tokens for a specific bridge, use the getAllowanceL1 method.

    Parameters

    Returns Promise<PriorityOpResponse>

  • Estimates the amount of gas required for a deposit transaction on the L1 network. Gas for approving ERC20 tokens is not included in the estimation.

    In order for estimation to work, enough token allowance is required in the following cases:

    • Depositing ERC20 tokens on an ETH-based chain.
    • Depositing any token (including ETH) on a non-ETH-based chain.

    Parameters

    Returns Promise<bigint>

  • Estimates the amount of gas required for a request execute transaction.

    Parameters

    Returns Promise<bigint>

  • Proves the inclusion of the L2->L1 withdrawal message.

    Parameters

    • withdrawalHash: Bytes

      Hash of the L2 transaction where the withdrawal was initiated.

    • Optionalindex: number = 0

      In case there were multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize.

    • Optionaloverrides: TransactionOverrides

      Transaction's overrides which may be used to pass L1 gasLimit, gasPrice, value, etc.

    Returns Promise<
        {
            blockHash: string;
            blockNumber: bigint;
            contractAddress?: string;
            cumulativeGasUsed: bigint;
            effectiveGasPrice?: bigint;
            events?: {
                [key: string]: {
                    address: string;
                    blockHash?: string;
                    blockNumber?: bigint;
                    data: string;
                    event: string;
                    id?: string;
                    logIndex?: bigint;
                    raw?: { data: string; topics: unknown[] };
                    returnValues: { [key: string]: unknown };
                    signature?: string;
                    topics: string[];
                    transactionHash?: string;
                    transactionIndex?: bigint;
                };
            };
            from: string;
            gasUsed: bigint;
            logs: {
                address?: string;
                blockHash?: string;
                blockNumber?: bigint;
                data?: string;
                id?: string;
                logIndex?: bigint;
                removed?: boolean;
                topics?: string[];
                transactionHash?: string;
                transactionIndex?: bigint;
            }[];
            logsBloom: string;
            root: string;
            status: bigint;
            to: string;
            transactionHash: string;
            transactionIndex: bigint;
            type?: bigint;
        },
    >

    A promise that resolves to the proof of inclusion of the withdrawal message.

    If log proof can not be found.

  • Returns the parameters required for finalizing a withdrawal from the withdrawal transaction's log on the L1 network.

    Parameters

    • withdrawalHash: Bytes

      Hash of the L2 transaction where the withdrawal was initiated.

    • Optionalindex: number = 0

      In case there were multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize.

    Returns Promise<FinalizeWithdrawalParams>

    If log proof can not be found.

  • Returns the amount of approved tokens for a specific L1 bridge.

    Parameters

    • token: string

      The Ethereum address of the token.

    • OptionalbridgeAddress: string

      The address of the bridge contract to be used. Defaults to the default ZKsync Era bridge, either L1EthBridge or L1Erc20Bridge.

    • OptionalblockTag: BlockNumberOrTag

      The block in which an allowance should be checked. Defaults to 'committed', i.e., the latest processed block.

    Returns Promise<bigint>

  • Parameters

    • Optionaltoken: string
    • blockTag: BlockNumberOrTag = 'latest'

    Returns Promise<bigint>

  • Returns the amount of the token held by the account on the L1 network.

    Parameters

    • Optionaltoken: string

      The address of the token. Defaults to ETH if not provided.

    • OptionalblockTag: BlockNumberOrTag

      The block in which the balance should be checked. Defaults to 'committed', i.e., the latest processed block.

    Returns Promise<bigint>

  • Returns the base cost for an L2 transaction.

    Parameters

    Returns Promise<bigint>

  • Returns the address of the base token on L1.

    Returns Promise<string>

  • Returns Contract wrapper of the Bridgehub smart contract.

    Parameters

    • returnFormat: DataFormat = DEFAULT_RETURN_FORMAT

    Returns Promise<
        Contract<
            readonly [
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "oldAdmin";
                            type: "address";
                        },
                        {
                            indexed: true;
                            internalType: "address";
                            name: "newAdmin";
                            type: "address";
                        },
                    ];
                    name: "NewAdmin";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "chainId";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "address";
                            name: "stateTransitionManager";
                            type: "address";
                        },
                        {
                            indexed: true;
                            internalType: "address";
                            name: "chainGovernance";
                            type: "address";
                        },
                    ];
                    name: "NewChain";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "oldPendingAdmin";
                            type: "address";
                        },
                        {
                            indexed: true;
                            internalType: "address";
                            name: "newPendingAdmin";
                            type: "address";
                        },
                    ];
                    name: "NewPendingAdmin";
                    type: "event";
                },
                {
                    inputs: readonly [];
                    name: "acceptAdmin";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_stateTransitionManager";
                            type: "address";
                        },
                    ];
                    name: "addStateTransitionManager";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_token"; type: "address" },
                    ];
                    name: "addToken";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                    ];
                    name: "baseToken";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        {
                            internalType: "address";
                            name: "_stateTransitionManager";
                            type: "address";
                        },
                        { internalType: "address"; name: "_baseToken"; type: "address" },
                        { internalType: "uint256"; name: "_salt"; type: "uint256" },
                        { internalType: "address"; name: "_admin"; type: "address" },
                        { internalType: "bytes"; name: "_initData"; type: "bytes" },
                    ];
                    name: "createNewChain";
                    outputs: readonly [
                        { internalType: "uint256"; name: "chainId"; type: "uint256" },
                    ];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                    ];
                    name: "getStateTransition";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { 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: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { 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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_index"; type: "uint256" },
                        {
                            components: readonly [
                                { 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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_index"; type: "uint256" },
                        {
                            components: readonly [
                                {
                                    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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_stateTransitionManager";
                            type: "address";
                        },
                    ];
                    name: "removeStateTransitionManager";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { 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: readonly [
                        {
                            internalType: "bytes32";
                            name: "canonicalTxHash";
                            type: "bytes32";
                        },
                    ];
                    stateMutability: "payable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { 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: readonly [
                        {
                            internalType: "bytes32";
                            name: "canonicalTxHash";
                            type: "bytes32";
                        },
                    ];
                    stateMutability: "payable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_newPendingAdmin";
                            type: "address";
                        },
                    ];
                    name: "setPendingAdmin";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_sharedBridge"; type: "address" },
                    ];
                    name: "setSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "sharedBridge";
                    outputs: readonly [
                        {
                            internalType: "contract IL1SharedBridge";
                            name: "";
                            type: "address";
                        },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                    ];
                    name: "stateTransitionManager";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_stateTransitionManager";
                            type: "address";
                        },
                    ];
                    name: "stateTransitionManagerIsRegistered";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_baseToken"; type: "address" },
                    ];
                    name: "tokenIsRegistered";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
            ],
        >,
    >

  • Returns Promise<bigint>

  • Returns the parameters for the approval token transaction based on the deposit token and amount. Some deposit transactions require multiple approvals. Existing allowance for the bridge is not checked; allowance is calculated solely based on the specified amount.

    Parameters

    • token: string

      The address of the token to deposit.

    • amount: Numbers

      The amount of the token to deposit.

    Returns Promise<TokenAllowanceResult[]>

  • Returns L1 bridge contracts.

    Parameters

    • returnFormat: DataFormat = DEFAULT_RETURN_FORMAT

    Returns Promise<
        {
            erc20: Contract<
                readonly [
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "name";
                        outputs: readonly [{ name: ""; type: "string" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_spender"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "approve";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "totalSupply";
                        outputs: readonly [{ name: ""; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_from"; type: "address" },
                            { name: "_to"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "transferFrom";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "decimals";
                        outputs: readonly [{ name: ""; type: "uint8" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [{ name: "_owner"; type: "address" }];
                        name: "balanceOf";
                        outputs: readonly [{ name: "balance"; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "symbol";
                        outputs: readonly [{ name: ""; type: "string" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_to"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "transfer";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [
                            { name: "_owner"; type: "address" },
                            { name: "_spender"; type: "address" },
                        ];
                        name: "allowance";
                        outputs: readonly [{ name: ""; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    { payable: true; stateMutability: "payable"; type: "fallback" },
                    {
                        anonymous: false;
                        inputs: readonly [
                            { indexed: true; name: "owner"; type: "address" },
                            { indexed: true; name: "spender"; type: "address" },
                            { indexed: false; name: "value"; type: "uint256" },
                        ];
                        name: "Approval";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            { indexed: true; name: "from"; type: "address" },
                            { indexed: true; name: "to"; type: "address" },
                            { indexed: false; name: "value"; type: "uint256" },
                        ];
                        name: "Transfer";
                        type: "event";
                    },
                ],
            >;
            shared: Contract<
                readonly [
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "from";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "address";
                                name: "l1Token";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "uint256";
                                name: "amount";
                                type: "uint256";
                            },
                        ];
                        name: "BridgehubDepositBaseTokenInitiated";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "bytes32";
                                name: "txDataHash";
                                type: "bytes32";
                            },
                            {
                                indexed: true;
                                internalType: "bytes32";
                                name: "l2DepositTxHash";
                                type: "bytes32";
                            },
                        ];
                        name: "BridgehubDepositFinalized";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "bytes32";
                                name: "txDataHash";
                                type: "bytes32";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "from";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "address";
                                name: "to";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "address";
                                name: "l1Token";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "uint256";
                                name: "amount";
                                type: "uint256";
                            },
                        ];
                        name: "BridgehubDepositInitiated";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "to";
                                type: "address";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "l1Token";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "uint256";
                                name: "amount";
                                type: "uint256";
                            },
                        ];
                        name: "ClaimedFailedDepositSharedBridge";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "bytes32";
                                name: "l2DepositTxHash";
                                type: "bytes32";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "from";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "address";
                                name: "to";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "address";
                                name: "l1Token";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "uint256";
                                name: "amount";
                                type: "uint256";
                            },
                        ];
                        name: "LegacyDepositInitiated";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            {
                                indexed: true;
                                internalType: "uint256";
                                name: "chainId";
                                type: "uint256";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "to";
                                type: "address";
                            },
                            {
                                indexed: true;
                                internalType: "address";
                                name: "l1Token";
                                type: "address";
                            },
                            {
                                indexed: false;
                                internalType: "uint256";
                                name: "amount";
                                type: "uint256";
                            },
                        ];
                        name: "WithdrawalFinalizedSharedBridge";
                        type: "event";
                    },
                    {
                        inputs: readonly [];
                        name: "bridgehub";
                        outputs: readonly [
                            { internalType: "contract IBridgehub"; name: ""; type: "address" },
                        ];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "bytes32"; name: "_txDataHash"; type: "bytes32" },
                            { internalType: "bytes32"; name: "_txHash"; type: "bytes32" },
                        ];
                        name: "bridgehubConfirmL2Transaction";
                        outputs: readonly [];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "address"; name: "_prevMsgSender"; type: "address" },
                            { internalType: "uint256"; name: "_l2Value"; type: "uint256" },
                            { internalType: "bytes"; name: "_data"; type: "bytes" },
                        ];
                        name: "bridgehubDeposit";
                        outputs: readonly [
                            {
                                components: readonly [
                                    { internalType: "bytes32"; name: "magicValue"; type: "bytes32" },
                                    { internalType: "address"; name: "l2Contract"; type: "address" },
                                    { internalType: "bytes"; name: "l2Calldata"; type: "bytes" },
                                    { internalType: "bytes[]"; name: "factoryDeps"; type: "bytes[]" },
                                    { internalType: "bytes32"; name: "txDataHash"; type: "bytes32" },
                                ];
                                internalType: "struct L2TransactionRequestTwoBridgesInner";
                                name: "request";
                                type: "tuple";
                            },
                        ];
                        stateMutability: "payable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "address"; name: "_prevMsgSender"; type: "address" },
                            { internalType: "address"; name: "_l1Token"; type: "address" },
                            { internalType: "uint256"; name: "_amount"; type: "uint256" },
                        ];
                        name: "bridgehubDepositBaseToken";
                        outputs: readonly [];
                        stateMutability: "payable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "address"; name: "_depositSender"; type: "address" },
                            { internalType: "address"; name: "_l1Token"; type: "address" },
                            { internalType: "uint256"; name: "_amount"; 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[]" },
                        ];
                        name: "claimFailedDeposit";
                        outputs: readonly [];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            {
                                internalType: "address";
                                name: "_depositSender";
                                type: "address";
                            },
                            { internalType: "address"; name: "_l1Token"; type: "address" },
                            { internalType: "uint256"; name: "_amount"; 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[]" },
                        ];
                        name: "claimFailedDepositLegacyErc20Bridge";
                        outputs: readonly [];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "bytes32"; name: "_l2TxHash"; type: "bytes32" },
                        ];
                        name: "depositHappened";
                        outputs: readonly [
                            { internalType: "bytes32"; name: ""; type: "bytes32" },
                        ];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "address"; name: "_msgSender"; type: "address" },
                            { internalType: "address"; name: "_l2Receiver"; type: "address" },
                            { internalType: "address"; name: "_l1Token"; type: "address" },
                            { internalType: "uint256"; name: "_amount"; type: "uint256" },
                            { internalType: "uint256"; name: "_l2TxGasLimit"; type: "uint256" },
                            {
                                internalType: "uint256";
                                name: "_l2TxGasPerPubdataByte";
                                type: "uint256";
                            },
                            { internalType: "address"; name: "_refundRecipient"; type: "address" },
                        ];
                        name: "depositLegacyErc20Bridge";
                        outputs: readonly [
                            { internalType: "bytes32"; name: "txHash"; type: "bytes32" },
                        ];
                        stateMutability: "payable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "uint256"; name: "_l2BatchNumber"; type: "uint256" },
                            { internalType: "uint256"; name: "_l2MessageIndex"; type: "uint256" },
                            { internalType: "uint16"; name: "_l2TxNumberInBatch"; type: "uint16" },
                            { internalType: "bytes"; name: "_message"; type: "bytes" },
                            { internalType: "bytes32[]"; name: "_merkleProof"; type: "bytes32[]" },
                        ];
                        name: "finalizeWithdrawal";
                        outputs: readonly [];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            {
                                internalType: "uint256";
                                name: "_l2BatchNumber";
                                type: "uint256";
                            },
                            { internalType: "uint256"; name: "_l2MessageIndex"; type: "uint256" },
                            { internalType: "uint16"; name: "_l2TxNumberInBatch"; type: "uint16" },
                            { internalType: "bytes"; name: "_message"; type: "bytes" },
                            { internalType: "bytes32[]"; name: "_merkleProof"; type: "bytes32[]" },
                        ];
                        name: "finalizeWithdrawalLegacyErc20Bridge";
                        outputs: readonly [
                            { internalType: "address"; name: "l1Receiver"; type: "address" },
                            { internalType: "address"; name: "l1Token"; type: "address" },
                            { internalType: "uint256"; name: "amount"; type: "uint256" },
                        ];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                            { internalType: "uint256"; name: "_l2BatchNumber"; type: "uint256" },
                            { internalType: "uint256"; name: "_l2MessageIndex"; type: "uint256" },
                        ];
                        name: "isWithdrawalFinalized";
                        outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [];
                        name: "l1WethAddress";
                        outputs: readonly [
                            { internalType: "address"; name: ""; type: "address" },
                        ];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        ];
                        name: "l2BridgeAddress";
                        outputs: readonly [
                            { internalType: "address"; name: ""; type: "address" },
                        ];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [];
                        name: "legacyBridge";
                        outputs: readonly [
                            {
                                internalType: "contract IL1ERC20Bridge";
                                name: "";
                                type: "address";
                            },
                        ];
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        ];
                        name: "receiveEth";
                        outputs: readonly [];
                        stateMutability: "payable";
                        type: "function";
                    },
                    {
                        inputs: readonly [
                            {
                                internalType: "uint256";
                                name: "_eraFirstPostUpgradeBatch";
                                type: "uint256";
                            },
                        ];
                        name: "setEraFirstPostUpgradeBatch";
                        outputs: readonly [];
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                ],
            >;
            weth: Contract<
                readonly [
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "name";
                        outputs: readonly [{ name: ""; type: "string" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_spender"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "approve";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "totalSupply";
                        outputs: readonly [{ name: ""; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_from"; type: "address" },
                            { name: "_to"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "transferFrom";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "decimals";
                        outputs: readonly [{ name: ""; type: "uint8" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [{ name: "_owner"; type: "address" }];
                        name: "balanceOf";
                        outputs: readonly [{ name: "balance"; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [];
                        name: "symbol";
                        outputs: readonly [{ name: ""; type: "string" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    {
                        constant: false;
                        inputs: readonly [
                            { name: "_to"; type: "address" },
                            { name: "_value"; type: "uint256" },
                        ];
                        name: "transfer";
                        outputs: readonly [{ name: ""; type: "bool" }];
                        payable: false;
                        stateMutability: "nonpayable";
                        type: "function";
                    },
                    {
                        constant: true;
                        inputs: readonly [
                            { name: "_owner"; type: "address" },
                            { name: "_spender"; type: "address" },
                        ];
                        name: "allowance";
                        outputs: readonly [{ name: ""; type: "uint256" }];
                        payable: false;
                        stateMutability: "view";
                        type: "function";
                    },
                    { payable: true; stateMutability: "payable"; type: "fallback" },
                    {
                        anonymous: false;
                        inputs: readonly [
                            { indexed: true; name: "owner"; type: "address" },
                            { indexed: true; name: "spender"; type: "address" },
                            { indexed: false; name: "value"; type: "uint256" },
                        ];
                        name: "Approval";
                        type: "event";
                    },
                    {
                        anonymous: false;
                        inputs: readonly [
                            { indexed: true; name: "from"; type: "address" },
                            { indexed: true; name: "to"; type: "address" },
                            { indexed: false; name: "value"; type: "uint256" },
                        ];
                        name: "Transfer";
                        type: "event";
                    },
                ],
            >;
        },
    >

    There is no separate Ether bridge contract, Bridgehub is used instead.

  • Returns Contract wrapper of the ZKsync Era smart contract.

    Parameters

    • returnFormat: DataFormat = DEFAULT_RETURN_FORMAT

    Returns Promise<
        Contract<
            readonly [
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "batchNumber";
                            type: "uint256";
                        },
                        {
                            indexed: true;
                            internalType: "bytes32";
                            name: "batchHash";
                            type: "bytes32";
                        },
                        {
                            indexed: true;
                            internalType: "bytes32";
                            name: "commitment";
                            type: "bytes32";
                        },
                    ];
                    name: "BlockCommit";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "batchNumber";
                            type: "uint256";
                        },
                        {
                            indexed: true;
                            internalType: "bytes32";
                            name: "batchHash";
                            type: "bytes32";
                        },
                        {
                            indexed: true;
                            internalType: "bytes32";
                            name: "commitment";
                            type: "bytes32";
                        },
                    ];
                    name: "BlockExecution";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "totalBatchesCommitted";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "totalBatchesVerified";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "totalBatchesExecuted";
                            type: "uint256";
                        },
                    ];
                    name: "BlocksRevert";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "previousLastVerifiedBatch";
                            type: "uint256";
                        },
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "currentLastVerifiedBatch";
                            type: "uint256";
                        },
                    ];
                    name: "BlocksVerification";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "to";
                            type: "address";
                        },
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "amount";
                            type: "uint256";
                        },
                    ];
                    name: "EthWithdrawalFinalized";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            components: readonly [
                                {
                                    components: readonly [
                                        { internalType: "address"; name: "facet"; type: "address" },
                                        {
                                            internalType: "enum Diamond.Action";
                                            name: "action";
                                            type: "uint8";
                                        },
                                        { internalType: "bool"; name: "isFreezable"; type: "bool" },
                                        { internalType: "bytes4[]"; name: "selectors"; type: "bytes4[]" },
                                    ];
                                    internalType: "struct Diamond.FacetCut[]";
                                    name: "facetCuts";
                                    type: "tuple[]";
                                },
                                { internalType: "address"; name: "initAddress"; type: "address" },
                                { internalType: "bytes"; name: "initCalldata"; type: "bytes" },
                            ];
                            indexed: false;
                            internalType: "struct Diamond.DiamondCutData";
                            name: "diamondCut";
                            type: "tuple";
                        },
                    ];
                    name: "ExecuteUpgrade";
                    type: "event";
                },
                { anonymous: false; inputs: readonly []; name: "Freeze"; type: "event" },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "bool";
                            name: "isPorterAvailable";
                            type: "bool";
                        },
                    ];
                    name: "IsPorterAvailableStatusUpdate";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "oldAdmin";
                            type: "address";
                        },
                        {
                            indexed: true;
                            internalType: "address";
                            name: "newAdmin";
                            type: "address";
                        },
                    ];
                    name: "NewAdmin";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "uint128";
                            name: "oldNominator";
                            type: "uint128";
                        },
                        {
                            indexed: false;
                            internalType: "uint128";
                            name: "oldDenominator";
                            type: "uint128";
                        },
                        {
                            indexed: false;
                            internalType: "uint128";
                            name: "newNominator";
                            type: "uint128";
                        },
                        {
                            indexed: false;
                            internalType: "uint128";
                            name: "newDenominator";
                            type: "uint128";
                        },
                    ];
                    name: "NewBaseTokenMultiplier";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            components: readonly [
                                {
                                    internalType: "enum PubdataPricingMode";
                                    name: "pubdataPricingMode";
                                    type: "uint8";
                                },
                                {
                                    internalType: "uint32";
                                    name: "batchOverheadL1Gas";
                                    type: "uint32";
                                },
                                {
                                    internalType: "uint32";
                                    name: "maxPubdataPerBatch";
                                    type: "uint32";
                                },
                                { internalType: "uint32"; name: "maxL2GasPerBatch"; type: "uint32" },
                                {
                                    internalType: "uint32";
                                    name: "priorityTxMaxPubdata";
                                    type: "uint32";
                                },
                                { internalType: "uint64"; name: "minimalL2GasPrice"; type: "uint64" },
                            ];
                            indexed: false;
                            internalType: "struct FeeParams";
                            name: "oldFeeParams";
                            type: "tuple";
                        },
                        {
                            components: readonly [
                                {
                                    internalType: "enum PubdataPricingMode";
                                    name: "pubdataPricingMode";
                                    type: "uint8";
                                },
                                {
                                    internalType: "uint32";
                                    name: "batchOverheadL1Gas";
                                    type: "uint32";
                                },
                                {
                                    internalType: "uint32";
                                    name: "maxPubdataPerBatch";
                                    type: "uint32";
                                },
                                { internalType: "uint32"; name: "maxL2GasPerBatch"; type: "uint32" },
                                {
                                    internalType: "uint32";
                                    name: "priorityTxMaxPubdata";
                                    type: "uint32";
                                },
                                { internalType: "uint64"; name: "minimalL2GasPrice"; type: "uint64" },
                            ];
                            indexed: false;
                            internalType: "struct FeeParams";
                            name: "newFeeParams";
                            type: "tuple";
                        },
                    ];
                    name: "NewFeeParams";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "oldPendingAdmin";
                            type: "address";
                        },
                        {
                            indexed: true;
                            internalType: "address";
                            name: "newPendingAdmin";
                            type: "address";
                        },
                    ];
                    name: "NewPendingAdmin";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "txId";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "bytes32";
                            name: "txHash";
                            type: "bytes32";
                        },
                        {
                            indexed: false;
                            internalType: "uint64";
                            name: "expirationTimestamp";
                            type: "uint64";
                        },
                        {
                            components: readonly [
                                { internalType: "uint256"; name: "txType"; type: "uint256" },
                                { internalType: "uint256"; name: "from"; type: "uint256" },
                                { internalType: "uint256"; name: "to"; type: "uint256" },
                                { internalType: "uint256"; name: "gasLimit"; type: "uint256" },
                                {
                                    internalType: "uint256";
                                    name: "gasPerPubdataByteLimit";
                                    type: "uint256";
                                },
                                { internalType: "uint256"; name: "maxFeePerGas"; type: "uint256" },
                                {
                                    internalType: "uint256";
                                    name: "maxPriorityFeePerGas";
                                    type: "uint256";
                                },
                                { internalType: "uint256"; name: "paymaster"; type: "uint256" },
                                { internalType: "uint256"; name: "nonce"; type: "uint256" },
                                { internalType: "uint256"; name: "value"; type: "uint256" },
                                { internalType: "uint256[4]"; name: "reserved"; type: "uint256[4]" },
                                { internalType: "bytes"; name: "data"; type: "bytes" },
                                { internalType: "bytes"; name: "signature"; type: "bytes" },
                                { internalType: "uint256[]"; name: "factoryDeps"; type: "uint256[]" },
                                { internalType: "bytes"; name: "paymasterInput"; type: "bytes" },
                                { internalType: "bytes"; name: "reservedDynamic"; type: "bytes" },
                            ];
                            indexed: false;
                            internalType: "struct L2CanonicalTransaction";
                            name: "transaction";
                            type: "tuple";
                        },
                        {
                            indexed: false;
                            internalType: "bytes[]";
                            name: "factoryDeps";
                            type: "bytes[]";
                        },
                    ];
                    name: "NewPriorityRequest";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "oldPriorityTxMaxGasLimit";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "uint256";
                            name: "newPriorityTxMaxGasLimit";
                            type: "uint256";
                        },
                    ];
                    name: "NewPriorityTxMaxGasLimit";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "address";
                            name: "oldTransactionFilterer";
                            type: "address";
                        },
                        {
                            indexed: false;
                            internalType: "address";
                            name: "newTransactionFilterer";
                            type: "address";
                        },
                    ];
                    name: "NewTransactionFilterer";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            components: readonly [
                                {
                                    components: readonly [
                                        { internalType: "address"; name: "facet"; type: "address" },
                                        {
                                            internalType: "enum Diamond.Action";
                                            name: "action";
                                            type: "uint8";
                                        },
                                        { internalType: "bool"; name: "isFreezable"; type: "bool" },
                                        { internalType: "bytes4[]"; name: "selectors"; type: "bytes4[]" },
                                    ];
                                    internalType: "struct Diamond.FacetCut[]";
                                    name: "facetCuts";
                                    type: "tuple[]";
                                },
                                { internalType: "address"; name: "initAddress"; type: "address" },
                                { internalType: "bytes"; name: "initCalldata"; type: "bytes" },
                            ];
                            indexed: false;
                            internalType: "struct Diamond.DiamondCutData";
                            name: "diamondCut";
                            type: "tuple";
                        },
                        {
                            indexed: true;
                            internalType: "uint256";
                            name: "proposalId";
                            type: "uint256";
                        },
                        {
                            indexed: false;
                            internalType: "bytes32";
                            name: "proposalSalt";
                            type: "bytes32";
                        },
                    ];
                    name: "ProposeTransparentUpgrade";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [];
                    name: "Unfreeze";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: true;
                            internalType: "address";
                            name: "validatorAddress";
                            type: "address";
                        },
                        {
                            indexed: false;
                            internalType: "bool";
                            name: "isActive";
                            type: "bool";
                        },
                    ];
                    name: "ValidatorStatusUpdate";
                    type: "event";
                },
                {
                    anonymous: false;
                    inputs: readonly [
                        {
                            indexed: false;
                            internalType: "enum PubdataPricingMode";
                            name: "validiumMode";
                            type: "uint8";
                        },
                    ];
                    name: "ValidiumModeStatusUpdate";
                    type: "event";
                },
                {
                    inputs: readonly [];
                    name: "acceptAdmin";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "baseTokenGasPriceMultiplierDenominator";
                    outputs: readonly [
                        { internalType: "uint128"; name: ""; type: "uint128" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "baseTokenGasPriceMultiplierNominator";
                    outputs: readonly [
                        { internalType: "uint128"; name: ""; type: "uint128" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { internalType: "address"; name: "sender"; type: "address" },
                                { internalType: "address"; name: "contractL2"; type: "address" },
                                { internalType: "uint256"; name: "mintValue"; type: "uint256" },
                                { 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 BridgehubL2TransactionRequest";
                            name: "_request";
                            type: "tuple";
                        },
                    ];
                    name: "bridgehubRequestL2Transaction";
                    outputs: readonly [
                        {
                            internalType: "bytes32";
                            name: "canonicalTxHash";
                            type: "bytes32";
                        },
                    ];
                    stateMutability: "payable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                {
                                    internalType: "enum PubdataPricingMode";
                                    name: "pubdataPricingMode";
                                    type: "uint8";
                                },
                                {
                                    internalType: "uint32";
                                    name: "batchOverheadL1Gas";
                                    type: "uint32";
                                },
                                {
                                    internalType: "uint32";
                                    name: "maxPubdataPerBatch";
                                    type: "uint32";
                                },
                                { internalType: "uint32"; name: "maxL2GasPerBatch"; type: "uint32" },
                                {
                                    internalType: "uint32";
                                    name: "priorityTxMaxPubdata";
                                    type: "uint32";
                                },
                                { internalType: "uint64"; name: "minimalL2GasPrice"; type: "uint64" },
                            ];
                            internalType: "struct FeeParams";
                            name: "_newFeeParams";
                            type: "tuple";
                        },
                    ];
                    name: "changeFeeParams";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo";
                            name: "_lastCommittedBatchData";
                            type: "tuple";
                        },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "uint64"; name: "timestamp"; type: "uint64" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                { internalType: "bytes32"; name: "newStateRoot"; type: "bytes32" },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "bootloaderHeapInitialContentsHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "eventsQueueStateHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes"; name: "systemLogs"; type: "bytes" },
                                { internalType: "bytes"; name: "pubdataCommitments"; type: "bytes" },
                            ];
                            internalType: "struct IExecutor.CommitBatchInfo[]";
                            name: "_newBatchesData";
                            type: "tuple[]";
                        },
                    ];
                    name: "commitBatches";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo";
                            name: "_lastCommittedBatchData";
                            type: "tuple";
                        },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "uint64"; name: "timestamp"; type: "uint64" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                { internalType: "bytes32"; name: "newStateRoot"; type: "bytes32" },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "bootloaderHeapInitialContentsHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "eventsQueueStateHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes"; name: "systemLogs"; type: "bytes" },
                                { internalType: "bytes"; name: "pubdataCommitments"; type: "bytes" },
                            ];
                            internalType: "struct IExecutor.CommitBatchInfo[]";
                            name: "_newBatchesData";
                            type: "tuple[]";
                        },
                    ];
                    name: "commitBatchesSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo[]";
                            name: "_batchesData";
                            type: "tuple[]";
                        },
                    ];
                    name: "executeBatches";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo[]";
                            name: "_batchesData";
                            type: "tuple[]";
                        },
                    ];
                    name: "executeBatchesSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                {
                                    components: readonly [
                                        { internalType: "address"; name: "facet"; type: "address" },
                                        {
                                            internalType: "enum Diamond.Action";
                                            name: "action";
                                            type: "uint8";
                                        },
                                        { internalType: "bool"; name: "isFreezable"; type: "bool" },
                                        { internalType: "bytes4[]"; name: "selectors"; type: "bytes4[]" },
                                    ];
                                    internalType: "struct Diamond.FacetCut[]";
                                    name: "facetCuts";
                                    type: "tuple[]";
                                },
                                { internalType: "address"; name: "initAddress"; type: "address" },
                                { internalType: "bytes"; name: "initCalldata"; type: "bytes" },
                            ];
                            internalType: "struct Diamond.DiamondCutData";
                            name: "_diamondCut";
                            type: "tuple";
                        },
                    ];
                    name: "executeUpgrade";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "bytes4"; name: "_selector"; type: "bytes4" },
                    ];
                    name: "facetAddress";
                    outputs: readonly [
                        { internalType: "address"; name: "facet"; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "facetAddresses";
                    outputs: readonly [
                        { internalType: "address[]"; name: "facets"; type: "address[]" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_facet"; type: "address" },
                    ];
                    name: "facetFunctionSelectors";
                    outputs: readonly [
                        { internalType: "bytes4[]"; name: ""; type: "bytes4[]" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "facets";
                    outputs: readonly [
                        {
                            components: readonly [
                                { internalType: "address"; name: "addr"; type: "address" },
                                { internalType: "bytes4[]"; name: "selectors"; type: "bytes4[]" },
                            ];
                            internalType: "struct IGetters.Facet[]";
                            name: "";
                            type: "tuple[]";
                        },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_l2BatchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_l2MessageIndex"; type: "uint256" },
                        { internalType: "uint16"; name: "_l2TxNumberInBatch"; type: "uint16" },
                        { internalType: "bytes"; name: "_message"; type: "bytes" },
                        { internalType: "bytes32[]"; name: "_merkleProof"; type: "bytes32[]" },
                    ];
                    name: "finalizeEthWithdrawal";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "freezeDiamond";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getAdmin";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getBaseToken";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getBaseTokenBridge";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getBridgehub";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getFirstUnprocessedPriorityTx";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getL2BootloaderBytecodeHash";
                    outputs: readonly [
                        { internalType: "bytes32"; name: ""; type: "bytes32" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getL2DefaultAccountBytecodeHash";
                    outputs: readonly [
                        { internalType: "bytes32"; name: ""; type: "bytes32" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getL2SystemContractsUpgradeBatchNumber";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getL2SystemContractsUpgradeTxHash";
                    outputs: readonly [
                        { internalType: "bytes32"; name: ""; type: "bytes32" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getName";
                    outputs: readonly [{ internalType: "string"; name: ""; type: "string" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getPendingAdmin";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getPriorityQueueSize";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getPriorityTxMaxGasLimit";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getProtocolVersion";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getPubdataPricingMode";
                    outputs: readonly [
                        { internalType: "enum PubdataPricingMode"; name: ""; type: "uint8" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getStateTransitionManager";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getTotalBatchesCommitted";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getTotalBatchesExecuted";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getTotalBatchesVerified";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getTotalPriorityTxs";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getVerifier";
                    outputs: readonly [
                        { internalType: "address"; name: ""; type: "address" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "getVerifierParams";
                    outputs: readonly [
                        {
                            components: readonly [
                                {
                                    internalType: "bytes32";
                                    name: "recursionNodeLevelVkHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "recursionLeafLevelVkHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "recursionCircuitsSetVksHash";
                                    type: "bytes32";
                                },
                            ];
                            internalType: "struct VerifierParams";
                            name: "";
                            type: "tuple";
                        },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "isDiamondStorageFrozen";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_l2BatchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_l2MessageIndex"; type: "uint256" },
                    ];
                    name: "isEthWithdrawalFinalized";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_facet"; type: "address" },
                    ];
                    name: "isFacetFreezable";
                    outputs: readonly [
                        { internalType: "bool"; name: "isFreezable"; type: "bool" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "bytes4"; name: "_selector"; type: "bytes4" },
                    ];
                    name: "isFunctionFreezable";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_address"; type: "address" },
                    ];
                    name: "isValidator";
                    outputs: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                    ];
                    name: "l2LogsRootHash";
                    outputs: readonly [
                        { internalType: "bytes32"; name: "merkleRoot"; type: "bytes32" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_gasPrice"; type: "uint256" },
                        { internalType: "uint256"; name: "_l2GasLimit"; type: "uint256" },
                        {
                            internalType: "uint256";
                            name: "_l2GasPerPubdataByteLimit";
                            type: "uint256";
                        },
                    ];
                    name: "l2TransactionBaseCost";
                    outputs: readonly [
                        { internalType: "uint256"; name: ""; type: "uint256" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "priorityQueueFrontOperation";
                    outputs: readonly [
                        {
                            components: readonly [
                                {
                                    internalType: "bytes32";
                                    name: "canonicalTxHash";
                                    type: "bytes32";
                                },
                                {
                                    internalType: "uint64";
                                    name: "expirationTimestamp";
                                    type: "uint64";
                                },
                                { internalType: "uint192"; name: "layer2Tip"; type: "uint192" },
                            ];
                            internalType: "struct PriorityOperation";
                            name: "";
                            type: "tuple";
                        },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo";
                            name: "_prevBatch";
                            type: "tuple";
                        },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo[]";
                            name: "_committedBatches";
                            type: "tuple[]";
                        },
                        {
                            components: readonly [
                                {
                                    internalType: "uint256[]";
                                    name: "recursiveAggregationInput";
                                    type: "uint256[]";
                                },
                                {
                                    internalType: "uint256[]";
                                    name: "serializedProof";
                                    type: "uint256[]";
                                },
                            ];
                            internalType: "struct IExecutor.ProofInput";
                            name: "_proof";
                            type: "tuple";
                        },
                    ];
                    name: "proveBatches";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo";
                            name: "_prevBatch";
                            type: "tuple";
                        },
                        {
                            components: readonly [
                                { internalType: "uint64"; name: "batchNumber"; type: "uint64" },
                                { internalType: "bytes32"; name: "batchHash"; type: "bytes32" },
                                {
                                    internalType: "uint64";
                                    name: "indexRepeatedStorageChanges";
                                    type: "uint64";
                                },
                                {
                                    internalType: "uint256";
                                    name: "numberOfLayer1Txs";
                                    type: "uint256";
                                },
                                {
                                    internalType: "bytes32";
                                    name: "priorityOperationsHash";
                                    type: "bytes32";
                                },
                                { internalType: "bytes32"; name: "l2LogsTreeRoot"; type: "bytes32" },
                                { internalType: "uint256"; name: "timestamp"; type: "uint256" },
                                { internalType: "bytes32"; name: "commitment"; type: "bytes32" },
                            ];
                            internalType: "struct IExecutor.StoredBatchInfo[]";
                            name: "_committedBatches";
                            type: "tuple[]";
                        },
                        {
                            components: readonly [
                                {
                                    internalType: "uint256[]";
                                    name: "recursiveAggregationInput";
                                    type: "uint256[]";
                                },
                                {
                                    internalType: "uint256[]";
                                    name: "serializedProof";
                                    type: "uint256[]";
                                },
                            ];
                            internalType: "struct IExecutor.ProofInput";
                            name: "_proof";
                            type: "tuple";
                        },
                    ];
                    name: "proveBatchesSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { 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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_index"; type: "uint256" },
                        {
                            components: readonly [
                                { 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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                        { internalType: "uint256"; name: "_index"; type: "uint256" },
                        {
                            components: readonly [
                                {
                                    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: readonly [{ internalType: "bool"; name: ""; type: "bool" }];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_contractL2"; type: "address" },
                        { internalType: "uint256"; name: "_l2Value"; type: "uint256" },
                        { internalType: "bytes"; name: "_calldata"; 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" },
                    ];
                    name: "requestL2Transaction";
                    outputs: readonly [
                        {
                            internalType: "bytes32";
                            name: "canonicalTxHash";
                            type: "bytes32";
                        },
                    ];
                    stateMutability: "payable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_newLastBatch"; type: "uint256" },
                    ];
                    name: "revertBatches";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_chainId"; type: "uint256" },
                        { internalType: "uint256"; name: "_newLastBatch"; type: "uint256" },
                    ];
                    name: "revertBatchesSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_newPendingAdmin";
                            type: "address";
                        },
                    ];
                    name: "setPendingAdmin";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "bool"; name: "_zkPorterIsAvailable"; type: "bool" },
                    ];
                    name: "setPorterAvailability";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "uint256";
                            name: "_newPriorityTxMaxGasLimit";
                            type: "uint256";
                        },
                    ];
                    name: "setPriorityTxMaxGasLimit";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint128"; name: "_nominator"; type: "uint128" },
                        { internalType: "uint128"; name: "_denominator"; type: "uint128" },
                    ];
                    name: "setTokenMultiplier";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "address";
                            name: "_transactionFilterer";
                            type: "address";
                        },
                    ];
                    name: "setTransactionFilterer";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "address"; name: "_validator"; type: "address" },
                        { internalType: "bool"; name: "_active"; type: "bool" },
                    ];
                    name: "setValidator";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "enum PubdataPricingMode";
                            name: "_validiumMode";
                            type: "uint8";
                        },
                    ];
                    name: "setValidiumMode";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        { internalType: "uint256"; name: "_batchNumber"; type: "uint256" },
                    ];
                    name: "storedBatchHash";
                    outputs: readonly [
                        { internalType: "bytes32"; name: ""; type: "bytes32" },
                    ];
                    stateMutability: "view";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "transferEthToSharedBridge";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [];
                    name: "unfreezeDiamond";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
                {
                    inputs: readonly [
                        {
                            internalType: "uint256";
                            name: "_protocolVersion";
                            type: "uint256";
                        },
                        {
                            components: readonly [
                                {
                                    components: readonly [
                                        { internalType: "address"; name: "facet"; type: "address" },
                                        {
                                            internalType: "enum Diamond.Action";
                                            name: "action";
                                            type: "uint8";
                                        },
                                        { internalType: "bool"; name: "isFreezable"; type: "bool" },
                                        { internalType: "bytes4[]"; name: "selectors"; type: "bytes4[]" },
                                    ];
                                    internalType: "struct Diamond.FacetCut[]";
                                    name: "facetCuts";
                                    type: "tuple[]";
                                },
                                { internalType: "address"; name: "initAddress"; type: "address" },
                                { internalType: "bytes"; name: "initCalldata"; type: "bytes" },
                            ];
                            internalType: "struct Diamond.DiamondCutData";
                            name: "_cutData";
                            type: "tuple";
                        },
                    ];
                    name: "upgradeChainFromVersion";
                    outputs: readonly [];
                    stateMutability: "nonpayable";
                    type: "function";
                },
            ],
        >,
    >

  • Parameters

    • OptionalblockNumber: BlockNumberOrTag

    Returns Promise<bigint>

  • Returns the transaction confirmation data that is part of L2->L1 message.

    Parameters

    • txHash: string

      The hash of the L2 transaction where the message was initiated.

    • Optionalindex: number = 0

      In case there were multiple transactions in one message, you may pass an index of the transaction which confirmation data should be fetched.

    Returns Promise<
        {
            l1BatchNumber: string
            | number
            | bigint;
            l2MessageIndex: Numbers;
            l2TxNumberInBlock: string | number | bigint;
            proof: string[];
        },
    >

    If log proof can not be found.

  • Returns the parameters for the approval token transaction based on the request execute transaction. Existing allowance for the bridge is not checked; allowance is calculated solely based on the specified transaction.

    Parameters

    • transaction: RequestExecuteDetails

      The request execute transaction on which approval parameters are calculated.

    Returns Promise<{ allowance: Numbers; token: string }>

  • Parameters

    Returns Promise<
        {
            method: PayableMethodObject<
                [
                    {
                        chainId: MatchPrimitiveType<"uint256", unknown>;
                        factoryDeps: Bytes[];
                        l2Calldata: MatchPrimitiveType<"bytes", unknown>;
                        l2Contract: string;
                        l2GasLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2GasPerPubdataByteLimit: MatchPrimitiveType<"uint256", unknown>;
                        l2Value: MatchPrimitiveType<"uint256", unknown>;
                        mintValue: MatchPrimitiveType<"uint256", unknown>;
                        refundRecipient: string;
                    },
                ],
                Bytes,
            >;
            overrides: TransactionOverrides;
        },
    >

  • Returns a populated request execute transaction.

    Parameters

    Returns Promise<TransactionCall>

  • Returns whether the chain is ETH-based.

    Returns Promise<boolean>

  • Returns whether the withdrawal transaction is finalized on the L1 network.

    Parameters

    • withdrawalHash: Bytes

      Hash of the L2 transaction where the withdrawal was initiated.

    • Optionalindex: number = 0

      In case there were multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize.

    Returns Promise<boolean>

    If log proof can not be found.

  • Returns the L2 token address equivalent for a L1 token address as they are not necessarily equal. The ETH address is set to the zero address.

    Parameters

    • token: string

      The address of the token on L1.

    Returns Promise<string>

    Only works for tokens bridged on default ZKsync Era bridges.

  • Designed for users who prefer a simplified approach by providing only the necessary data to create a valid transaction. The only required fields are transaction.to and either transaction.data or transaction.value (or both, if the method is payable). Any other fields that are not set will be prepared by this method.

    Parameters

    Returns Promise<
        DeepWriteable<
            Transaction & { customData?: null
            | Eip712Meta; type?: Numbers },
        >,
    >

    import { Transaction, utils, Web3 } from "web3";
    import { types, ZkSyncPlugin, ZKsyncWallet } from "web3-plugin-zksync";

    async function main() {
    const web3: Web3 = new Web3("https://rpc.sepolia.org");
    web3.registerPlugin(new ZkSyncPlugin("https://sepolia.era.zksync.dev"));

    const zksync: ZkSyncPlugin = web3.zkSync;
    const PRIVATE_KEY: string = "<WALLET_PRIVATE_KEY>";
    const wallet: ZKsyncWallet = new zksync.ZkWallet(PRIVATE_KEY);

    const EIP712_TX_TYPE = 0x71;
    const TO_ADDRESS = "<TO_ADDRESS>";
    const populatedTx: types.Eip712TxData | Transaction = await wallet.populateTransaction({
    type: utils.toHex(EIP712_TX_TYPE),
    to: TO_ADDRESS,
    value: utils.toHex(7_000_000_000),
    });
    }
  • Parameters

    • signedTx: string

    Returns Promise<string>