zksync-ethers
Version:
A Web3 library for interacting with the ZkSync Layer 2 scaling solution.
1,246 lines (1,242 loc) • 23.9 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
IL1AssetRouter,
IL1AssetRouterInterface,
} from "../IL1AssetRouter";
const _abi = [
{
inputs: [
{
internalType: "address",
name: "_l1WethAddress",
type: "address",
},
{
internalType: "address",
name: "_bridgehub",
type: "address",
},
{
internalType: "address",
name: "_l1Nullifier",
type: "address",
},
{
internalType: "uint256",
name: "_eraChainId",
type: "uint256",
},
{
internalType: "address",
name: "_eraDiamondProxy",
type: "address",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
inputs: [
{
internalType: "address",
name: "addr",
type: "address",
},
],
name: "AddressAlreadyUsed",
type: "error",
},
{
inputs: [
{
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
],
name: "AssetHandlerDoesNotExist",
type: "error",
},
{
inputs: [
{
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
],
name: "AssetIdNotSupported",
type: "error",
},
{
inputs: [],
name: "NotInitializedReentrancyGuard",
type: "error",
},
{
inputs: [],
name: "Reentrancy",
type: "error",
},
{
inputs: [],
name: "SlotOccupied",
type: "error",
},
{
inputs: [
{
internalType: "address",
name: "token",
type: "address",
},
],
name: "TokenNotSupported",
type: "error",
},
{
inputs: [
{
internalType: "address",
name: "caller",
type: "address",
},
],
name: "Unauthorized",
type: "error",
},
{
inputs: [],
name: "UnsupportedEncodingVersion",
type: "error",
},
{
inputs: [],
name: "ZeroAddress",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "assetDeploymentTracker",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "additionalData",
type: "bytes32",
},
],
name: "AssetDeploymentTrackerSet",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "_assetAddress",
type: "address",
},
],
name: "AssetHandlerRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "assetHandlerAddress",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "additionalData",
type: "bytes32",
},
{
indexed: false,
internalType: "address",
name: "assetDeploymentTracker",
type: "address",
},
],
name: "AssetHandlerRegisteredInitial",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "address",
name: "from",
type: "address",
},
{
indexed: false,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "BridgehubDepositBaseTokenInitiated",
type: "event",
},
{
anonymous: false,
inputs: [
{
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: [
{
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: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes",
name: "bridgeMintCalldata",
type: "bytes",
},
],
name: "BridgehubDepositInitiated",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "bytes",
name: "bridgeMintData",
type: "bytes",
},
],
name: "BridgehubMintData",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes32",
name: "assetDataHash",
type: "bytes32",
},
],
name: "BridgehubWithdrawalInitiated",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes",
name: "assetData",
type: "bytes",
},
],
name: "ClaimedFailedDepositAssetRouter",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "chainId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes",
name: "assetData",
type: "bytes",
},
],
name: "DepositFinalizedAssetRouter",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint8",
name: "version",
type: "uint8",
},
],
name: "Initialized",
type: "event",
},
{
anonymous: false,
inputs: [
{
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: "l1Asset",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "LegacyDepositInitiated",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferStarted",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address",
},
],
name: "Paused",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address",
},
],
name: "Unpaused",
type: "event",
},
{
inputs: [],
name: "BRIDGE_HUB",
outputs: [
{
internalType: "contract IBridgehub",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "ERA_CHAIN_ID",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "L1_CHAIN_ID",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "L1_NULLIFIER",
outputs: [
{
internalType: "contract IL1Nullifier",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "L1_WETH_TOKEN",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "acceptOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
],
name: "assetDeploymentTracker",
outputs: [
{
internalType: "address",
name: "assetDeploymentTracker",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "assetId",
type: "bytes32",
},
],
name: "assetHandlerAddress",
outputs: [
{
internalType: "address",
name: "assetHandlerAddress",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "address",
name: "_depositSender",
type: "address",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "bytes",
name: "_assetData",
type: "bytes",
},
],
name: "bridgeRecoverFailedTransfer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "address",
name: "_depositSender",
type: "address",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "bytes",
name: "_assetData",
type: "bytes",
},
{
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: "bridgeRecoverFailedTransfer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_txDataHash",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_txHash",
type: "bytes32",
},
],
name: "bridgehubConfirmL2Transaction",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "address",
name: "_originalCaller",
type: "address",
},
{
internalType: "uint256",
name: "_value",
type: "uint256",
},
{
internalType: "bytes",
name: "_data",
type: "bytes",
},
],
name: "bridgehubDeposit",
outputs: [
{
components: [
{
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: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "address",
name: "_originalCaller",
type: "address",
},
{
internalType: "uint256",
name: "_amount",
type: "uint256",
},
],
name: "bridgehubDepositBaseToken",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
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: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_originalCaller",
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: [
{
internalType: "bytes32",
name: "txHash",
type: "bytes32",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "bytes",
name: "_transferData",
type: "bytes",
},
],
name: "finalizeDeposit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
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: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_sender",
type: "address",
},
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "bytes",
name: "_assetData",
type: "bytes",
},
],
name: "getDepositCalldata",
outputs: [
{
internalType: "bytes",
name: "",
type: "bytes",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_owner",
type: "address",
},
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_chainId",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2BatchNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
],
name: "isWithdrawalFinalized",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "legacyBridge",
outputs: [
{
internalType: "contract IL1ERC20Bridge",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "nativeTokenVault",
outputs: [
{
internalType: "contract INativeTokenVault",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "paused",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "pendingOwner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_assetRegistrationData",
type: "bytes32",
},
{
internalType: "address",
name: "_assetDeploymentTracker",
type: "address",
},
],
name: "setAssetDeploymentTracker",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_assetRegistrationData",
type: "bytes32",
},
{
internalType: "address",
name: "_assetHandlerAddress",
type: "address",
},
],
name: "setAssetHandlerAddressThisChain",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract IL1ERC20Bridge",
name: "_legacyBridge",
type: "address",
},
],
name: "setL1Erc20Bridge",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract INativeTokenVault",
name: "_nativeTokenVault",
type: "address",
},
],
name: "setNativeTokenVault",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_assetId",
type: "bytes32",
},
{
internalType: "uint256",
name: "_amount",
type: "uint256",
},
{
internalType: "address",
name: "_originalCaller",
type: "address",
},
],
name: "transferFundsToNTV",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "unpause",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
export class IL1AssetRouter__factory {
static readonly abi = _abi;
static createInterface(): IL1AssetRouterInterface {
return new Interface(_abi) as IL1AssetRouterInterface;
}
static connect(
address: string,
runner?: ContractRunner | null
): IL1AssetRouter {
return new Contract(address, _abi, runner) as unknown as IL1AssetRouter;
}
}