Socket
Socket
Sign inDemoInstall

zksync-web3

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zksync-web3 - npm Package Compare versions

Comparing version 0.2.11 to 0.3.0

450

abi/IERC20.json

@@ -1,224 +0,226 @@

[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
{
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}

@@ -1,342 +0,344 @@

[
{
"inputs": [
{
"components": [
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct IZkSyncL2Proto.DeployContract",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "deployContract",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "contractAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct IZkSyncL2Proto.Execute",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "execute",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "accountAddress",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.MigrateToPorter",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "migrateToPorter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.Transfer",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "transfer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.Withdraw",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
{
"abi": [
{
"inputs": [
{
"components": [
{
"internalType": "bytes",
"name": "bytecode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct IZkSyncL2Proto.DeployContract",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "deployContract",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "contractAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct IZkSyncL2Proto.Execute",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "execute",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "accountAddress",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.MigrateToPorter",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "migrateToPorter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.Transfer",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "transfer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"internalType": "struct IZkSyncL2Proto.Withdraw",
"name": "",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "validFrom",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "validTo",
"type": "uint64"
},
{
"internalType": "address",
"name": "feeToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "fee",
"type": "uint256"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes1[65]",
"name": "signature",
"type": "bytes1[65]"
}
],
"internalType": "struct IZkSyncL2Proto.CommonData",
"name": "",
"type": "tuple"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}

@@ -1,1034 +0,1431 @@

[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
}
],
"name": "BlockCommit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
}
],
"name": "BlockVerification",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "totalBlocksVerified",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint32",
"name": "totalBlocksCommitted",
"type": "uint32"
}
],
"name": "BlocksRevert",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "zkSyncTokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "zkSyncBlockId",
"type": "uint32"
},
{
"indexed": true,
"internalType": "uint32",
"name": "accountId",
"type": "uint32"
},
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "zkSyncTokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "DepositCommit",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "ExodusMode",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint32",
"name": "nonce",
"type": "uint32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "fact",
"type": "bytes"
}
],
"name": "FactAuth",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint64",
"name": "serialId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "enum Operations.OpType",
"name": "opType",
"type": "uint8"
},
{
"indexed": false,
"internalType": "bytes",
"name": "pubData",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint256",
"name": "expirationBlock",
"type": "uint256"
}
],
"name": "NewPriorityRequest",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "zkSyncBlockId",
"type": "uint32"
},
{
"indexed": true,
"internalType": "uint32",
"name": "accountId",
"type": "uint32"
},
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "zkSyncTokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrawCommit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "zkSyncTokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_token",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_maxAmount",
"type": "uint256"
}
],
"name": "_transferERC20",
"outputs": [
{
"internalType": "uint128",
"name": "withdrawnAmount",
"type": "uint128"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "activateExodusMode",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"name": "addToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "addedTokens",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "_n",
"type": "uint64"
},
{
"internalType": "bytes[]",
"name": "_depositsPubdata",
"type": "bytes[]"
}
],
"name": "cancelOutstandingDepositsForExodusMode",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "pendingOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct Storage.StoredBlockInfo",
"name": "_lastCommittedBlockData",
"type": "tuple"
},
{
"components": [
{
"internalType": "bytes32",
"name": "newStateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "address",
"name": "feeAccount",
"type": "address"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "unpriorityOpsOnchainDataHash",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "priorityOperationsData",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "deployedContracts",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "storageUpdateLogs",
"type": "bytes"
}
],
"internalType": "struct Executor.CommitBlockInfo[]",
"name": "_newBlocksData",
"type": "tuple[]"
}
],
"name": "commitBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_zkSyncAddress",
"type": "address"
}
],
"name": "depositERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_zkSyncAddress",
"type": "address"
}
],
"name": "depositETH",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "pendingOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct Storage.StoredBlockInfo",
"name": "storedBlock",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "pendingOnchainOpsPubdata",
"type": "bytes"
}
],
"internalType": "struct Executor.ExecuteBlockInfo[]",
"name": "_blocksData",
"type": "tuple[]"
}
],
"name": "executeBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "exodusMode",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "firstPriorityRequestId",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getNoticePeriod",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"name": "getPendingBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "governance",
"outputs": [
{
"internalType": "contract Governance",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "initializationParameters",
"type": "bytes"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "isReadyForUpgrade",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "pendingOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct Storage.StoredBlockInfo",
"name": "_storedBlockInfo",
"type": "tuple"
},
{
"internalType": "address",
"name": "_owner",
"type": "address"
},
{
"internalType": "uint32",
"name": "_accountId",
"type": "uint32"
},
{
"internalType": "address",
"name": "_zkSyncTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "_proof",
"type": "uint256[]"
}
],
"name": "performExodus",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "performedExodus",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "pendingOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct Storage.StoredBlockInfo[]",
"name": "_committedBlocks",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "uint256[]",
"name": "recursiveInput",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "proof",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "commitments",
"type": "uint256[]"
},
{
"internalType": "uint8[]",
"name": "vkIndexes",
"type": "uint8[]"
},
{
"internalType": "uint256[16]",
"name": "subproofsLimbs",
"type": "uint256[16]"
}
],
"internalType": "struct Executor.ProofInput",
"name": "_proof",
"type": "tuple"
}
],
"name": "proveBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "requestMigrateToPorter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
}
],
"name": "requestWithdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint64",
"name": "lastProcessedPriorityOp",
"type": "uint64"
},
{
"internalType": "bytes32",
"name": "pendingOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct Storage.StoredBlockInfo[]",
"name": "_blocksToRevert",
"type": "tuple[]"
}
],
"name": "revertBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "totalBlocksCommitted",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalBlocksExecuted",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalBlocksProven",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalCommittedPriorityRequests",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalPriorityRequests",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "upgradeParameters",
"type": "bytes"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgradeCanceled",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgradeFinishes",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgradeNoticePeriodStarted",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "upgradePreparationStarted",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "verifier",
"outputs": [
{
"internalType": "contract Verifier",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_owner",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawPendingBalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
{
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
}
],
"name": "BlockCommit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
}
],
"name": "BlockExecution",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "totalBlocksVerified",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint32",
"name": "totalBlocksCommitted",
"type": "uint32"
}
],
"name": "BlocksRevert",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"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[]"
}
],
"indexed": false,
"internalType": "struct Diamond.FacetCut[]",
"name": "_facetCuts",
"type": "tuple[]"
},
{
"indexed": false,
"internalType": "address",
"name": "_initAddress",
"type": "address"
}
],
"name": "DiamondCutProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "DiamondCutProposalCancelation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"components": [
{
"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": "DiamondCutProposalExecution",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "EmergencyDiamondCutApproved",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "EmergencyFreeze",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "expirationBlock",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint64[]",
"name": "operationIDs",
"type": "uint64[]"
},
{
"indexed": false,
"internalType": "enum Operations.OpTree",
"name": "opTree",
"type": "uint8"
}
],
"name": "MovePriorityOperationsFromBufferToHeap",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "newGovernor",
"type": "address"
}
],
"name": "NewGovernor",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "enum Operations.OpTree",
"name": "opTree",
"type": "uint8"
},
{
"indexed": false,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint96",
"name": "bidAmount",
"type": "uint96"
},
{
"indexed": false,
"internalType": "uint256",
"name": "complexity",
"type": "uint256"
}
],
"name": "NewPriorityModeAuctionBid",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "enum PriorityModeLib.Epoch",
"name": "subEpoch",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint128",
"name": "subEpochEndTimestamp",
"type": "uint128"
}
],
"name": "NewPriorityModeSubEpoch",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "serialId",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes",
"name": "opMetadata",
"type": "bytes"
}
],
"name": "NewPriorityRequest",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "PriorityModeActivated",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Unfreeze",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "validatorAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "ValidatorStatusUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "zkSyncTokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrawPendingBalance",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_ethExpirationBlock",
"type": "uint32"
}
],
"name": "activatePriorityMode",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "addCustomToken",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_token",
"type": "address"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "addToken",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_gasPrice",
"type": "uint256"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "addTokenBaseCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_diamondCutHash",
"type": "bytes32"
}
],
"name": "approveEmergencyDiamondCutAsSecurityCouncilMember",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "cancelDiamondCutProposal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newGovernor",
"type": "address"
}
],
"name": "changeGovernor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint16",
"name": "numberOfLayer1Txs",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "numberOfLayer2Txs",
"type": "uint16"
},
{
"internalType": "uint224",
"name": "priorityOperationsComplexity",
"type": "uint224"
},
{
"internalType": "bytes32",
"name": "processableOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "priorityOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct IExecutor.StoredBlockInfo",
"name": "_lastCommittedBlockData",
"type": "tuple"
},
{
"components": [
{
"internalType": "bytes32",
"name": "newStateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "address",
"name": "feeAccount",
"type": "address"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint224",
"name": "priorityOperationsComplexity",
"type": "uint224"
},
{
"internalType": "uint16",
"name": "numberOfLayer1Txs",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "numberOfLayer2Txs",
"type": "uint16"
},
{
"internalType": "bytes32",
"name": "processableOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "priorityOperationsHash",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "deployedContracts",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "storageUpdateLogs",
"type": "bytes"
},
{
"components": [
{
"internalType": "uint32",
"name": "round",
"type": "uint32"
},
{
"components": [
{
"internalType": "bytes",
"name": "pubkey",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct IExecutor.PublicWithSignature[]",
"name": "sigs",
"type": "tuple[]"
},
{
"internalType": "uint32",
"name": "stake",
"type": "uint32"
}
],
"internalType": "struct IExecutor.QuorumSigs",
"name": "zkPorterData",
"type": "tuple"
}
],
"internalType": "struct IExecutor.CommitBlockInfo[]",
"name": "_newBlocksData",
"type": "tuple[]"
}
],
"name": "commitBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_gasPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_ergsLimit",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_bytecodeLength",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "_calldataLength",
"type": "uint32"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "deployContractBaseCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_gasPrice",
"type": "uint256"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "depositBaseCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_zkSyncAddress",
"type": "address"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "depositERC20",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_zkSyncAddress",
"type": "address"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "depositETH",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "emergencyFreezeDiamond",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_gasPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_ergsLimit",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_calldataLength",
"type": "uint32"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "executeBaseCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint16",
"name": "numberOfLayer1Txs",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "numberOfLayer2Txs",
"type": "uint16"
},
{
"internalType": "uint224",
"name": "priorityOperationsComplexity",
"type": "uint224"
},
{
"internalType": "bytes32",
"name": "processableOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "priorityOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct IExecutor.StoredBlockInfo",
"name": "storedBlock",
"type": "tuple"
},
{
"internalType": "bytes",
"name": "processableOnchainOperations",
"type": "bytes"
}
],
"internalType": "struct IExecutor.ExecuteBlockInfo[]",
"name": "_blocksData",
"type": "tuple[]"
}
],
"name": "executeBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"components": [
{
"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": "executeDiamondCutProposal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getGovernor",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
}
],
"name": "getPendingBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalBlocksCommitted",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalBlocksExecuted",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalBlocksVerified",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalPriorityRequests",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getVerifier",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "isValidator",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_nOpsToMove",
"type": "uint256"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "movePriorityOpsFromBufferToMainQueue",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint112",
"name": "_complexityRoot",
"type": "uint112"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "placeBidForBlocksProcessingAuction",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"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"
}
],
"name": "proposeDiamondCut",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint16",
"name": "numberOfLayer1Txs",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "numberOfLayer2Txs",
"type": "uint16"
},
{
"internalType": "uint224",
"name": "priorityOperationsComplexity",
"type": "uint224"
},
{
"internalType": "bytes32",
"name": "processableOnchainOperationsHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "priorityOperationsHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "stateRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "zkPorterRoot",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "commitment",
"type": "bytes32"
}
],
"internalType": "struct IExecutor.StoredBlockInfo[]",
"name": "_committedBlocks",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "uint256[]",
"name": "recursiveInput",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "proof",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "commitments",
"type": "uint256[]"
},
{
"internalType": "uint8[]",
"name": "vkIndexes",
"type": "uint8[]"
},
{
"internalType": "uint256[16]",
"name": "subproofsLimbs",
"type": "uint256[16]"
}
],
"internalType": "struct IExecutor.ProofInput",
"name": "_proof",
"type": "tuple"
}
],
"name": "proveBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_bytecode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "_ergsLimit",
"type": "uint256"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "requestDeployContract",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_contractAddressL2",
"type": "address"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "_ergsLimit",
"type": "uint256"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "requestExecute",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "requestWithdraw",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_blocksToRevert",
"type": "uint32"
}
],
"name": "revertBlocks",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_validator",
"type": "address"
},
{
"internalType": "bool",
"name": "_active",
"type": "bool"
}
],
"name": "setValidator",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unfreezeDiamond",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "updatePriorityModeSubEpoch",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_gasPrice",
"type": "uint256"
},
{
"internalType": "enum Operations.QueueType",
"name": "_queueType",
"type": "uint8"
},
{
"internalType": "enum Operations.OpTree",
"name": "_opTree",
"type": "uint8"
}
],
"name": "withdrawBaseCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_owner",
"type": "address"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawPendingBalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}

@@ -1,4 +0,4 @@

import { BigNumber, BigNumberish, ethers } from 'ethers';
import { BigNumber, BigNumberish, ethers, BytesLike } from 'ethers';
import { Provider } from './provider';
import { Address, PriorityOpResponse, BlockTag, Eip712Meta } from './types';
import { Address, PriorityOpResponse, BlockTag, Eip712Meta, PriorityQueueType, PriorityOpTree, TransactionResponse } from './types';
declare type Constructor<T = {}> = new (...args: any[]) => T;

@@ -16,3 +16,33 @@ interface TxSender {

getBalanceL1(token?: Address, blockTag?: ethers.providers.BlockTag): Promise<BigNumber>;
approveERC20(token: Address, amount: BigNumberish, overrides?: ethers.CallOverrides): Promise<ethers.providers.TransactionResponse | null>;
approveERC20(token: Address, amount: BigNumberish, overrides?: ethers.CallOverrides): Promise<ethers.providers.TransactionResponse>;
depositBaseCost(params?: {
gasPrice?: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
}): Promise<BigNumber>;
addTokenBaseCost(params?: {
gasPrice?: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
}): Promise<BigNumber>;
withdrawBaseCost(params?: {
gasPrice?: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
}): Promise<BigNumber>;
executeBaseCost(params: {
ergsLimit: BigNumberish;
calldataLength: BigNumberish;
gasPrice?: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
}): Promise<BigNumber>;
deployContractBaseCost(params?: {
ergsLimit: BigNumberish;
bytecodeLength: BigNumberish;
calldataLength: BigNumberish;
gasPrice?: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
}): Promise<BigNumber>;
deposit(transaction: {

@@ -22,2 +52,5 @@ token: Address;

to?: Address;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
operatorTip?: BigNumberish;
approveERC20?: boolean;

@@ -27,3 +60,36 @@ overrides?: ethers.CallOverrides;

}): Promise<PriorityOpResponse>;
addToken(token: Address, overrides?: ethers.CallOverrides): Promise<PriorityOpResponse>;
addToken(transaction: {
token: Address;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
operatorTip?: BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<PriorityOpResponse>;
requestL1Withdraw(transaction: {
token: Address;
amount: BigNumberish;
to: Address;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
operatorTip?: BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<PriorityOpResponse>;
requestL1Execute(transaction: {
contractAddress: Address;
calldata: BytesLike;
ergsLimit: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
operatorTip?: BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<PriorityOpResponse>;
requestL1DeployContract(transaction: {
bytecode: BytesLike;
calldata: BytesLike;
ergsLimit: BigNumberish;
queueType?: PriorityQueueType;
opTree?: PriorityOpTree;
operatorTip?: BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<PriorityOpResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -48,3 +114,3 @@ getAddress(): Promise<string>;

gasLimit?: BigNumberish;
}): Promise<ethers.providers.TransactionResponse>;
}): Promise<TransactionResponse>;
transfer(tx: {

@@ -59,3 +125,3 @@ to: Address;

gasLimit?: BigNumberish;
}): Promise<any>;
}): Promise<TransactionResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -62,0 +128,0 @@ getAddress(): Promise<string>;

@@ -34,6 +34,2 @@ "use strict";

const mainContract = await this._providerL2().getMainContractAddress();
const allowance = await erc20contract.allowance(await this.getAddress(), mainContract);
if (allowance.gte(amount)) {
return null;
}
let gasLimit;

@@ -53,24 +49,65 @@ if (overrides === null || overrides === void 0 ? void 0 : overrides.gasLimit) {

}
async depositBaseCost(params) {
var _a;
const zksyncContract = await this.getMainContract();
const parameters = { ...(0, utils_1.layer1TxDefaults)(), ...params };
(_a = parameters.gasPrice) !== null && _a !== void 0 ? _a : (parameters.gasPrice = await this._providerL1().getGasPrice());
return ethers_1.BigNumber.from(await zksyncContract.depositBaseCost(parameters.gasPrice, parameters.queueType, parameters.opTree));
}
async addTokenBaseCost(params) {
var _a;
const zksyncContract = await this.getMainContract();
const parameters = { ...(0, utils_1.layer1TxDefaults)(), ...params };
(_a = parameters.gasPrice) !== null && _a !== void 0 ? _a : (parameters.gasPrice = await this._providerL1().getGasPrice());
return ethers_1.BigNumber.from(await zksyncContract.addTokenBaseCost(parameters.gasPrice, parameters.queueType, parameters.opTree));
}
async withdrawBaseCost(params) {
var _a;
const zksyncContract = await this.getMainContract();
const parameters = { ...(0, utils_1.layer1TxDefaults)(), ...params };
(_a = parameters.gasPrice) !== null && _a !== void 0 ? _a : (parameters.gasPrice = await this._providerL1().getGasPrice());
return ethers_1.BigNumber.from(await zksyncContract.withdrawBaseCost(parameters.gasPrice, parameters.queueType, parameters.opTree));
}
async executeBaseCost(params) {
var _a;
const zksyncContract = await this.getMainContract();
const parameters = { ...(0, utils_1.layer1TxDefaults)(), ...params };
(_a = parameters.gasPrice) !== null && _a !== void 0 ? _a : (parameters.gasPrice = await this._providerL1().getGasPrice());
return ethers_1.BigNumber.from(await zksyncContract.executeBaseCost(parameters.gasPrice, parameters.ergsLimit, parameters.calldataLength, parameters.queueType, parameters.opTree));
}
async deployContractBaseCost(params) {
var _a;
const zksyncContract = await this.getMainContract();
const parameters = { ...(0, utils_1.layer1TxDefaults)(), ...params };
(_a = parameters.gasPrice) !== null && _a !== void 0 ? _a : (parameters.gasPrice = await this._providerL1().getGasPrice());
return ethers_1.BigNumber.from(await zksyncContract.deployContractBaseCost(parameters.gasPrice, parameters.ergsLimit, parameters.bytecodeLength, parameters.calldataLength, parameters.queueType, parameters.opTree));
}
async deposit(transaction) {
var _a, _b;
var _a, _b, _c, _d, _e, _f, _g, _h;
const zksyncContract = await this.getMainContract();
const { token, amount } = transaction;
const depositTo = (_a = transaction.to) !== null && _a !== void 0 ? _a : (await this.getAddress());
const tx = Object.assign((0, utils_1.layer1TxDefaults)(), transaction);
(_a = tx.to) !== null && _a !== void 0 ? _a : (tx.to = await this.getAddress());
(_b = tx.operatorTip) !== null && _b !== void 0 ? _b : (tx.operatorTip = ethers_1.BigNumber.from(0));
(_c = tx.overrides) !== null && _c !== void 0 ? _c : (tx.overrides = {});
const { to, token, amount, queueType, opTree, operatorTip, overrides } = tx;
(_d = overrides.gasPrice) !== null && _d !== void 0 ? _d : (overrides.gasPrice = await this._providerL1().getGasPrice());
const baseCost = ethers_1.BigNumber.from(await zksyncContract.depositBaseCost(overrides.gasPrice, queueType, opTree));
if ((0, utils_1.isETH)(token)) {
return await this._providerL2().getPriorityOpResponse(await zksyncContract.depositETH(depositTo, {
value: ethers_1.BigNumber.from(amount),
(_e = overrides.value) !== null && _e !== void 0 ? _e : (overrides.value = baseCost.add(operatorTip).add(amount));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.depositETH(amount, to, queueType, opTree, {
gasLimit: ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.ETH_DEPOSIT),
...transaction.overrides
...overrides
}));
}
else {
(_f = overrides.value) !== null && _f !== void 0 ? _f : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
let nonce = undefined;
if (transaction.approveERC20) {
const approveTx = await this.approveERC20(token, amount, transaction.approveOverrides);
if (approveTx != null) {
nonce = approveTx.nonce + 1;
}
nonce = approveTx.nonce + 1;
}
const overrides = { nonce, ...transaction.overrides };
const args = [token, amount, depositTo];
(_g = overrides.nonce) !== null && _g !== void 0 ? _g : (overrides.nonce = nonce);
const args = [token, amount, to, queueType, opTree];
if (overrides.gasLimit == null) {

@@ -80,3 +117,3 @@ const gasEstimate = await zksyncContract.estimateGas

.catch(() => ethers_1.BigNumber.from(0));
const recommendedGasLimit = (_b = utils_1.RECOMMENDED_GAS_LIMIT.ERC20_DEPOSIT[token]) !== null && _b !== void 0 ? _b : utils_1.RECOMMENDED_GAS_LIMIT.ERC20_DEFAULT_DEPOSIT;
const recommendedGasLimit = (_h = utils_1.RECOMMENDED_GAS_LIMIT.ERC20_DEPOSIT[token]) !== null && _h !== void 0 ? _h : utils_1.RECOMMENDED_GAS_LIMIT.ERC20_DEFAULT_DEPOSIT;
overrides.gasLimit = gasEstimate.gte(recommendedGasLimit) ? gasEstimate : recommendedGasLimit;

@@ -87,5 +124,14 @@ }

}
async addToken(token, overrides) {
async addToken(transaction) {
var _a, _b, _c, _d;
const zksyncContract = await this.getMainContract();
return await this._providerL2().getPriorityOpResponse(await zksyncContract.addToken(token, {
const tx = Object.assign((0, utils_1.layer1TxDefaults)(), transaction);
(_a = tx.operatorTip) !== null && _a !== void 0 ? _a : (tx.operatorTip = ethers_1.BigNumber.from(0));
(_b = tx.overrides) !== null && _b !== void 0 ? _b : (tx.overrides = {});
const { token, queueType, opTree, operatorTip, overrides } = tx;
(_c = overrides.gasPrice) !== null && _c !== void 0 ? _c : (overrides.gasPrice = await this._providerL1().getGasPrice());
const baseCost = ethers_1.BigNumber.from(await zksyncContract.addTokenBaseCost(overrides.gasPrice, queueType, opTree));
(_d = overrides.value) !== null && _d !== void 0 ? _d : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.addToken(token, queueType, opTree, {
gasLimit: ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.ADD_TOKEN),

@@ -95,2 +141,50 @@ ...overrides

}
async requestL1Withdraw(transaction) {
var _a, _b, _c, _d;
const zksyncContract = await this.getMainContract();
const tx = Object.assign((0, utils_1.layer1TxDefaults)(), transaction);
(_a = tx.operatorTip) !== null && _a !== void 0 ? _a : (tx.operatorTip = ethers_1.BigNumber.from(0));
(_b = tx.overrides) !== null && _b !== void 0 ? _b : (tx.overrides = {});
const { token, queueType, opTree, operatorTip, overrides, to, amount } = tx;
(_c = overrides.gasPrice) !== null && _c !== void 0 ? _c : (overrides.gasPrice = await this._providerL1().getGasPrice());
const baseCost = ethers_1.BigNumber.from(await zksyncContract.withdrawBaseCost(overrides.gasPrice, queueType, opTree));
(_d = overrides.value) !== null && _d !== void 0 ? _d : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.requestWithdraw(token, amount, to, queueType, opTree, {
gasLimit: ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.WITHDRAW),
...overrides
}));
}
async requestL1Execute(transaction) {
var _a, _b, _c, _d;
const zksyncContract = await this.getMainContract();
const tx = Object.assign((0, utils_1.layer1TxDefaults)(), transaction);
(_a = tx.operatorTip) !== null && _a !== void 0 ? _a : (tx.operatorTip = ethers_1.BigNumber.from(0));
(_b = tx.overrides) !== null && _b !== void 0 ? _b : (tx.overrides = {});
const { contractAddress, calldata, ergsLimit, queueType, opTree, operatorTip, overrides } = tx;
(_c = overrides.gasPrice) !== null && _c !== void 0 ? _c : (overrides.gasPrice = await this._providerL1().getGasPrice());
const baseCost = ethers_1.BigNumber.from(await zksyncContract.executeBaseCost(overrides.gasPrice, ergsLimit, ethers_1.ethers.utils.hexDataLength(calldata), queueType, opTree));
(_d = overrides.value) !== null && _d !== void 0 ? _d : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.requestExecute(contractAddress, calldata, ergsLimit, queueType, opTree, {
gasLimit: ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.EXECUTE),
...overrides
}));
}
async requestL1DeployContract(transaction) {
var _a, _b, _c, _d;
const zksyncContract = await this.getMainContract();
const tx = Object.assign((0, utils_1.layer1TxDefaults)(), transaction);
(_a = tx.operatorTip) !== null && _a !== void 0 ? _a : (tx.operatorTip = ethers_1.BigNumber.from(0));
(_b = tx.overrides) !== null && _b !== void 0 ? _b : (tx.overrides = {});
const { bytecode, calldata, ergsLimit, queueType, opTree, operatorTip, overrides } = tx;
(_c = overrides.gasPrice) !== null && _c !== void 0 ? _c : (overrides.gasPrice = await this._providerL1().getGasPrice());
const baseCost = ethers_1.BigNumber.from(await zksyncContract.deployContractBaseCost(overrides.gasPrice, ergsLimit, ethers_1.ethers.utils.hexDataLength(bytecode), ethers_1.ethers.utils.hexDataLength(calldata), queueType, opTree));
(_d = overrides.value) !== null && _d !== void 0 ? _d : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.requestDeployContract(bytecode, calldata, ergsLimit, queueType, opTree, {
gasLimit: ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.DEPLOY_CONTRACT),
...overrides
}));
}
};

@@ -124,3 +218,3 @@ }

var _a;
return await this.sendTransaction({
const txResponse = await this.sendTransaction({
value: tx.amount,

@@ -137,2 +231,3 @@ to: (_a = tx.to) !== null && _a !== void 0 ? _a : (await this.getAddress()),

});
return this._providerL2()._wrapTransaction(txResponse);
}

@@ -139,0 +234,0 @@ async transfer(tx) {

@@ -9,4 +9,2 @@ import { ethers, BigNumber, utils } from 'ethers';

protected contractAddress: Address;
/** @deprecated use getGasPrice() instead */
estimateGasPrice(_?: any): Promise<BigNumber>;
getBalance(address: Address, blockTag?: BlockTag, tokenAddress?: Address): Promise<ethers.BigNumber>;

@@ -17,2 +15,3 @@ static hexlifyTransaction(transaction: ethers.providers.TransactionRequest, allowExtra?: Record<string, boolean>): {

estimateGas(transaction: utils.Deferrable<TransactionRequest>): Promise<BigNumber>;
getGasPrice(token?: Address): Promise<BigNumber>;
constructor(url?: ConnectionInfo | string, network?: ethers.providers.Networkish);

@@ -19,0 +18,0 @@ getMainContractAddress(): Promise<Address>;

@@ -22,6 +22,2 @@ "use strict";

}
/** @deprecated use getGasPrice() instead */
async estimateGasPrice(_) {
return await this.getGasPrice();
}
async getBalance(address, blockTag, tokenAddress) {

@@ -83,2 +79,7 @@ const tag = this.formatter.blockTag(blockTag);

}
async getGasPrice(token) {
token !== null && token !== void 0 ? token : (token = utils_1.ETH_ADDRESS);
const price = await this.send('eth_gasPrice', [token]);
return ethers_1.BigNumber.from(price);
}
async getMainContractAddress() {

@@ -183,3 +184,3 @@ if (!this.contractAddress) {

const receipt = await l1TxResponse.wait();
const l2Hash = (0, utils_1.getL2HashFromPriorityOp)(receipt);
const l2Hash = (0, utils_1.getL2HashFromPriorityOp)(receipt, await this.getMainContractAddress());
let status = null;

@@ -186,0 +187,0 @@ do {

import { ethers } from 'ethers';
import { Provider } from './provider';
import { BlockTag, Signature, TransactionRequest, TransactionResponse } from './types';
import { BlockTag, TransactionResponse, Signature, TransactionRequest } from './types';
import { TypedDataSigner } from '@ethersproject/abstract-signer';

@@ -33,3 +33,3 @@ export declare const eip712Types: {

gasLimit?: ethers.BigNumberish;
}): Promise<ethers.providers.TransactionResponse>;
}): Promise<TransactionResponse>;
transfer(tx: {

@@ -44,3 +44,3 @@ to: string;

gasLimit?: ethers.BigNumberish;
}): Promise<any>;
}): Promise<TransactionResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -69,2 +69,32 @@ getAddress(): Promise<string>;

approveERC20(token: string, amount: ethers.BigNumberish, overrides?: ethers.CallOverrides): Promise<ethers.providers.TransactionResponse>;
depositBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
addTokenBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
withdrawBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
executeBaseCost(params: {
ergsLimit: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
deployContractBaseCost(params?: {
ergsLimit: ethers.BigNumberish;
bytecodeLength: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
deposit(transaction: {

@@ -74,2 +104,5 @@ token: string;

to?: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
approveERC20?: boolean;

@@ -79,3 +112,36 @@ overrides?: ethers.CallOverrides;

}): Promise<import("./types").PriorityOpResponse>;
addToken(token: string, overrides?: ethers.CallOverrides): Promise<import("./types").PriorityOpResponse>;
addToken(transaction: {
token: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1Withdraw(transaction: {
token: string;
amount: ethers.BigNumberish;
to: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1Execute(transaction: {
contractAddress: string;
calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1DeployContract(transaction: {
bytecode: ethers.utils.BytesLike;
calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -82,0 +148,0 @@ getAddress(): Promise<string>;

@@ -94,3 +94,3 @@ "use strict";

transaction.customData = this._fillCustomData(transaction.customData);
(_e = transaction.gasPrice) !== null && _e !== void 0 ? _e : (transaction.gasPrice = await this.provider.getGasPrice());
(_e = transaction.gasPrice) !== null && _e !== void 0 ? _e : (transaction.gasPrice = await this.provider.getGasPrice(transaction.customData.feeToken));
(_f = transaction.gasLimit) !== null && _f !== void 0 ? _f : (transaction.gasLimit = await this.provider.estimateGas(transaction));

@@ -97,0 +97,0 @@ const signature = await this.eip712.sign(transaction);

@@ -10,2 +10,11 @@ import { BytesLike, BigNumberish, providers } from 'ethers';

}
export declare enum PriorityQueueType {
Deque = 0,
HeapBuffer = 1,
Heap = 2
}
export declare enum PriorityOpTree {
Full = 0,
Rollup = 1
}
export declare enum TransactionStatus {

@@ -12,0 +21,0 @@ NotFound = "not-found",

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionStatus = exports.Network = void 0;
exports.TransactionStatus = exports.PriorityOpTree = exports.PriorityQueueType = exports.Network = void 0;
// Ethereum network

@@ -12,2 +12,13 @@ var Network;

})(Network = exports.Network || (exports.Network = {}));
var PriorityQueueType;
(function (PriorityQueueType) {
PriorityQueueType[PriorityQueueType["Deque"] = 0] = "Deque";
PriorityQueueType[PriorityQueueType["HeapBuffer"] = 1] = "HeapBuffer";
PriorityQueueType[PriorityQueueType["Heap"] = 2] = "Heap";
})(PriorityQueueType = exports.PriorityQueueType || (exports.PriorityQueueType = {}));
var PriorityOpTree;
(function (PriorityOpTree) {
PriorityOpTree[PriorityOpTree["Full"] = 0] = "Full";
PriorityOpTree[PriorityOpTree["Rollup"] = 1] = "Rollup";
})(PriorityOpTree = exports.PriorityOpTree || (exports.PriorityOpTree = {}));
var TransactionStatus;

@@ -14,0 +25,0 @@ (function (TransactionStatus) {

import { utils, ethers, BigNumberish } from 'ethers';
import { SignatureLike } from '@ethersproject/bytes';
import { Address } from './types';
import { Address, PriorityQueueType, PriorityOpTree } from './types';
export declare const MIN_TIMESTAMP = 0;

@@ -14,10 +14,19 @@ export declare const MAX_TIMESTAMP: number;

ERC20_DEFAULT_DEPOSIT: number;
WITHDRAW: number;
EXECUTE: number;
DEPLOY_CONTRACT: number;
ADD_TOKEN: number;
TRANSFER: number;
ERC20_APPROVE: number;
ADD_TOKEN: number;
};
export declare function isETH(token: Address): boolean;
export declare function sleep(millis: number): Promise<unknown>;
export declare function layer1TxDefaults(): {
queueType: PriorityQueueType;
opTree: PriorityOpTree;
};
export declare function checkBaseCost(baseCost: ethers.BigNumber, value: ethers.BigNumberish | Promise<ethers.BigNumberish>): Promise<void>;
export declare function serialize(transaction: ethers.providers.TransactionRequest, signature?: SignatureLike): string;
export declare function parseTransaction(payload: ethers.BytesLike): ethers.Transaction;
export declare function getL2HashFromPriorityOpId(id: BigNumberish): string;
export declare function getL2HashFromPriorityOp(txReceipt: ethers.providers.TransactionReceipt): string;
export declare function getL2HashFromPriorityOp(txReceipt: ethers.providers.TransactionReceipt, zkSyncAddress: Address): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getL2HashFromPriorityOp = exports.getL2HashFromPriorityOpId = exports.parseTransaction = exports.serialize = exports.sleep = exports.isETH = exports.RECOMMENDED_GAS_LIMIT = exports.PRIORITY_OP_ID_BYTES = exports.IERC20 = exports.ZKSYNC_MAIN_ABI = exports.ETH_ADDRESS = exports.MAX_TIMESTAMP = exports.MIN_TIMESTAMP = void 0;
exports.getL2HashFromPriorityOp = exports.getL2HashFromPriorityOpId = exports.parseTransaction = exports.serialize = exports.checkBaseCost = exports.layer1TxDefaults = exports.sleep = exports.isETH = exports.RECOMMENDED_GAS_LIMIT = exports.PRIORITY_OP_ID_BYTES = exports.IERC20 = exports.ZKSYNC_MAIN_ABI = exports.ETH_ADDRESS = exports.MAX_TIMESTAMP = exports.MIN_TIMESTAMP = void 0;
const ethers_1 = require("ethers");
const types_1 = require("./types");
const signer_1 = require("./signer");

@@ -12,12 +13,16 @@ exports.MIN_TIMESTAMP = 0;

exports.ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
exports.ZKSYNC_MAIN_ABI = new ethers_1.utils.Interface(require('../abi/ZkSync.json'));
exports.IERC20 = new ethers_1.utils.Interface(require('../abi/IERC20.json'));
exports.ZKSYNC_MAIN_ABI = new ethers_1.utils.Interface(require('../abi/ZkSync.json').abi);
exports.IERC20 = new ethers_1.utils.Interface(require('../abi/IERC20.json').abi);
exports.PRIORITY_OP_ID_BYTES = 8;
exports.RECOMMENDED_GAS_LIMIT = {
ETH_DEPOSIT: 90000,
ETH_DEPOSIT: 120000,
ERC20_DEPOSIT: require('../misc/DepositERC20GasLimits.json'),
ERC20_DEFAULT_DEPOSIT: 300000,
ERC20_APPROVE: 50000,
// TODO (SMA-438) have a more precise estimation for add token gas cost
ADD_TOKEN: 250000
WITHDRAW: 120000,
EXECUTE: 120000,
DEPLOY_CONTRACT: 720000,
// TODO: Estimate these values.
ADD_TOKEN: 300000,
TRANSFER: 300000,
ERC20_APPROVE: 50000
};

@@ -35,2 +40,16 @@ function isETH(token) {

exports.sleep = sleep;
function layer1TxDefaults() {
return {
queueType: types_1.PriorityQueueType.Deque,
opTree: types_1.PriorityOpTree.Full
};
}
exports.layer1TxDefaults = layer1TxDefaults;
async function checkBaseCost(baseCost, value) {
if (baseCost.gt(await value)) {
throw new Error(`The base cost of performing the priority operation is higher than the provided value parameter ` +
`for the transaction: baseCost: ${baseCost}, provided value: ${value}`);
}
}
exports.checkBaseCost = checkBaseCost;
function serialize(transaction, signature) {

@@ -143,5 +162,8 @@ var _a;

exports.getL2HashFromPriorityOpId = getL2HashFromPriorityOpId;
function getL2HashFromPriorityOp(txReceipt) {
function getL2HashFromPriorityOp(txReceipt, zkSyncAddress) {
let priorityOpId = null;
for (const log of txReceipt.logs) {
if (log.address.toLowerCase() != zkSyncAddress.toLowerCase()) {
continue;
}
try {

@@ -148,0 +170,0 @@ const priorityQueueLog = exports.ZKSYNC_MAIN_ABI.parseLog(log);

@@ -21,3 +21,3 @@ import { EIP712Signer } from './signer';

gasLimit?: ethers.BigNumberish;
}): Promise<ethers.providers.TransactionResponse>;
}): Promise<TransactionResponse>;
transfer(tx: {

@@ -32,3 +32,3 @@ to: string;

gasLimit?: ethers.BigNumberish;
}): Promise<any>;
}): Promise<TransactionResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -45,2 +45,32 @@ getAddress(): Promise<string>;

approveERC20(token: string, amount: ethers.BigNumberish, overrides?: ethers.CallOverrides): Promise<ethers.providers.TransactionResponse>;
depositBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
addTokenBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
withdrawBaseCost(params?: {
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
executeBaseCost(params: {
ergsLimit: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
deployContractBaseCost(params?: {
ergsLimit: ethers.BigNumberish;
bytecodeLength: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
}): Promise<ethers.BigNumber>;
deposit(transaction: {

@@ -50,2 +80,5 @@ token: string;

to?: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
approveERC20?: boolean;

@@ -55,3 +88,36 @@ overrides?: ethers.CallOverrides;

}): Promise<import("./types").PriorityOpResponse>;
addToken(token: string, overrides?: ethers.CallOverrides): Promise<import("./types").PriorityOpResponse>;
addToken(transaction: {
token: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1Withdraw(transaction: {
token: string;
amount: ethers.BigNumberish;
to: string;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1Execute(transaction: {
contractAddress: string;
calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
requestL1DeployContract(transaction: {
bytecode: ethers.utils.BytesLike;
calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
queueType?: import("./types").PriorityQueueType;
opTree?: import("./types").PriorityOpTree;
operatorTip?: ethers.BigNumberish;
overrides?: ethers.CallOverrides;
}): Promise<import("./types").PriorityOpResponse>;
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

@@ -58,0 +124,0 @@ getAddress(): Promise<string>;

@@ -75,2 +75,3 @@ "use strict";

transaction.customData = this._fillCustomData(transaction.customData);
transaction.gasPrice = await this.provider.getGasPrice(transaction.customData.feeToken);
return transaction;

@@ -77,0 +78,0 @@ }

{
"name": "zksync-web3",
"version": "0.2.11",
"version": "0.3.0",
"main": "build/index.js",

@@ -5,0 +5,0 @@ "types": "build/index.d.ts",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc