Socket
Socket
Sign inDemoInstall

zksync-web3

Package Overview
Dependencies
Maintainers
5
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.12.5 to 0.13.0-beta.0

abi/IEthToken.json

136

abi/ContractDeployer.json

@@ -52,7 +52,2 @@ {

"type": "address"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}

@@ -87,7 +82,2 @@ ],

"type": "address"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}

@@ -114,2 +104,7 @@ ],

"type": "bytes"
},
{
"internalType": "enum IContractDeployer.AccountAbstractionVersion",
"name": "_aaVersion",
"type": "uint8"
}

@@ -123,7 +118,2 @@ ],

"type": "address"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}

@@ -150,2 +140,7 @@ ],

"type": "bytes"
},
{
"internalType": "enum IContractDeployer.AccountAbstractionVersion",
"name": "_aaVersion",
"type": "uint8"
}

@@ -159,10 +154,24 @@ ],

"type": "address"
},
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "extendedAccountVersion",
"outputs": [
{
"internalType": "enum IContractDeployer.AccountAbstractionVersion",
"name": "",
"type": "bytes"
"type": "uint8"
}
],
"stateMutability": "payable",
"stateMutability": "view",
"type": "function"

@@ -185,2 +194,7 @@ },

{
"internalType": "bool",
"name": "callConstructor",
"type": "bool"
},
{
"internalType": "uint256",

@@ -226,2 +240,7 @@ "name": "value",

{
"internalType": "bool",
"name": "callConstructor",
"type": "bool"
},
{
"internalType": "uint256",

@@ -251,2 +270,33 @@ "name": "value",

"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "getAccountInfo",
"outputs": [
{
"components": [
{
"internalType": "enum IContractDeployer.AccountAbstractionVersion",
"name": "supportedAAVersion",
"type": "uint8"
},
{
"internalType": "enum IContractDeployer.AccountNonceOrdering",
"name": "nonceOrdering",
"type": "uint8"
}
],
"internalType": "struct IContractDeployer.AccountInfo",
"name": "info",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_sender",

@@ -309,16 +359,10 @@ "type": "address"

{
"internalType": "address",
"name": "_addr",
"type": "address"
"internalType": "enum IContractDeployer.AccountAbstractionVersion",
"name": "_version",
"type": "uint8"
}
],
"name": "isAccount",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"name": "updateAccountVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"

@@ -329,30 +373,10 @@ },

{
"internalType": "address",
"name": "_sender",
"type": "address"
},
{
"internalType": "bytes32",
"name": "_bytecodeHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_newAddress",
"type": "address"
},
{
"internalType": "bool",
"name": "_account",
"type": "bool"
},
{
"internalType": "bytes",
"name": "_input",
"type": "bytes"
"internalType": "enum IContractDeployer.AccountNonceOrdering",
"name": "_nonceOrdering",
"type": "uint8"
}
],
"name": "performDeployOnAddress",
"name": "updateNonceOrdering",
"outputs": [],
"stateMutability": "payable",
"stateMutability": "nonpayable",
"type": "function"

@@ -359,0 +383,0 @@ }

@@ -176,3 +176,3 @@ {

"internalType": "address",
"name": "recipient",
"name": "to",
"type": "address"

@@ -187,3 +187,9 @@ },

"name": "transfer",
"outputs": [],
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",

@@ -196,3 +202,3 @@ "type": "function"

"internalType": "address",
"name": "sender",
"name": "from",
"type": "address"

@@ -202,3 +208,3 @@ },

"internalType": "address",
"name": "recipient",
"name": "to",
"type": "address"

@@ -213,3 +219,9 @@ },

"name": "transferFrom",
"outputs": [],
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",

@@ -216,0 +228,0 @@ "type": "function"

@@ -143,2 +143,12 @@ {

"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2TxGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2TxgasPerPubdataByte",
"type": "uint256"
}

@@ -145,0 +155,0 @@ ],

@@ -9,3 +9,3 @@ {

"internalType": "address",
"name": "l1Sender",
"name": "to",
"type": "address"

@@ -16,12 +16,6 @@ },

"internalType": "address",
"name": "l2Receiver",
"name": "l1Token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "l2Token",
"type": "address"
},
{
"indexed": false,

@@ -33,3 +27,3 @@ "internalType": "uint256",

],
"name": "FinalizeDeposit",
"name": "ClaimedFailedDeposit",
"type": "event"

@@ -43,3 +37,3 @@ },

"internalType": "address",
"name": "l2Sender",
"name": "from",
"type": "address"

@@ -50,3 +44,3 @@ },

"internalType": "address",
"name": "l1Receiver",
"name": "to",
"type": "address"

@@ -57,3 +51,3 @@ },

"internalType": "address",
"name": "l2Token",
"name": "l1Token",
"type": "address"

@@ -68,19 +62,39 @@ },

],
"name": "WithdrawalInitiated",
"name": "DepositInitiated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_l1Sender",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "_l2Receiver",
"name": "l1Token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrawalFinalized",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "_depositSender",
"type": "address"
},
{
"internalType": "address",
"name": "_l1Token",

@@ -90,13 +104,28 @@ "type": "address"

{
"internalType": "bytes32",
"name": "_l2TxHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_amount",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
},
{
"internalType": "uint16",
"name": "_l2TxNumberInBlock",
"type": "uint16"
},
{
"internalType": "bytes32[]",
"name": "_merkleProof",
"type": "bytes32[]"
}
],
"name": "finalizeDeposit",
"name": "claimFailedDeposit",
"outputs": [],

@@ -107,12 +136,33 @@ "stateMutability": "nonpayable",

{
"inputs": [],
"name": "l1Bridge",
"outputs": [
"inputs": [
{
"internalType": "address",
"name": "",
"name": "_l2Receiver",
"type": "address"
},
{
"internalType": "address",
"name": "_l1Token",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2TxGasLimit",
"type": "uint256"
}
],
"stateMutability": "view",
"name": "deposit",
"outputs": [
{
"internalType": "bytes32",
"name": "txHash",
"type": "bytes32"
}
],
"stateMutability": "payable",
"type": "function"

@@ -123,16 +173,30 @@ },

{
"internalType": "address",
"name": "_l2Token",
"type": "address"
}
],
"name": "l1TokenAddress",
"outputs": [
"internalType": "uint256",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "",
"type": "address"
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
},
{
"internalType": "uint16",
"name": "_l2TxNumberInBlock",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_message",
"type": "bytes"
},
{
"internalType": "bytes32[]",
"name": "_merkleProof",
"type": "bytes32[]"
}
],
"stateMutability": "view",
"name": "finalizeWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"

@@ -143,13 +207,18 @@ },

{
"internalType": "address",
"name": "_l1Token",
"type": "address"
"internalType": "uint256",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
}
],
"name": "l2TokenAddress",
"name": "isWithdrawalFinalized",
"outputs": [
{
"internalType": "address",
"internalType": "bool",
"name": "",
"type": "address"
"type": "bool"
}

@@ -164,19 +233,15 @@ ],

"internalType": "address",
"name": "_l1Receiver",
"name": "_l1Token",
"type": "address"
},
}
],
"name": "l2TokenAddress",
"outputs": [
{
"internalType": "address",
"name": "_l2Token",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "view",
"type": "function"

@@ -183,0 +248,0 @@ }

@@ -92,8 +92,2 @@ {

"type": "uint256"
},
{
"indexed": false,
"internalType": "enum IExecutor.BlockVerificationMode",
"name": "verificationMode",
"type": "uint8"
}

@@ -108,46 +102,5 @@ ],

{
"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": [
{
"indexed": false,
"indexed": true,
"internalType": "uint256",
"name": "currentProposalId",
"name": "proposalId",
"type": "uint256"

@@ -158,7 +111,7 @@ },

"internalType": "bytes32",
"name": "proposedDiamondCutHash",
"name": "proposalHash",
"type": "bytes32"
}
],
"name": "DiamondCutProposalCancelation",
"name": "CancelUpgradeProposal",
"type": "event"

@@ -170,48 +123,15 @@ },

{
"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": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "struct Diamond.DiamondCutData",
"name": "_diamondCut",
"type": "tuple"
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "DiamondCutProposalExecution",
"name": "EthWithdrawalFinalized",
"type": "event"

@@ -224,26 +144,20 @@ },

"indexed": true,
"internalType": "address",
"name": "_address",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "currentProposalId",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "securityCouncilEmergencyApprovals",
"type": "uint256"
"indexed": true,
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
},
{
"indexed": true,
"indexed": false,
"internalType": "bytes32",
"name": "proposedDiamondCutHash",
"name": "proposalSalt",
"type": "bytes32"
}
],
"name": "EmergencyDiamondCutApproved",
"name": "ExecuteUpgrade",
"type": "event"

@@ -254,3 +168,3 @@ },

"inputs": [],
"name": "EmergencyFreeze",
"name": "Freeze",
"type": "event"

@@ -365,3 +279,3 @@ },

"internalType": "uint64",
"name": "expirationBlock",
"name": "expirationTimestamp",
"type": "uint64"

@@ -388,3 +302,3 @@ },

"internalType": "uint256",
"name": "ergsLimit",
"name": "gasLimit",
"type": "uint256"

@@ -394,3 +308,3 @@ },

"internalType": "uint256",
"name": "ergsPerPubdataByteLimit",
"name": "gasPerPubdataByteLimit",
"type": "uint256"

@@ -400,3 +314,3 @@ },

"internalType": "uint256",
"name": "maxFeePerErg",
"name": "maxFeePerGas",
"type": "uint256"

@@ -406,3 +320,3 @@ },

"internalType": "uint256",
"name": "maxPriorityFeePerErg",
"name": "maxPriorityFeePerGas",
"type": "uint256"

@@ -416,5 +330,15 @@ },

{
"internalType": "uint256[6]",
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256[4]",
"name": "reserved",
"type": "uint256[6]"
"type": "uint256[4]"
},

@@ -466,2 +390,21 @@ {

{
"indexed": false,
"internalType": "uint256",
"name": "oldPriorityTxMaxGasLimit",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newPriorityTxMaxGasLimit",
"type": "uint256"
}
],
"name": "NewPriorityTxMaxGasLimit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,

@@ -539,8 +482,103 @@ "internalType": "address",

{
"indexed": true,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
}
],
"name": "ProposeShadowUpgrade",
"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"
},
{
"indexed": true,
"internalType": "uint256",
"name": "lastDiamondFreezeTimestamp",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "proposalSalt",
"type": "bytes32"
}
],
"name": "ProposeTransparentUpgrade",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
}
],
"name": "SecurityCouncilUpgradeApprove",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Unfreeze",

@@ -579,7 +617,7 @@ "type": "event"

"internalType": "bytes32",
"name": "_diamondCutHash",
"name": "_proposedUpgradeHash",
"type": "bytes32"
}
],
"name": "approveEmergencyDiamondCutAsSecurityCouncilMember",
"name": "cancelUpgradeProposal",
"outputs": [],

@@ -590,9 +628,2 @@ "stateMutability": "nonpayable",

{
"inputs": [],
"name": "cancelDiamondCutProposal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [

@@ -720,9 +751,2 @@ {

{
"inputs": [],
"name": "emergencyFreezeDiamond",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [

@@ -827,5 +851,10 @@ {

"type": "tuple"
},
{
"internalType": "bytes32",
"name": "_proposalSalt",
"type": "bytes32"
}
],
"name": "executeDiamondCutProposal",
"name": "executeUpgrade",
"outputs": [],

@@ -912,3 +941,43 @@ "stateMutability": "nonpayable",

{
"inputs": [
{
"internalType": "uint256",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
},
{
"internalType": "uint16",
"name": "_l2TxNumberInBlock",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_message",
"type": "bytes"
},
{
"internalType": "bytes32[]",
"name": "_merkleProof",
"type": "bytes32[]"
}
],
"name": "finalizeEthWithdrawal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "freezeDiamond",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentProposalId",

@@ -953,8 +1022,8 @@ "outputs": [

"inputs": [],
"name": "getLastDiamondFreezeTimestamp",
"name": "getL2BootloaderBytecodeHash",
"outputs": [
{
"internalType": "uint256",
"internalType": "bytes32",
"name": "",
"type": "uint256"
"type": "bytes32"
}

@@ -967,2 +1036,15 @@ ],

"inputs": [],
"name": "getL2DefaultAccountBytecodeHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPendingGovernor",

@@ -994,8 +1076,8 @@ "outputs": [

"inputs": [],
"name": "getProposedDiamondCutHash",
"name": "getPriorityTxMaxGasLimit",
"outputs": [
{
"internalType": "bytes32",
"internalType": "uint256",
"name": "",
"type": "bytes32"
"type": "uint256"
}

@@ -1008,8 +1090,8 @@ ],

"inputs": [],
"name": "getProposedDiamondCutTimestamp",
"name": "getProposedUpgradeHash",
"outputs": [
{
"internalType": "uint256",
"internalType": "bytes32",
"name": "",
"type": "uint256"
"type": "bytes32"
}

@@ -1022,3 +1104,3 @@ ],

"inputs": [],
"name": "getSecurityCouncilEmergencyApprovals",
"name": "getProposedUpgradeTimestamp",
"outputs": [

@@ -1035,10 +1117,17 @@ {

{
"inputs": [
"inputs": [],
"name": "getSecurityCouncil",
"outputs": [
{
"internalType": "address",
"name": "_address",
"name": "",
"type": "address"
}
],
"name": "getSecurityCouncilMemberLastApprovedProposalId",
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalBlocksCommitted",
"outputs": [

@@ -1056,3 +1145,3 @@ {

"inputs": [],
"name": "getTotalBlocksCommitted",
"name": "getTotalBlocksExecuted",
"outputs": [

@@ -1070,3 +1159,3 @@ {

"inputs": [],
"name": "getTotalBlocksExecuted",
"name": "getTotalBlocksVerified",
"outputs": [

@@ -1084,3 +1173,3 @@ {

"inputs": [],
"name": "getTotalBlocksVerified",
"name": "getTotalPriorityTxs",
"outputs": [

@@ -1098,8 +1187,8 @@ {

"inputs": [],
"name": "getTotalPriorityTxs",
"name": "getUpgradeProposalState",
"outputs": [
{
"internalType": "uint256",
"internalType": "enum UpgradeState",
"name": "",
"type": "uint256"
"type": "uint8"
}

@@ -1125,2 +1214,45 @@ ],

"inputs": [],
"name": "getVerifierParams",
"outputs": [
{
"components": [
{
"internalType": "bytes32",
"name": "recursionNodeLevelVkHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "recursionLeafLevelVkHash",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "recursionCircuitsSetVksHash",
"type": "bytes32"
}
],
"internalType": "struct VerifierParams",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isApprovedBySecurityCouncil",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isDiamondStorageFrozen",

@@ -1140,8 +1272,13 @@ "outputs": [

{
"internalType": "bytes4",
"name": "_selector",
"type": "bytes4"
"internalType": "uint256",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
}
],
"name": "isFunctionFreezable",
"name": "isEthWithdrawalFinalized",
"outputs": [

@@ -1161,10 +1298,29 @@ {

"internalType": "address",
"name": "_address",
"name": "_facet",
"type": "address"
}
],
"name": "isSecurityCouncilMember",
"name": "isFacetFreezable",
"outputs": [
{
"internalType": "bool",
"name": "isFreezable",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "_selector",
"type": "bytes4"
}
],
"name": "isFunctionFreezable",
"outputs": [
{
"internalType": "bool",
"name": "",

@@ -1224,9 +1380,9 @@ "type": "bool"

"internalType": "uint256",
"name": "_ergsLimit",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_calldataLength",
"type": "uint32"
"internalType": "uint256",
"name": "_gasPerPubdataByteLimit",
"type": "uint256"
}

@@ -1258,3 +1414,3 @@ ],

"internalType": "uint64",
"name": "expirationBlock",
"name": "expirationTimestamp",
"type": "uint64"

@@ -1279,35 +1435,70 @@ },

{
"internalType": "bytes32",
"name": "_proposalHash",
"type": "bytes32"
},
{
"internalType": "uint40",
"name": "_proposalId",
"type": "uint40"
}
],
"name": "proposeShadowUpgrade",
"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": "facet",
"name": "initAddress",
"type": "address"
},
{
"internalType": "enum Diamond.Action",
"name": "action",
"type": "uint8"
},
{
"internalType": "bool",
"name": "isFreezable",
"type": "bool"
},
{
"internalType": "bytes4[]",
"name": "selectors",
"type": "bytes4[]"
"internalType": "bytes",
"name": "initCalldata",
"type": "bytes"
}
],
"internalType": "struct Diamond.FacetCut[]",
"name": "_facetCuts",
"type": "tuple[]"
"internalType": "struct Diamond.DiamondCutData",
"name": "_diamondCut",
"type": "tuple"
},
{
"internalType": "address",
"name": "_initAddress",
"type": "address"
"internalType": "uint40",
"name": "_proposalId",
"type": "uint40"
}
],
"name": "proposeDiamondCut",
"name": "proposeTransparentUpgrade",
"outputs": [],

@@ -1417,3 +1608,3 @@ "stateMutability": "nonpayable",

"internalType": "uint256[]",
"name": "recurisiveAggregationInput",
"name": "recursiveAggregationInput",
"type": "uint256[]"

@@ -1430,7 +1621,2 @@ },

"type": "tuple"
},
{
"internalType": "enum IExecutor.BlockVerificationMode",
"name": "_verificationMode",
"type": "uint8"
}

@@ -1446,3 +1632,47 @@ ],

{
"internalType": "bytes32",
"name": "_l2TxHash",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "_l2BlockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_l2MessageIndex",
"type": "uint256"
},
{
"internalType": "uint16",
"name": "_l2TxNumberInBlock",
"type": "uint16"
},
{
"internalType": "bytes32[]",
"name": "_merkleProof",
"type": "bytes32[]"
},
{
"internalType": "enum TxStatus",
"name": "_status",
"type": "uint8"
}
],
"name": "proveL1ToL2TransactionStatus",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_blockNumber",

@@ -1580,9 +1810,19 @@ "type": "uint256"

"internalType": "uint256",
"name": "_ergsLimit",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_gasPerPubdataByteLimit",
"type": "uint256"
},
{
"internalType": "bytes[]",
"name": "_factoryDeps",
"type": "bytes[]"
},
{
"internalType": "address",
"name": "_refundRecipient",
"type": "address"
}

@@ -1617,2 +1857,15 @@ ],

{
"internalType": "bytes32",
"name": "_upgradeProposalHash",
"type": "bytes32"
}
],
"name": "securityCouncilUpgradeApprove",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",

@@ -1644,9 +1897,24 @@ "name": "_txId",

"internalType": "uint256",
"name": "_ergsLimit",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_gasPerPubdataByteLimit",
"type": "uint256"
},
{
"internalType": "bytes[]",
"name": "_factoryDeps",
"type": "bytes[]"
},
{
"internalType": "uint256",
"name": "_toMint",
"type": "uint256"
},
{
"internalType": "address",
"name": "_refundRecipient",
"type": "address"
}

@@ -1675,3 +1943,3 @@ ],

"internalType": "uint256",
"name": "ergsLimit",
"name": "gasLimit",
"type": "uint256"

@@ -1681,3 +1949,3 @@ },

"internalType": "uint256",
"name": "ergsPerPubdataByteLimit",
"name": "gasPerPubdataByteLimit",
"type": "uint256"

@@ -1687,3 +1955,3 @@ },

"internalType": "uint256",
"name": "maxFeePerErg",
"name": "maxFeePerGas",
"type": "uint256"

@@ -1693,3 +1961,3 @@ },

"internalType": "uint256",
"name": "maxPriorityFeePerErg",
"name": "maxPriorityFeePerGas",
"type": "uint256"

@@ -1703,5 +1971,15 @@ },

{
"internalType": "uint256[6]",
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256[4]",
"name": "reserved",
"type": "uint256[6]"
"type": "uint256[4]"
},

@@ -1785,3 +2063,3 @@ {

"internalType": "bool",
"name": "_isPorterAvailable",
"name": "_zkPorterIsAvailable",
"type": "bool"

@@ -1798,2 +2076,15 @@ }

{
"internalType": "uint256",
"name": "_newPriorityTxMaxGasLimit",
"type": "uint256"
}
],
"name": "setPriorityTxMaxGasLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",

@@ -1882,4 +2173,72 @@ "name": "_validator",

"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"
},
{
"internalType": "uint256",
"name": "_proposalId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "_salt",
"type": "bytes32"
}
],
"name": "upgradeProposalHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
}
]
}
import { BigNumber, BigNumberish, ethers, BytesLike } from 'ethers';
import { Provider } from './provider';
import { Address, PriorityOpResponse, BlockTag, Eip712Meta, TransactionResponse, BalancesMap } from './types';
type Constructor<T = {}> = new (...args: any[]) => T;
declare type Constructor<T = {}> = new (...args: any[]) => T;
interface TxSender {

@@ -25,4 +25,4 @@ sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;

getBaseCost(params: {
ergsLimit: BigNumberish;
calldataLength: BigNumberish;
gasLimit: BigNumberish;
gasPerPubdataByte?: BigNumberish;
gasPrice?: BigNumberish;

@@ -37,2 +37,4 @@ }): Promise<BigNumber>;

approveERC20?: boolean;
gasLimit?: BigNumberish;
gasPerPubdataByte?: BigNumberish;
overrides?: ethers.PayableOverrides;

@@ -55,6 +57,8 @@ approveOverrides?: ethers.Overrides;

calldata: BytesLike;
ergsLimit: BigNumberish;
gasLimit: BigNumberish;
l2Value?: BigNumberish;
factoryDeps?: ethers.BytesLike[];
operatorTip?: BigNumberish;
gasPerPubdataByte?: BigNumberish;
refundRecipient?: Address;
overrides?: ethers.PayableOverrides;

@@ -61,0 +65,0 @@ }): Promise<PriorityOpResponse>;

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

else {
const erc20contract = typechain_1.IERC20Factory.connect(token, this._providerL1());
const erc20contract = typechain_1.IERC20MetadataFactory.connect(token, this._providerL1());
return await erc20contract.balanceOf(await this.getAddress());

@@ -54,3 +54,3 @@ }

let bridgeAddress = overrides === null || overrides === void 0 ? void 0 : overrides.bridgeAddress;
const erc20contract = typechain_1.IERC20Factory.connect(token, this._signerL1());
const erc20contract = typechain_1.IERC20MetadataFactory.connect(token, this._signerL1());
if (bridgeAddress == null) {

@@ -77,10 +77,11 @@ bridgeAddress = (await this._providerL2().getDefaultBridgeAddresses()).erc20L1;

async getBaseCost(params) {
var _a;
var _a, _b;
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.l2TransactionBaseCost(parameters.gasPrice, parameters.ergsLimit, parameters.calldataLength));
(_b = parameters.gasPerPubdataByte) !== null && _b !== void 0 ? _b : (parameters.gasPerPubdataByte = utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT);
return ethers_1.BigNumber.from(await zksyncContract.l2TransactionBaseCost(parameters.gasPrice, parameters.gasLimit, parameters.gasPerPubdataByte));
}
async deposit(transaction) {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
const bridgeContracts = await this.getL1BridgeContracts();

@@ -95,15 +96,30 @@ if (transaction.bridgeAddress) {

(_c = tx.overrides) !== null && _c !== void 0 ? _c : (tx.overrides = {});
(_d = tx.gasPerPubdataByte) !== null && _d !== void 0 ? _d : (tx.gasPerPubdataByte = utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT);
(_e = tx.gasLimit) !== null && _e !== void 0 ? _e : (tx.gasLimit = ethers_1.BigNumber.from(utils_1.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT));
const { to, token, amount, operatorTip, overrides } = tx;
(_d = overrides.gasPrice) !== null && _d !== void 0 ? _d : (overrides.gasPrice = await this._providerL1().getGasPrice());
(_e = overrides.gasLimit) !== null && _e !== void 0 ? _e : (overrides.gasLimit = ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.DEPOSIT));
(_f = overrides.gasPrice) !== null && _f !== void 0 ? _f : (overrides.gasPrice = await this._providerL1().getGasPrice());
(_g = overrides.gasLimit) !== null && _g !== void 0 ? _g : (overrides.gasLimit = ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.DEPOSIT));
// TODO (SMA-1622): Restore base cost calculation as soon as L1 -> L2 transaction will have non-zero cost.
const baseCost = ethers_1.BigNumber.from(0);
const args = [to, token, amount];
const args = [
to,
token,
amount,
tx.gasLimit,
tx.gasPerPubdataByte
];
if (token == utils_1.ETH_ADDRESS) {
(_f = overrides.value) !== null && _f !== void 0 ? _f : (overrides.value = baseCost.add(operatorTip).add(amount));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await bridgeContracts.eth.deposit(...args, overrides));
(_h = overrides.value) !== null && _h !== void 0 ? _h : (overrides.value = baseCost.add(operatorTip).add(amount));
return await this.requestExecute({
contractAddress: to,
calldata: '0x',
l2Value: amount,
// For some reason typescript can not deduce that we've already set the
// tx.gasLimit
gasLimit: tx.gasLimit,
...tx
});
}
else {
(_g = overrides.value) !== null && _g !== void 0 ? _g : (overrides.value = baseCost.add(operatorTip));
(_j = overrides.value) !== null && _j !== void 0 ? _j : (overrides.value = baseCost.add(operatorTip));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);

@@ -115,3 +131,3 @@ if (transaction.approveERC20) {

});
(_h = overrides.nonce) !== null && _h !== void 0 ? _h : (overrides.nonce = approveTx.nonce + 1);
(_k = overrides.nonce) !== null && _k !== void 0 ? _k : (overrides.nonce = approveTx.nonce + 1);
}

@@ -154,2 +170,7 @@ if (overrides.gasLimit == null) {

const message = ethers_1.ethers.utils.defaultAbiCoder.decode(['bytes'], log.data)[0];
if ((0, utils_1.isETH)(sender)) {
const contractAddress = await this._providerL2().getMainContractAddress();
const zksync = typechain_1.IZkSyncFactory.connect(contractAddress, this._signerL1());
return await zksync.finalizeEthWithdrawal(log.l1BatchNumber, proof.id, l1BatchTxId, message, proof.proof, overrides !== null && overrides !== void 0 ? overrides : {});
}
const l2Bridge = typechain_1.IL2BridgeFactory.connect(sender, this._providerL2());

@@ -167,2 +188,7 @@ const l1Bridge = typechain_1.IL1BridgeFactory.connect(await l2Bridge.l1Bridge(), this._signerL1());

const proof = await this._providerL2().getLogProof(withdrawalHash, l2ToL1LogIndex);
if ((0, utils_1.isETH)(sender)) {
const contractAddress = await this._providerL2().getMainContractAddress();
const zksync = typechain_1.IZkSyncFactory.connect(contractAddress, this._signerL1());
return await zksync.isEthWithdrawalFinalized(log.l1BatchNumber, proof.id);
}
const l2Bridge = typechain_1.IL2BridgeFactory.connect(sender, this._providerL2());

@@ -180,3 +206,4 @@ const l1Bridge = typechain_1.IL1BridgeFactory.connect(await l2Bridge.l1Bridge(), this._providerL1());

const tx = await this._providerL2().getTransaction(ethers_1.ethers.utils.hexlify(depositHash));
const l1BridgeAddress = receipt.from;
// Undo the aliasing, since the Mailbox contract set it as for contract address.
const l1BridgeAddress = (0, utils_1.undoL1ToL2Alias)(receipt.from);
const l2BridgeAddress = receipt.to;

@@ -190,3 +217,3 @@ const l1Bridge = typechain_1.IL1BridgeFactory.connect(l1BridgeAddress, this._signerL1());

async requestExecute(transaction) {
var _a, _b, _c, _d, _e, _f, _g;
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
const zksyncContract = await this.getMainContract();

@@ -198,13 +225,15 @@ const { ...tx } = transaction;

(_d = tx.overrides) !== null && _d !== void 0 ? _d : (tx.overrides = {});
const { contractAddress, l2Value, calldata, ergsLimit, factoryDeps, operatorTip, overrides } = tx;
(_e = overrides.gasPrice) !== null && _e !== void 0 ? _e : (overrides.gasPrice = await this._providerL1().getGasPrice());
(_f = overrides.gasLimit) !== null && _f !== void 0 ? _f : (overrides.gasLimit = ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.EXECUTE));
(_e = tx.gasPerPubdataByte) !== null && _e !== void 0 ? _e : (tx.gasPerPubdataByte = utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT);
(_f = tx.refundRecipient) !== null && _f !== void 0 ? _f : (tx.refundRecipient = await this.getAddress());
const { contractAddress, l2Value, calldata, gasLimit, factoryDeps, operatorTip, overrides, gasPerPubdataByte, refundRecipient } = tx;
(_g = overrides.gasPrice) !== null && _g !== void 0 ? _g : (overrides.gasPrice = await this._providerL1().getGasPrice());
(_h = overrides.gasLimit) !== null && _h !== void 0 ? _h : (overrides.gasLimit = ethers_1.BigNumber.from(utils_1.RECOMMENDED_GAS_LIMIT.EXECUTE));
const baseCost = await this.getBaseCost({
gasPrice: await overrides.gasPrice,
calldataLength: ethers_1.ethers.utils.hexDataLength(calldata),
ergsLimit
gasPerPubdataByte,
gasLimit
});
(_g = overrides.value) !== null && _g !== void 0 ? _g : (overrides.value = baseCost.add(operatorTip));
(_j = overrides.value) !== null && _j !== void 0 ? _j : (overrides.value = baseCost.add(operatorTip).add(l2Value));
await (0, utils_1.checkBaseCost)(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await zksyncContract.requestL2Transaction(contractAddress, l2Value, calldata, ergsLimit, factoryDeps, overrides));
return this._providerL2().getPriorityOpResponse(await zksyncContract.requestL2Transaction(contractAddress, l2Value, calldata, gasLimit, utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT, factoryDeps, refundRecipient, overrides));
}

@@ -238,3 +267,3 @@ };

const customData = { ...data };
(_a = customData.ergsPerPubdata) !== null && _a !== void 0 ? _a : (customData.ergsPerPubdata = utils_1.DEFAULT_ERGS_PER_PUBDATA_LIMIT);
(_a = customData.ergsPerPubdata) !== null && _a !== void 0 ? _a : (customData.ergsPerPubdata = utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT);
(_b = customData.factoryDeps) !== null && _b !== void 0 ? _b : (customData.factoryDeps = []);

@@ -241,0 +270,0 @@ return customData;

@@ -10,4 +10,5 @@ import { Wallet } from './wallet';

constructor(abi: ContractInterface, bytecode: ethers.BytesLike, signer: Wallet | Signer, deploymentType?: DeploymentType);
private encodeCalldata;
getDeployTransaction(...args: any[]): ethers.providers.TransactionRequest;
deploy(...args: Array<any>): Promise<Contract>;
}

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

const utils_1 = require("./utils");
const types_1 = require("./types");
var ethers_2 = require("ethers");

@@ -14,2 +15,18 @@ Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return ethers_2.Contract; } });

}
encodeCalldata(salt, bytecodeHash, constructorCalldata) {
if (this.deploymentType == 'create') {
return utils_1.CONTRACT_DEPLOYER.encodeFunctionData('create', [salt, bytecodeHash, constructorCalldata]);
}
else if (this.deploymentType == 'createAccount') {
return utils_1.CONTRACT_DEPLOYER.encodeFunctionData('createAccount', [
salt,
bytecodeHash,
constructorCalldata,
types_1.AccountAbstractionVersion.Version1
]);
}
else {
throw new Error(`Unsupported deployment type ${this.deploymentType}`);
}
}
getDeployTransaction(...args) {

@@ -29,7 +46,3 @@ var _a, _b, _c;

const constructorCalldata = ethers_1.utils.arrayify(this.interface.encodeDeploy(args));
const deployCalldata = utils_1.CONTRACT_DEPLOYER.encodeFunctionData(this.deploymentType, [
salt,
bytecodeHash,
constructorCalldata
]);
const deployCalldata = this.encodeCalldata(salt, bytecodeHash, constructorCalldata);
txRequest.type = utils_1.EIP712_TX_TYPE;

@@ -40,3 +53,3 @@ txRequest.to = utils_1.CONTRACT_DEPLOYER_ADDRESS;

(_b = (_d = txRequest.customData).factoryDeps) !== null && _b !== void 0 ? _b : (_d.factoryDeps = []);
(_c = (_e = txRequest.customData).ergsPerPubdata) !== null && _c !== void 0 ? _c : (_e.ergsPerPubdata = utils_1.DEFAULT_ERGS_PER_PUBDATA_LIMIT);
(_c = (_e = txRequest.customData).gasPerPubdata) !== null && _c !== void 0 ? _c : (_e.gasPerPubdata = utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT);
// The number of factory deps is relatively low, so it is efficient enough.

@@ -43,0 +56,0 @@ if (!txRequest.customData.factoryDeps.includes(this.bytecode)) {

@@ -5,3 +5,3 @@ import { ethers, BigNumber, BigNumberish, utils, providers, BytesLike } from 'ethers';

import { ConnectionInfo } from '@ethersproject/web';
import { Address, EventFilter, BlockTag, TransactionResponse, TransactionRequest, TransactionStatus, Token, PriorityOpResponse, BalancesMap, MessageProof, TransactionReceipt, Block, BlockWithTransactions, Log, BlockDetails, TransactionDetails } from './types';
import { Address, EventFilter, BlockTag, TransactionResponse, TransactionRequest, TransactionStatus, Token, PriorityOpResponse, BalancesMap, MessageProof, TransactionReceipt, Block, BlockWithTransactions, Log, TransactionDetails, BlockDetails, ContractAccountInfo } from './types';
import { Signer } from './signer';

@@ -97,2 +97,3 @@ export declare class Provider extends ethers.providers.JsonRpcProvider {

getPriorityOpResponse(l1TxResponse: ethers.providers.TransactionResponse): Promise<PriorityOpResponse>;
getContractAccountInfo(address: Address): Promise<ContractAccountInfo>;
}

@@ -99,0 +100,0 @@ export declare class Web3Provider extends Provider {

@@ -13,2 +13,15 @@ "use strict";

class Provider extends ethers_1.ethers.providers.JsonRpcProvider {
constructor(url, network) {
super(url, network);
this.pollingInterval = 500;
const blockTag = this.formatter.blockTag.bind(this.formatter);
this.formatter.blockTag = (tag) => {
if (tag == 'committed' || tag == 'finalized') {
return tag;
}
return blockTag(tag);
};
this.contractAddresses = {};
this.formatter.transaction = utils_1.parseTransaction;
}
async getTransactionReceipt(transactionHash) {

@@ -111,3 +124,3 @@ await this.getNetwork();

try {
let token = typechain_1.IERC20Factory.connect(tokenAddress, this);
let token = typechain_1.IERC20MetadataFactory.connect(tokenAddress, this);
return await token.balanceOf(address, { blockTag: tag });

@@ -155,4 +168,6 @@ }

result.eip712Meta = {
ergsPerPubdata: ethers_1.utils.hexValue((_a = transaction.customData.ergsPerPubdata) !== null && _a !== void 0 ? _a : 0)
// TODO: update server and use gasPerPubdata
ergsPerPubdata: ethers_1.utils.hexValue((_a = transaction.customData.gasPerPubdata) !== null && _a !== void 0 ? _a : 0)
};
transaction.type = utils_1.EIP712_TX_TYPE;
if (transaction.customData.factoryDeps) {

@@ -196,15 +211,2 @@ // @ts-ignore

}
constructor(url, network) {
super(url, network);
this.pollingInterval = 500;
const blockTag = this.formatter.blockTag.bind(this.formatter);
this.formatter.blockTag = (tag) => {
if (tag == 'committed' || tag == 'finalized') {
return tag;
}
return blockTag(tag);
};
this.contractAddresses = {};
this.formatter.transaction = utils_1.parseTransaction;
}
async getMessageProof(blockNumber, sender, messageHash, logIndex) {

@@ -292,5 +294,18 @@ return await this.send('zks_getL2ToL1MsgProof', [

(_c = (_d = tx.overrides).from) !== null && _c !== void 0 ? _c : (_d.from = tx.from);
if ((0, utils_1.isETH)(tx.token)) {
if (!tx.overrides.value) {
tx.overrides.value = tx.amount;
}
const passedValue = ethers_1.BigNumber.from(tx.overrides.value);
if (!passedValue.eq(tx.amount)) {
// To avoid users shooting themselves into the foot, we will always use the amount to withdraw
// as the value
throw new Error('The tx.value is not equal to the value withdrawn');
}
const ethL2Token = typechain_1.IEthTokenFactory.connect(utils_1.L2_ETH_TOKEN_ADDRESS, this);
return ethL2Token.populateTransaction.withdraw(tx.to, tx.overrides);
}
if (tx.bridgeAddress == null) {
const bridges = await this.getDefaultBridgeAddresses();
tx.bridgeAddress = (0, utils_1.isETH)(tx.token) ? bridges.ethL2 : bridges.erc20L2;
tx.bridgeAddress = bridges.erc20L2;
}

@@ -318,3 +333,3 @@ const bridge = typechain_1.IL2BridgeFactory.connect(tx.bridgeAddress, this);

else {
const token = typechain_1.IERC20Factory.connect(tx.token, this);
const token = typechain_1.IERC20MetadataFactory.connect(tx.token, this);
return await token.populateTransaction.transfer(tx.to, tx.amount, tx.overrides);

@@ -425,2 +440,10 @@ }

}
async getContractAccountInfo(address) {
const deployerContract = new ethers_1.Contract(utils_1.CONTRACT_DEPLOYER_ADDRESS, utils_1.CONTRACT_DEPLOYER, this);
const data = await deployerContract.getAccountInfo(address);
return {
supportedAAVersion: data.supportedAAVersion,
nonceOrdering: data.nonceOrdering
};
}
}

@@ -427,0 +450,0 @@ exports.Provider = Provider;

@@ -19,6 +19,6 @@ import { ethers } from 'ethers';

to: string;
ergsLimit: ethers.BigNumberish;
ergsPerPubdataByteLimit: ethers.BigNumberish;
maxFeePerErg: ethers.BigNumberish;
maxPriorityFeePerErg: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
gasPerPubdataByteLimit: ethers.BigNumberish;
maxFeePerGas: ethers.BigNumberish;
maxPriorityFeePerGas: ethers.BigNumberish;
paymaster: string;

@@ -89,4 +89,4 @@ nonce: ethers.BigNumberish;

getBaseCost(params: {
ergsLimit: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;

@@ -101,2 +101,4 @@ }): Promise<ethers.BigNumber>;

approveERC20?: boolean;
gasLimit?: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
overrides?: ethers.PayableOverrides;

@@ -119,6 +121,8 @@ approveOverrides?: ethers.Overrides;

calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
l2Value?: ethers.BigNumberish;
factoryDeps?: ethers.utils.BytesLike[];
operatorTip?: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
refundRecipient?: string;
overrides?: ethers.PayableOverrides;

@@ -125,0 +129,0 @@ }): Promise<import("./types").PriorityOpResponse>;

@@ -13,6 +13,6 @@ "use strict";

{ name: 'to', type: 'uint256' },
{ name: 'ergsLimit', type: 'uint256' },
{ name: 'ergsPerPubdataByteLimit', type: 'uint256' },
{ name: 'maxFeePerErg', type: 'uint256' },
{ name: 'maxPriorityFeePerErg', type: 'uint256' },
{ name: 'gasLimit', type: 'uint256' },
{ name: 'gasPerPubdataByteLimit', type: 'uint256' },
{ name: 'maxFeePerGas', type: 'uint256' },
{ name: 'maxPriorityFeePerGas', type: 'uint256' },
{ name: 'paymaster', type: 'uint256' },

@@ -37,5 +37,5 @@ { name: 'nonce', type: 'uint256' },

var _a, _b, _c, _d, _e, _f, _g;
const maxFeePerErg = transaction.maxFeePerGas || transaction.gasPrice;
const maxPriorityFeePerErg = transaction.maxPriorityFeePerGas || maxFeePerErg;
const ergsPerPubdataByteLimit = ((_a = transaction.customData) === null || _a === void 0 ? void 0 : _a.ergsPerPubdata) || utils_1.DEFAULT_ERGS_PER_PUBDATA_LIMIT;
const maxFeePerGas = transaction.maxFeePerGas || transaction.gasPrice;
const maxPriorityFeePerGas = transaction.maxPriorityFeePerGas || maxFeePerGas;
const gasPerPubdataByteLimit = ((_a = transaction.customData) === null || _a === void 0 ? void 0 : _a.ergsPerPubdata) || utils_1.DEFAULT_GAS_PER_PUBDATA_LIMIT;
const signInput = {

@@ -45,6 +45,6 @@ txType: transaction.type,

to: transaction.to,
ergsLimit: transaction.gasLimit,
ergsPerPubdataByteLimit,
maxFeePerErg,
maxPriorityFeePerErg,
gasLimit: transaction.gasLimit,
gasPerPubdataByteLimit: gasPerPubdataByteLimit,
maxFeePerGas,
maxPriorityFeePerGas,
paymaster: ((_c = (_b = transaction.customData) === null || _b === void 0 ? void 0 : _b.paymasterParams) === null || _c === void 0 ? void 0 : _c.paymaster) || ethers_1.ethers.constants.AddressZero,

@@ -51,0 +51,0 @@ nonce: transaction.nonce,

import { BytesLike, BigNumberish, providers, BigNumber } from 'ethers';
import { BlockWithTransactions as EthersBlockWithTransactions } from '@ethersproject/abstract-provider';
export type Address = string;
export type Signature = string;
export declare type Address = string;
export declare type Signature = string;
export declare enum Network {

@@ -27,7 +27,7 @@ Mainnet = 1,

}
export type PaymasterParams = {
export declare type PaymasterParams = {
paymaster: Address;
paymasterInput: BytesLike;
};
export type Eip712Meta = {
export declare type Eip712Meta = {
ergsPerPubdata?: BigNumberish;

@@ -38,4 +38,4 @@ factoryDeps?: BytesLike[];

};
export type BlockTag = number | string | 'committed' | 'finalized' | 'latest' | 'earliest' | 'pending';
export type DeploymentType = 'create' | 'createAccount';
export declare type BlockTag = number | string | 'committed' | 'finalized' | 'latest' | 'earliest' | 'pending';
export declare type DeploymentType = 'create' | 'createAccount';
export interface Token {

@@ -98,3 +98,3 @@ l1Address: Address;

}
export type TransactionRequest = providers.TransactionRequest & {
export declare type TransactionRequest = providers.TransactionRequest & {
customData?: Eip712Meta;

@@ -105,3 +105,3 @@ };

}
export type BalancesMap = {
export declare type BalancesMap = {
[key: string]: BigNumber;

@@ -129,3 +129,15 @@ };

}
export type PaymasterInput = ApprovalBasedPaymasterInput | GeneralPaymasterInput;
export declare type PaymasterInput = ApprovalBasedPaymasterInput | GeneralPaymasterInput;
export declare enum AccountAbstractionVersion {
None = 0,
Version1 = 1
}
export declare enum AccountNonceOrdering {
Sequential = 0,
Arbitrary = 1
}
export interface ContractAccountInfo {
supportedAAVersion: AccountAbstractionVersion;
nonceOrdering: AccountNonceOrdering;
}
export interface BlockDetails {

@@ -132,0 +144,0 @@ number: number;

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

@@ -31,1 +31,11 @@ var Network;

})(TransactionStatus = exports.TransactionStatus || (exports.TransactionStatus = {}));
var AccountAbstractionVersion;
(function (AccountAbstractionVersion) {
AccountAbstractionVersion[AccountAbstractionVersion["None"] = 0] = "None";
AccountAbstractionVersion[AccountAbstractionVersion["Version1"] = 1] = "Version1";
})(AccountAbstractionVersion = exports.AccountAbstractionVersion || (exports.AccountAbstractionVersion = {}));
var AccountNonceOrdering;
(function (AccountNonceOrdering) {
AccountNonceOrdering[AccountNonceOrdering["Sequential"] = 0] = "Sequential";
AccountNonceOrdering[AccountNonceOrdering["Arbitrary"] = 1] = "Arbitrary";
})(AccountNonceOrdering = exports.AccountNonceOrdering || (exports.AccountNonceOrdering = {}));

@@ -18,6 +18,10 @@ import { utils, ethers, BigNumberish, BytesLike } from 'ethers';

export declare const L1_MESSENGER_ADDRESS = "0x0000000000000000000000000000000000008008";
export declare const L2_ETH_TOKEN_ADDRESS = "0x000000000000000000000000000000000000800a";
export declare const L1_TO_L2_ALIAS_OFFSET = "0x1111000000000000000000000000000000001111";
export declare const EIP1271_MAGIC_VALUE = "0x1626ba7e";
export declare const EIP712_TX_TYPE = 113;
export declare const PRIORITY_OPERATION_L2_TX_TYPE = 255;
export declare const MAX_BYTECODE_LEN_BYTES: number;
export declare const DEFAULT_ERGS_PER_PUBDATA_LIMIT: number;
export declare const DEFAULT_GAS_PER_PUBDATA_LIMIT = 800;
export declare const RECOMMENDED_DEPOSIT_L2_GAS_LIMIT = 10000000;
export declare const RECOMMENDED_GAS_LIMIT: {

@@ -43,3 +47,5 @@ DEPOSIT: number;

export declare function getL2HashFromPriorityOp(txReceipt: ethers.providers.TransactionReceipt, zkSyncAddress: Address): string;
export declare function applyL1ToL2Alias(address: string): string;
export declare function undoL1ToL2Alias(address: string): string;
export declare function isMessageSignatureCorrect(provider: Provider, address: string, message: ethers.Bytes | string, signature: SignatureLike): Promise<boolean>;
export declare function isTypedDataSignatureCorrect(provider: Provider, address: string, domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>, signature: SignatureLike): Promise<boolean>;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.isTypedDataSignatureCorrect = exports.isMessageSignatureCorrect = exports.getL2HashFromPriorityOp = exports.parseTransaction = exports.hashBytecode = exports.serialize = exports.checkBaseCost = exports.createAddress = exports.create2Address = exports.getDeployedContracts = exports.getHashedL2ToL1Msg = exports.layer1TxDefaults = exports.sleep = exports.isETH = exports.RECOMMENDED_GAS_LIMIT = exports.DEFAULT_ERGS_PER_PUBDATA_LIMIT = exports.MAX_BYTECODE_LEN_BYTES = exports.EIP712_TX_TYPE = exports.EIP1271_MAGIC_VALUE = exports.L1_MESSENGER_ADDRESS = exports.CONTRACT_DEPLOYER_ADDRESS = exports.BOOTLOADER_FORMAL_ADDRESS = exports.L2_BRIDGE_ABI = exports.L1_BRIDGE_ABI = exports.IERC1271 = exports.IERC20 = exports.L1_MESSENGER = exports.CONTRACT_DEPLOYER = exports.ZKSYNC_MAIN_ABI = exports.ETH_ADDRESS = void 0;
exports.isTypedDataSignatureCorrect = exports.isMessageSignatureCorrect = exports.undoL1ToL2Alias = exports.applyL1ToL2Alias = exports.getL2HashFromPriorityOp = exports.parseTransaction = exports.hashBytecode = exports.serialize = exports.checkBaseCost = exports.createAddress = exports.create2Address = exports.getDeployedContracts = exports.getHashedL2ToL1Msg = exports.layer1TxDefaults = exports.sleep = exports.isETH = exports.RECOMMENDED_GAS_LIMIT = exports.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT = exports.DEFAULT_GAS_PER_PUBDATA_LIMIT = exports.MAX_BYTECODE_LEN_BYTES = exports.PRIORITY_OPERATION_L2_TX_TYPE = exports.EIP712_TX_TYPE = exports.EIP1271_MAGIC_VALUE = exports.L1_TO_L2_ALIAS_OFFSET = exports.L2_ETH_TOKEN_ADDRESS = exports.L1_MESSENGER_ADDRESS = exports.CONTRACT_DEPLOYER_ADDRESS = exports.BOOTLOADER_FORMAL_ADDRESS = exports.L2_BRIDGE_ABI = exports.L1_BRIDGE_ABI = exports.IERC1271 = exports.IERC20 = exports.L1_MESSENGER = exports.CONTRACT_DEPLOYER = exports.ZKSYNC_MAIN_ABI = exports.ETH_ADDRESS = void 0;
const ethers_1 = require("ethers");

@@ -34,8 +34,14 @@ const types_1 = require("./types");

exports.L1_MESSENGER_ADDRESS = '0x0000000000000000000000000000000000008008';
exports.L2_ETH_TOKEN_ADDRESS = '0x000000000000000000000000000000000000800a';
exports.L1_TO_L2_ALIAS_OFFSET = '0x1111000000000000000000000000000000001111';
exports.EIP1271_MAGIC_VALUE = '0x1626ba7e';
exports.EIP712_TX_TYPE = 0x71;
exports.PRIORITY_OPERATION_L2_TX_TYPE = 0xff;
exports.MAX_BYTECODE_LEN_BYTES = ((1 << 16) - 1) * 32;
// Default pubdata price limit to be used if user provided none.
const GAS_PER_PUBDATA_BYTE = 16;
exports.DEFAULT_ERGS_PER_PUBDATA_LIMIT = GAS_PER_PUBDATA_BYTE * 10000;
// The default L2 gas per pubdata byte
exports.DEFAULT_GAS_PER_PUBDATA_LIMIT = 800;
// The recommended L2 gas limit for a deposit.
// TODO (SMA-1704): Note, that this number is largely inflated, mainly to ensure that the
// deposit will succeed if the token contract is yet to be deployed (which may very well be the case).
exports.RECOMMENDED_DEPOSIT_L2_GAS_LIMIT = 10000000;
exports.RECOMMENDED_GAS_LIMIT = {

@@ -47,3 +53,3 @@ DEPOSIT: 600000,

function isETH(token) {
return token.toLowerCase() == exports.ETH_ADDRESS;
return token.toLowerCase() == exports.ETH_ADDRESS || token.toLowerCase() == exports.L2_ETH_TOKEN_ADDRESS;
}

@@ -141,8 +147,8 @@ exports.isETH = isETH;

const meta = transaction.customData;
let maxFeePerErg = transaction.maxFeePerGas || transaction.gasPrice || 0;
let maxPriorityFeePerErg = transaction.maxPriorityFeePerGas || maxFeePerErg;
let maxFeePerGas = transaction.maxFeePerGas || transaction.gasPrice || 0;
let maxPriorityFeePerGas = transaction.maxPriorityFeePerGas || maxFeePerGas;
const fields = [
formatNumber(transaction.nonce || 0, 'nonce'),
formatNumber(maxPriorityFeePerErg, 'maxPriorityFeePerGas'),
formatNumber(maxFeePerErg, 'maxFeePerGas'),
formatNumber(maxPriorityFeePerGas, 'maxPriorityFeePerGas'),
formatNumber(maxFeePerGas, 'maxFeePerGas'),
formatNumber(transaction.gasLimit || 0, 'gasLimit'),

@@ -167,3 +173,3 @@ transaction.to != null ? ethers_1.utils.getAddress(transaction.to) : '0x',

// Add meta
fields.push(formatNumber(meta.ergsPerPubdata || exports.DEFAULT_ERGS_PER_PUBDATA_LIMIT, 'ergsPerPubdata'));
fields.push(formatNumber(meta.ergsPerPubdata || exports.DEFAULT_GAS_PER_PUBDATA_LIMIT, 'gasPerPubdata'));
fields.push(((_a = meta.factoryDeps) !== null && _a !== void 0 ? _a : []).map((dep) => ethers_1.utils.hexlify(dep)));

@@ -317,2 +323,10 @@ if (meta.customSignature && ethers_1.ethers.utils.arrayify(meta.customSignature).length == 0) {

exports.getL2HashFromPriorityOp = getL2HashFromPriorityOp;
function applyL1ToL2Alias(address) {
return ethers_1.ethers.utils.hexlify(ethers_1.ethers.BigNumber.from(address).add(exports.L1_TO_L2_ALIAS_OFFSET));
}
exports.applyL1ToL2Alias = applyL1ToL2Alias;
function undoL1ToL2Alias(address) {
return ethers_1.ethers.utils.hexlify(ethers_1.ethers.BigNumber.from(address).sub(exports.L1_TO_L2_ALIAS_OFFSET));
}
exports.undoL1ToL2Alias = undoL1ToL2Alias;
// The method with similar functionality is already available in ethers.js,

@@ -319,0 +333,0 @@ // the only difference is that we provide additional `try { } catch { }`

@@ -49,4 +49,4 @@ import { EIP712Signer } from './signer';

getBaseCost(params: {
ergsLimit: ethers.BigNumberish;
calldataLength: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
gasPrice?: ethers.BigNumberish;

@@ -61,2 +61,4 @@ }): Promise<ethers.BigNumber>;

approveERC20?: boolean;
gasLimit?: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
overrides?: ethers.PayableOverrides;

@@ -79,6 +81,8 @@ approveOverrides?: ethers.Overrides;

calldata: ethers.utils.BytesLike;
ergsLimit: ethers.BigNumberish;
gasLimit: ethers.BigNumberish;
l2Value?: ethers.BigNumberish;
factoryDeps?: ethers.utils.BytesLike[];
operatorTip?: ethers.BigNumberish;
gasPerPubdataByte?: ethers.BigNumberish;
refundRecipient?: string;
overrides?: ethers.PayableOverrides;

@@ -85,0 +89,0 @@ }): Promise<import("./types").PriorityOpResponse>;

@@ -9,2 +9,11 @@ "use strict";

class Wallet extends (0, adapters_1.AdapterL2)((0, adapters_1.AdapterL1)(ethers_1.ethers.Wallet)) {
constructor(privateKey, providerL2, providerL1) {
super(privateKey, providerL2);
if (this.provider != null) {
const chainId = this.getChainId();
// @ts-ignore
this.eip712 = new signer_1.EIP712Signer(this, chainId);
}
this.providerL1 = providerL1;
}
_providerL1() {

@@ -54,11 +63,2 @@ if (this.providerL1 == null) {

}
constructor(privateKey, providerL2, providerL1) {
super(privateKey, providerL2);
if (this.provider != null) {
const chainId = this.getChainId();
// @ts-ignore
this.eip712 = new signer_1.EIP712Signer(this, chainId);
}
this.providerL1 = providerL1;
}
async populateTransaction(transaction) {

@@ -65,0 +65,0 @@ var _a, _b;

@@ -27,3 +27,3 @@ /* Autogenerated file. Do not edit manually. */

"claimFailedDeposit(address,address,bytes32,uint256,uint256,uint16,bytes32[])": FunctionFragment;
"deposit(address,address,uint256)": FunctionFragment;
"deposit(address,address,uint256,uint256,uint256)": FunctionFragment;
"finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])": FunctionFragment;

@@ -48,3 +48,3 @@ "isWithdrawalFinalized(uint256,uint256)": FunctionFragment;

functionFragment: "deposit",
values: [string, string, BigNumberish]
values: [string, string, BigNumberish, BigNumberish, BigNumberish]
): string;

@@ -133,9 +133,13 @@ encodeFunctionData(

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<ContractTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -219,9 +223,13 @@ ): Promise<ContractTransaction>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<ContractTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -294,9 +302,13 @@ ): Promise<ContractTransaction>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: CallOverrides

@@ -394,9 +406,13 @@ ): Promise<string>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<BigNumber>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -473,9 +489,13 @@ ): Promise<BigNumber>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<PopulatedTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -482,0 +502,0 @@ ): Promise<PopulatedTransaction>;

@@ -156,2 +156,12 @@ "use strict";

},
{
internalType: "uint256",
name: "_l2TxGasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2TxGasPerPubdataByte",
type: "uint256",
},
],

@@ -158,0 +168,0 @@ name: "deposit",

export { IZkSyncFactory } from './IZkSyncFactory';
export type { IZkSync } from './IZkSync';
export { IERC20Factory } from './IERC20Factory';
export type { IERC20 } from './IERC20';
export { IERC20MetadataFactory } from './IERC20MetadataFactory';
export type { IERC20Metadata } from './IERC20Metadata';
export { IL1BridgeFactory } from './IL1BridgeFactory';

@@ -11,1 +11,3 @@ export type { IL1Bridge } from './IL1Bridge';

export type { IAllowList } from './IAllowList';
export { IEthTokenFactory } from './IEthTokenFactory';
export type { IEthToken } from './IEthToken';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IAllowListFactory = exports.IL2BridgeFactory = exports.IL1BridgeFactory = exports.IERC20Factory = exports.IZkSyncFactory = void 0;
exports.IEthTokenFactory = exports.IAllowListFactory = exports.IL2BridgeFactory = exports.IL1BridgeFactory = exports.IERC20MetadataFactory = exports.IZkSyncFactory = void 0;
var IZkSyncFactory_1 = require("./IZkSyncFactory");
Object.defineProperty(exports, "IZkSyncFactory", { enumerable: true, get: function () { return IZkSyncFactory_1.IZkSyncFactory; } });
var IERC20Factory_1 = require("./IERC20Factory");
Object.defineProperty(exports, "IERC20Factory", { enumerable: true, get: function () { return IERC20Factory_1.IERC20Factory; } });
var IERC20MetadataFactory_1 = require("./IERC20MetadataFactory");
Object.defineProperty(exports, "IERC20MetadataFactory", { enumerable: true, get: function () { return IERC20MetadataFactory_1.IERC20MetadataFactory; } });
var IL1BridgeFactory_1 = require("./IL1BridgeFactory");

@@ -14,1 +14,3 @@ Object.defineProperty(exports, "IL1BridgeFactory", { enumerable: true, get: function () { return IL1BridgeFactory_1.IL1BridgeFactory; } });

Object.defineProperty(exports, "IAllowListFactory", { enumerable: true, get: function () { return IAllowListFactory_1.IAllowListFactory; } });
var IEthTokenFactory_1 = require("./IEthTokenFactory");
Object.defineProperty(exports, "IEthTokenFactory", { enumerable: true, get: function () { return IEthTokenFactory_1.IEthTokenFactory; } });

@@ -105,8 +105,2 @@ "use strict";

},
{
indexed: false,
internalType: "enum IExecutor.BlockVerificationMode",
name: "verificationMode",
type: "uint8",
},
],

@@ -120,46 +114,5 @@ name: "BlocksVerification",

{
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: [
{
indexed: false,
indexed: true,
internalType: "uint256",
name: "currentProposalId",
name: "proposalId",
type: "uint256",

@@ -170,7 +123,7 @@ },

internalType: "bytes32",
name: "proposedDiamondCutHash",
name: "proposalHash",
type: "bytes32",
},
],
name: "DiamondCutProposalCancelation",
name: "CancelUpgradeProposal",
type: "event",

@@ -182,48 +135,15 @@ },

{
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: true,
internalType: "address",
name: "to",
type: "address",
},
{
indexed: false,
internalType: "struct Diamond.DiamondCutData",
name: "_diamondCut",
type: "tuple",
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "DiamondCutProposalExecution",
name: "EthWithdrawalFinalized",
type: "event",

@@ -236,26 +156,20 @@ },

indexed: true,
internalType: "address",
name: "_address",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "currentProposalId",
name: "proposalId",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "securityCouncilEmergencyApprovals",
type: "uint256",
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
{
indexed: true,
indexed: false,
internalType: "bytes32",
name: "proposedDiamondCutHash",
name: "proposalSalt",
type: "bytes32",
},
],
name: "EmergencyDiamondCutApproved",
name: "ExecuteUpgrade",
type: "event",

@@ -266,3 +180,3 @@ },

inputs: [],
name: "EmergencyFreeze",
name: "Freeze",
type: "event",

@@ -377,3 +291,3 @@ },

internalType: "uint64",
name: "expirationBlock",
name: "expirationTimestamp",
type: "uint64",

@@ -400,3 +314,3 @@ },

internalType: "uint256",
name: "ergsLimit",
name: "gasLimit",
type: "uint256",

@@ -406,3 +320,3 @@ },

internalType: "uint256",
name: "ergsPerPubdataByteLimit",
name: "gasPerPubdataByteLimit",
type: "uint256",

@@ -412,3 +326,3 @@ },

internalType: "uint256",
name: "maxFeePerErg",
name: "maxFeePerGas",
type: "uint256",

@@ -418,3 +332,3 @@ },

internalType: "uint256",
name: "maxPriorityFeePerErg",
name: "maxPriorityFeePerGas",
type: "uint256",

@@ -428,5 +342,15 @@ },

{
internalType: "uint256[6]",
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "uint256[4]",
name: "reserved",
type: "uint256[6]",
type: "uint256[4]",
},

@@ -478,2 +402,21 @@ {

{
indexed: false,
internalType: "uint256",
name: "oldPriorityTxMaxGasLimit",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "newPriorityTxMaxGasLimit",
type: "uint256",
},
],
name: "NewPriorityTxMaxGasLimit",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,

@@ -551,8 +494,103 @@ internalType: "address",

{
indexed: true,
internalType: "uint256",
name: "proposalId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
],
name: "ProposeShadowUpgrade",
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",
},
{
indexed: true,
internalType: "uint256",
name: "lastDiamondFreezeTimestamp",
name: "proposalId",
type: "uint256",
},
{
indexed: false,
internalType: "bytes32",
name: "proposalSalt",
type: "bytes32",
},
],
name: "ProposeTransparentUpgrade",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "proposalId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
],
name: "SecurityCouncilUpgradeApprove",
type: "event",
},
{
anonymous: false,
inputs: [],
name: "Unfreeze",

@@ -591,7 +629,7 @@ type: "event",

internalType: "bytes32",
name: "_diamondCutHash",
name: "_proposedUpgradeHash",
type: "bytes32",
},
],
name: "approveEmergencyDiamondCutAsSecurityCouncilMember",
name: "cancelUpgradeProposal",
outputs: [],

@@ -602,9 +640,2 @@ stateMutability: "nonpayable",

{
inputs: [],
name: "cancelDiamondCutProposal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [

@@ -732,9 +763,2 @@ {

{
inputs: [],
name: "emergencyFreezeDiamond",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [

@@ -840,4 +864,9 @@ {

},
{
internalType: "bytes32",
name: "_proposalSalt",
type: "bytes32",
},
],
name: "executeDiamondCutProposal",
name: "executeUpgrade",
outputs: [],

@@ -924,3 +953,43 @@ stateMutability: "nonpayable",

{
inputs: [
{
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
{
internalType: "uint16",
name: "_l2TxNumberInBlock",
type: "uint16",
},
{
internalType: "bytes",
name: "_message",
type: "bytes",
},
{
internalType: "bytes32[]",
name: "_merkleProof",
type: "bytes32[]",
},
],
name: "finalizeEthWithdrawal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "freezeDiamond",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "getCurrentProposalId",

@@ -965,8 +1034,8 @@ outputs: [

inputs: [],
name: "getLastDiamondFreezeTimestamp",
name: "getL2BootloaderBytecodeHash",
outputs: [
{
internalType: "uint256",
internalType: "bytes32",
name: "",
type: "uint256",
type: "bytes32",
},

@@ -979,2 +1048,15 @@ ],

inputs: [],
name: "getL2DefaultAccountBytecodeHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getPendingGovernor",

@@ -1006,8 +1088,8 @@ outputs: [

inputs: [],
name: "getProposedDiamondCutHash",
name: "getPriorityTxMaxGasLimit",
outputs: [
{
internalType: "bytes32",
internalType: "uint256",
name: "",
type: "bytes32",
type: "uint256",
},

@@ -1020,8 +1102,8 @@ ],

inputs: [],
name: "getProposedDiamondCutTimestamp",
name: "getProposedUpgradeHash",
outputs: [
{
internalType: "uint256",
internalType: "bytes32",
name: "",
type: "uint256",
type: "bytes32",
},

@@ -1034,3 +1116,3 @@ ],

inputs: [],
name: "getSecurityCouncilEmergencyApprovals",
name: "getProposedUpgradeTimestamp",
outputs: [

@@ -1047,10 +1129,17 @@ {

{
inputs: [
inputs: [],
name: "getSecurityCouncil",
outputs: [
{
internalType: "address",
name: "_address",
name: "",
type: "address",
},
],
name: "getSecurityCouncilMemberLastApprovedProposalId",
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getTotalBlocksCommitted",
outputs: [

@@ -1068,3 +1157,3 @@ {

inputs: [],
name: "getTotalBlocksCommitted",
name: "getTotalBlocksExecuted",
outputs: [

@@ -1082,3 +1171,3 @@ {

inputs: [],
name: "getTotalBlocksExecuted",
name: "getTotalBlocksVerified",
outputs: [

@@ -1096,3 +1185,3 @@ {

inputs: [],
name: "getTotalBlocksVerified",
name: "getTotalPriorityTxs",
outputs: [

@@ -1110,8 +1199,8 @@ {

inputs: [],
name: "getTotalPriorityTxs",
name: "getUpgradeProposalState",
outputs: [
{
internalType: "uint256",
internalType: "enum UpgradeState",
name: "",
type: "uint256",
type: "uint8",
},

@@ -1137,2 +1226,45 @@ ],

inputs: [],
name: "getVerifierParams",
outputs: [
{
components: [
{
internalType: "bytes32",
name: "recursionNodeLevelVkHash",
type: "bytes32",
},
{
internalType: "bytes32",
name: "recursionLeafLevelVkHash",
type: "bytes32",
},
{
internalType: "bytes32",
name: "recursionCircuitsSetVksHash",
type: "bytes32",
},
],
internalType: "struct VerifierParams",
name: "",
type: "tuple",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isApprovedBySecurityCouncil",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isDiamondStorageFrozen",

@@ -1152,8 +1284,13 @@ outputs: [

{
internalType: "bytes4",
name: "_selector",
type: "bytes4",
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
],
name: "isFunctionFreezable",
name: "isEthWithdrawalFinalized",
outputs: [

@@ -1173,10 +1310,29 @@ {

internalType: "address",
name: "_address",
name: "_facet",
type: "address",
},
],
name: "isSecurityCouncilMember",
name: "isFacetFreezable",
outputs: [
{
internalType: "bool",
name: "isFreezable",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes4",
name: "_selector",
type: "bytes4",
},
],
name: "isFunctionFreezable",
outputs: [
{
internalType: "bool",
name: "",

@@ -1236,9 +1392,9 @@ type: "bool",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint32",
name: "_calldataLength",
type: "uint32",
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},

@@ -1270,3 +1426,3 @@ ],

internalType: "uint64",
name: "expirationBlock",
name: "expirationTimestamp",
type: "uint64",

@@ -1291,35 +1447,70 @@ },

{
internalType: "bytes32",
name: "_proposalHash",
type: "bytes32",
},
{
internalType: "uint40",
name: "_proposalId",
type: "uint40",
},
],
name: "proposeShadowUpgrade",
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: "facet",
name: "initAddress",
type: "address",
},
{
internalType: "enum Diamond.Action",
name: "action",
type: "uint8",
internalType: "bytes",
name: "initCalldata",
type: "bytes",
},
{
internalType: "bool",
name: "isFreezable",
type: "bool",
},
{
internalType: "bytes4[]",
name: "selectors",
type: "bytes4[]",
},
],
internalType: "struct Diamond.FacetCut[]",
name: "_facetCuts",
type: "tuple[]",
internalType: "struct Diamond.DiamondCutData",
name: "_diamondCut",
type: "tuple",
},
{
internalType: "address",
name: "_initAddress",
type: "address",
internalType: "uint40",
name: "_proposalId",
type: "uint40",
},
],
name: "proposeDiamondCut",
name: "proposeTransparentUpgrade",
outputs: [],

@@ -1429,3 +1620,3 @@ stateMutability: "nonpayable",

internalType: "uint256[]",
name: "recurisiveAggregationInput",
name: "recursiveAggregationInput",
type: "uint256[]",

@@ -1443,7 +1634,2 @@ },

},
{
internalType: "enum IExecutor.BlockVerificationMode",
name: "_verificationMode",
type: "uint8",
},
],

@@ -1458,3 +1644,47 @@ name: "proveBlocks",

{
internalType: "bytes32",
name: "_l2TxHash",
type: "bytes32",
},
{
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
{
internalType: "uint16",
name: "_l2TxNumberInBlock",
type: "uint16",
},
{
internalType: "bytes32[]",
name: "_merkleProof",
type: "bytes32[]",
},
{
internalType: "enum TxStatus",
name: "_status",
type: "uint8",
},
],
name: "proveL1ToL2TransactionStatus",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_blockNumber",

@@ -1592,6 +1822,11 @@ type: "uint256",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "bytes[]",

@@ -1601,2 +1836,7 @@ name: "_factoryDeps",

},
{
internalType: "address",
name: "_refundRecipient",
type: "address",
},
],

@@ -1630,2 +1870,15 @@ name: "requestL2Transaction",

{
internalType: "bytes32",
name: "_upgradeProposalHash",
type: "bytes32",
},
],
name: "securityCouncilUpgradeApprove",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",

@@ -1657,6 +1910,11 @@ name: "_txId",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "bytes[]",

@@ -1666,2 +1924,12 @@ name: "_factoryDeps",

},
{
internalType: "uint256",
name: "_toMint",
type: "uint256",
},
{
internalType: "address",
name: "_refundRecipient",
type: "address",
},
],

@@ -1689,3 +1957,3 @@ name: "serializeL2Transaction",

internalType: "uint256",
name: "ergsLimit",
name: "gasLimit",
type: "uint256",

@@ -1695,3 +1963,3 @@ },

internalType: "uint256",
name: "ergsPerPubdataByteLimit",
name: "gasPerPubdataByteLimit",
type: "uint256",

@@ -1701,3 +1969,3 @@ },

internalType: "uint256",
name: "maxFeePerErg",
name: "maxFeePerGas",
type: "uint256",

@@ -1707,3 +1975,3 @@ },

internalType: "uint256",
name: "maxPriorityFeePerErg",
name: "maxPriorityFeePerGas",
type: "uint256",

@@ -1717,5 +1985,15 @@ },

{
internalType: "uint256[6]",
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "uint256[4]",
name: "reserved",
type: "uint256[6]",
type: "uint256[4]",
},

@@ -1799,3 +2077,3 @@ {

internalType: "bool",
name: "_isPorterAvailable",
name: "_zkPorterIsAvailable",
type: "bool",

@@ -1812,2 +2090,15 @@ },

{
internalType: "uint256",
name: "_newPriorityTxMaxGasLimit",
type: "uint256",
},
],
name: "setPriorityTxMaxGasLimit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",

@@ -1897,2 +2188,70 @@ name: "_validator",

},
{
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",
},
{
internalType: "uint256",
name: "_proposalId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_salt",
type: "bytes32",
},
],
name: "upgradeProposalHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "pure",
type: "function",
},
];
{
"name": "zksync-web3",
"version": "0.12.5",
"version": "0.13.0-beta.0",
"main": "build/src/index.js",

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

@@ -8,8 +8,10 @@ import { BigNumber, BigNumberish, ethers, BytesLike } from 'ethers';

checkBaseCost,
undoL1ToL2Alias,
layer1TxDefaults,
DEFAULT_ERGS_PER_PUBDATA_LIMIT,
DEFAULT_GAS_PER_PUBDATA_LIMIT,
L1_MESSENGER_ADDRESS,
BOOTLOADER_FORMAL_ADDRESS
BOOTLOADER_FORMAL_ADDRESS,
RECOMMENDED_DEPOSIT_L2_GAS_LIMIT
} from './utils';
import { IZkSyncFactory, IL1BridgeFactory, IL2BridgeFactory, IERC20Factory } from '../typechain';
import { IZkSyncFactory, IL1BridgeFactory, IL2BridgeFactory, IERC20MetadataFactory } from '../typechain';
import { Address, PriorityOpResponse, BlockTag, Eip712Meta, TransactionResponse, BalancesMap } from './types';

@@ -54,3 +56,3 @@

} else {
const erc20contract = IERC20Factory.connect(token, this._providerL1());
const erc20contract = IERC20MetadataFactory.connect(token, this._providerL1());
return await erc20contract.balanceOf(await this.getAddress());

@@ -79,3 +81,3 @@ }

let bridgeAddress = overrides?.bridgeAddress;
const erc20contract = IERC20Factory.connect(token, this._signerL1());
const erc20contract = IERC20MetadataFactory.connect(token, this._signerL1());

@@ -104,4 +106,4 @@ if (bridgeAddress == null) {

async getBaseCost(params: {
ergsLimit: BigNumberish;
calldataLength: BigNumberish;
gasLimit: BigNumberish;
gasPerPubdataByte?: BigNumberish;
gasPrice?: BigNumberish;

@@ -112,7 +114,9 @@ }): Promise<BigNumber> {

parameters.gasPrice ??= await this._providerL1().getGasPrice();
parameters.gasPerPubdataByte ??= DEFAULT_GAS_PER_PUBDATA_LIMIT;
return BigNumber.from(
await zksyncContract.l2TransactionBaseCost(
parameters.gasPrice,
parameters.ergsLimit,
parameters.calldataLength
parameters.gasLimit,
parameters.gasPerPubdataByte
)

@@ -129,2 +133,4 @@ );

approveERC20?: boolean;
gasLimit?: BigNumberish;
gasPerPubdataByte?: BigNumberish;
overrides?: ethers.PayableOverrides;

@@ -143,2 +149,4 @@ approveOverrides?: ethers.Overrides;

tx.overrides ??= {};
tx.gasPerPubdataByte ??= DEFAULT_GAS_PER_PUBDATA_LIMIT;
tx.gasLimit ??= BigNumber.from(RECOMMENDED_DEPOSIT_L2_GAS_LIMIT);

@@ -152,3 +160,9 @@ const { to, token, amount, operatorTip, overrides } = tx;

const args: [Address, Address, BigNumberish] = [to, token, amount];
const args: [Address, Address, BigNumberish, BigNumberish, BigNumberish] = [
to,
token,
amount,
tx.gasLimit,
tx.gasPerPubdataByte
];

@@ -158,5 +172,11 @@ if (token == ETH_ADDRESS) {

await checkBaseCost(baseCost, overrides.value);
return this._providerL2().getPriorityOpResponse(await bridgeContracts.eth.deposit(...args, overrides));
return await this.requestExecute({
contractAddress: to,
calldata: '0x',
l2Value: amount,
// For some reason typescript can not deduce that we've already set the
// tx.gasLimit
gasLimit: tx.gasLimit!,
...tx
});
} else {

@@ -225,2 +245,16 @@ overrides.value ??= baseCost.add(operatorTip);

if (isETH(sender)) {
const contractAddress = await this._providerL2().getMainContractAddress();
const zksync = IZkSyncFactory.connect(contractAddress, this._signerL1());
return await zksync.finalizeEthWithdrawal(
log.l1BatchNumber,
proof.id,
l1BatchTxId,
message,
proof.proof,
overrides ?? {}
);
}
const l2Bridge = IL2BridgeFactory.connect(sender, this._providerL2());

@@ -246,2 +280,10 @@ const l1Bridge = IL1BridgeFactory.connect(await l2Bridge.l1Bridge(), this._signerL1());

const proof = await this._providerL2().getLogProof(withdrawalHash, l2ToL1LogIndex);
if (isETH(sender)) {
const contractAddress = await this._providerL2().getMainContractAddress();
const zksync = IZkSyncFactory.connect(contractAddress, this._signerL1());
return await zksync.isEthWithdrawalFinalized(log.l1BatchNumber, proof.id);
}
const l2Bridge = IL2BridgeFactory.connect(sender, this._providerL2());

@@ -265,3 +307,4 @@ const l1Bridge = IL1BridgeFactory.connect(await l2Bridge.l1Bridge(), this._providerL1());

const l1BridgeAddress = receipt.from;
// Undo the aliasing, since the Mailbox contract set it as for contract address.
const l1BridgeAddress = undoL1ToL2Alias(receipt.from);
const l2BridgeAddress = receipt.to;

@@ -290,6 +333,8 @@

calldata: BytesLike;
ergsLimit: BigNumberish;
gasLimit: BigNumberish;
l2Value?: BigNumberish;
factoryDeps?: ethers.BytesLike[];
operatorTip?: BigNumberish;
gasPerPubdataByte?: BigNumberish;
refundRecipient?: Address;
overrides?: ethers.PayableOverrides;

@@ -304,4 +349,16 @@ }): Promise<PriorityOpResponse> {

tx.overrides ??= {};
tx.gasPerPubdataByte ??= DEFAULT_GAS_PER_PUBDATA_LIMIT;
tx.refundRecipient ??= await this.getAddress();
const { contractAddress, l2Value, calldata, ergsLimit, factoryDeps, operatorTip, overrides } = tx;
const {
contractAddress,
l2Value,
calldata,
gasLimit,
factoryDeps,
operatorTip,
overrides,
gasPerPubdataByte,
refundRecipient
} = tx;
overrides.gasPrice ??= await this._providerL1().getGasPrice();

@@ -312,7 +369,7 @@ overrides.gasLimit ??= BigNumber.from(RECOMMENDED_GAS_LIMIT.EXECUTE);

gasPrice: await overrides.gasPrice,
calldataLength: ethers.utils.hexDataLength(calldata),
ergsLimit
gasPerPubdataByte,
gasLimit
});
overrides.value ??= baseCost.add(operatorTip);
overrides.value ??= baseCost.add(operatorTip).add(l2Value);

@@ -326,4 +383,6 @@ await checkBaseCost(baseCost, overrides.value);

calldata,
ergsLimit,
gasLimit,
DEFAULT_GAS_PER_PUBDATA_LIMIT,
factoryDeps,
refundRecipient,
overrides

@@ -363,3 +422,3 @@ )

const customData = { ...data };
customData.ergsPerPubdata ??= DEFAULT_ERGS_PER_PUBDATA_LIMIT;
customData.ergsPerPubdata ??= DEFAULT_GAS_PER_PUBDATA_LIMIT;
customData.factoryDeps ??= [];

@@ -366,0 +425,0 @@ return customData;

import { Wallet } from './wallet';
import { Signer } from './signer';
import { Contract, ContractInterface, ethers, utils } from 'ethers';
import { BytesLike, Contract, ContractInterface, ethers, utils } from 'ethers';
import {

@@ -10,5 +10,5 @@ hashBytecode,

getDeployedContracts,
DEFAULT_ERGS_PER_PUBDATA_LIMIT
DEFAULT_GAS_PER_PUBDATA_LIMIT
} from './utils';
import { DeploymentType } from './types';
import { AccountAbstractionVersion, DeploymentType } from './types';
export { Contract } from 'ethers';

@@ -30,2 +30,17 @@

private encodeCalldata(salt: BytesLike, bytecodeHash: BytesLike, constructorCalldata: BytesLike) {
if (this.deploymentType == 'create') {
return CONTRACT_DEPLOYER.encodeFunctionData('create', [salt, bytecodeHash, constructorCalldata]);
} else if (this.deploymentType == 'createAccount') {
return CONTRACT_DEPLOYER.encodeFunctionData('createAccount', [
salt,
bytecodeHash,
constructorCalldata,
AccountAbstractionVersion.Version1
]);
} else {
throw new Error(`Unsupported deployment type ${this.deploymentType}`);
}
}
override getDeployTransaction(...args: any[]): ethers.providers.TransactionRequest {

@@ -45,8 +60,5 @@ // TODO (SMA-1585): Users should be able to provide the salt.

const constructorCalldata = utils.arrayify(this.interface.encodeDeploy(args));
const deployCalldata = CONTRACT_DEPLOYER.encodeFunctionData(this.deploymentType, [
salt,
bytecodeHash,
constructorCalldata
]);
const deployCalldata = this.encodeCalldata(salt, bytecodeHash, constructorCalldata);
txRequest.type = EIP712_TX_TYPE;

@@ -57,3 +69,3 @@ txRequest.to = CONTRACT_DEPLOYER_ADDRESS;

txRequest.customData.factoryDeps ??= [];
txRequest.customData.ergsPerPubdata ??= DEFAULT_ERGS_PER_PUBDATA_LIMIT;
txRequest.customData.gasPerPubdata ??= DEFAULT_GAS_PER_PUBDATA_LIMIT;
// The number of factory deps is relatively low, so it is efficient enough.

@@ -60,0 +72,0 @@ if (!txRequest.customData.factoryDeps.includes(this.bytecode)) {

@@ -1,6 +0,6 @@

import { ethers, BigNumber, BigNumberish, utils, providers, BytesLike } from 'ethers';
import { ethers, BigNumber, BigNumberish, utils, providers, BytesLike, Contract } from 'ethers';
import Formatter = providers.Formatter;
import { ExternalProvider } from '@ethersproject/providers';
import { ConnectionInfo, poll } from '@ethersproject/web';
import { IERC20Factory, IL2BridgeFactory } from '../typechain';
import { IERC20MetadataFactory, IEthTokenFactory, IL2BridgeFactory } from '../typechain';
import {

@@ -21,6 +21,17 @@ Address,

Log,
TransactionDetails,
BlockDetails,
TransactionDetails
ContractAccountInfo
} from './types';
import { sleep, parseTransaction, ETH_ADDRESS, isETH, getL2HashFromPriorityOp, EIP712_TX_TYPE } from './utils';
import {
isETH,
getL2HashFromPriorityOp,
EIP712_TX_TYPE,
CONTRACT_DEPLOYER_ADDRESS,
CONTRACT_DEPLOYER,
ETH_ADDRESS,
parseTransaction,
sleep,
L2_ETH_TOKEN_ADDRESS
} from './utils';
import { Signer } from './signer';

@@ -156,3 +167,3 @@

try {
let token = IERC20Factory.connect(tokenAddress, this);
let token = IERC20MetadataFactory.connect(tokenAddress, this);
return await token.balanceOf(address, { blockTag: tag });

@@ -202,4 +213,6 @@ } catch {

result.eip712Meta = {
ergsPerPubdata: utils.hexValue(transaction.customData.ergsPerPubdata ?? 0)
// TODO: update server and use gasPerPubdata
ergsPerPubdata: utils.hexValue(transaction.customData.gasPerPubdata ?? 0)
} as any;
transaction.type = EIP712_TX_TYPE;
if (transaction.customData.factoryDeps) {

@@ -369,5 +382,22 @@ // @ts-ignore

if (isETH(tx.token)) {
if (!tx.overrides.value) {
tx.overrides.value = tx.amount;
}
const passedValue = BigNumber.from(tx.overrides.value);
if (!passedValue.eq(tx.amount)) {
// To avoid users shooting themselves into the foot, we will always use the amount to withdraw
// as the value
throw new Error('The tx.value is not equal to the value withdrawn');
}
const ethL2Token = IEthTokenFactory.connect(L2_ETH_TOKEN_ADDRESS, this);
return ethL2Token.populateTransaction.withdraw(tx.to, tx.overrides);
}
if (tx.bridgeAddress == null) {
const bridges = await this.getDefaultBridgeAddresses();
tx.bridgeAddress = isETH(tx.token) ? bridges.ethL2 : bridges.erc20L2;
tx.bridgeAddress = bridges.erc20L2;
}

@@ -409,3 +439,3 @@

} else {
const token = IERC20Factory.connect(tx.token, this);
const token = IERC20MetadataFactory.connect(tx.token, this);
return await token.populateTransaction.transfer(tx.to, tx.amount, tx.overrides);

@@ -544,2 +574,12 @@ }

}
async getContractAccountInfo(address: Address): Promise<ContractAccountInfo> {
const deployerContract = new Contract(CONTRACT_DEPLOYER_ADDRESS, CONTRACT_DEPLOYER, this);
const data = await deployerContract.getAccountInfo(address);
return {
supportedAAVersion: data.supportedAAVersion,
nonceOrdering: data.nonceOrdering
};
}
}

@@ -546,0 +586,0 @@

import { ethers } from 'ethers';
import { Provider } from './provider';
import { serialize, EIP712_TX_TYPE, hashBytecode, DEFAULT_ERGS_PER_PUBDATA_LIMIT } from './utils';
import { serialize, EIP712_TX_TYPE, hashBytecode, DEFAULT_GAS_PER_PUBDATA_LIMIT } from './utils';
import { BlockTag, TransactionResponse, Signature, TransactionRequest } from './types';

@@ -14,6 +14,6 @@ import { TypedDataDomain, TypedDataSigner } from '@ethersproject/abstract-signer';

{ name: 'to', type: 'uint256' },
{ name: 'ergsLimit', type: 'uint256' },
{ name: 'ergsPerPubdataByteLimit', type: 'uint256' },
{ name: 'maxFeePerErg', type: 'uint256' },
{ name: 'maxPriorityFeePerErg', type: 'uint256' },
{ name: 'gasLimit', type: 'uint256' },
{ name: 'gasPerPubdataByteLimit', type: 'uint256' },
{ name: 'maxFeePerGas', type: 'uint256' },
{ name: 'maxPriorityFeePerGas', type: 'uint256' },
{ name: 'paymaster', type: 'uint256' },

@@ -39,5 +39,5 @@ { name: 'nonce', type: 'uint256' },

static getSignInput(transaction: TransactionRequest) {
const maxFeePerErg = transaction.maxFeePerGas || transaction.gasPrice;
const maxPriorityFeePerErg = transaction.maxPriorityFeePerGas || maxFeePerErg;
const ergsPerPubdataByteLimit = transaction.customData?.ergsPerPubdata || DEFAULT_ERGS_PER_PUBDATA_LIMIT;
const maxFeePerGas = transaction.maxFeePerGas || transaction.gasPrice;
const maxPriorityFeePerGas = transaction.maxPriorityFeePerGas || maxFeePerGas;
const gasPerPubdataByteLimit = transaction.customData?.ergsPerPubdata || DEFAULT_GAS_PER_PUBDATA_LIMIT;
const signInput = {

@@ -47,6 +47,6 @@ txType: transaction.type,

to: transaction.to,
ergsLimit: transaction.gasLimit,
ergsPerPubdataByteLimit,
maxFeePerErg,
maxPriorityFeePerErg,
gasLimit: transaction.gasLimit,
gasPerPubdataByteLimit: gasPerPubdataByteLimit,
maxFeePerGas,
maxPriorityFeePerGas,
paymaster: transaction.customData?.paymasterParams?.paymaster || ethers.constants.AddressZero,

@@ -53,0 +53,0 @@ nonce: transaction.nonce,

@@ -161,2 +161,17 @@ import { BytesLike, BigNumberish, providers, BigNumber } from 'ethers';

export enum AccountAbstractionVersion {
None = 0,
Version1 = 1
}
export enum AccountNonceOrdering {
Sequential = 0,
Arbitrary = 1
}
export interface ContractAccountInfo {
supportedAAVersion: AccountAbstractionVersion;
nonceOrdering: AccountNonceOrdering;
}
export interface BlockDetails {

@@ -163,0 +178,0 @@ number: number;

@@ -31,13 +31,21 @@ import { utils, ethers, BigNumber, BigNumberish, BytesLike } from 'ethers';

export const L1_MESSENGER_ADDRESS = '0x0000000000000000000000000000000000008008';
export const L2_ETH_TOKEN_ADDRESS = '0x000000000000000000000000000000000000800a';
export const L1_TO_L2_ALIAS_OFFSET = '0x1111000000000000000000000000000000001111';
export const EIP1271_MAGIC_VALUE = '0x1626ba7e';
export const EIP712_TX_TYPE = 0x71;
export const PRIORITY_OPERATION_L2_TX_TYPE = 0xff;
export const MAX_BYTECODE_LEN_BYTES = ((1 << 16) - 1) * 32;
// Default pubdata price limit to be used if user provided none.
const GAS_PER_PUBDATA_BYTE = 16;
export const DEFAULT_ERGS_PER_PUBDATA_LIMIT = GAS_PER_PUBDATA_BYTE * 10_000;
// The default L2 gas per pubdata byte
export const DEFAULT_GAS_PER_PUBDATA_LIMIT = 800;
// The recommended L2 gas limit for a deposit.
// TODO (SMA-1704): Note, that this number is largely inflated, mainly to ensure that the
// deposit will succeed if the token contract is yet to be deployed (which may very well be the case).
export const RECOMMENDED_DEPOSIT_L2_GAS_LIMIT = 10000000;
export const RECOMMENDED_GAS_LIMIT = {

@@ -50,3 +58,3 @@ DEPOSIT: 600_000,

export function isETH(token: Address) {
return token.toLowerCase() == ETH_ADDRESS;
return token.toLowerCase() == ETH_ADDRESS || token.toLowerCase() == L2_ETH_TOKEN_ADDRESS;
}

@@ -160,9 +168,9 @@

let maxFeePerErg = transaction.maxFeePerGas || transaction.gasPrice || 0;
let maxPriorityFeePerErg = transaction.maxPriorityFeePerGas || maxFeePerErg;
let maxFeePerGas = transaction.maxFeePerGas || transaction.gasPrice || 0;
let maxPriorityFeePerGas = transaction.maxPriorityFeePerGas || maxFeePerGas;
const fields: any[] = [
formatNumber(transaction.nonce || 0, 'nonce'),
formatNumber(maxPriorityFeePerErg, 'maxPriorityFeePerGas'),
formatNumber(maxFeePerErg, 'maxFeePerGas'),
formatNumber(maxPriorityFeePerGas, 'maxPriorityFeePerGas'),
formatNumber(maxFeePerGas, 'maxFeePerGas'),
formatNumber(transaction.gasLimit || 0, 'gasLimit'),

@@ -188,3 +196,3 @@ transaction.to != null ? utils.getAddress(transaction.to) : '0x',

// Add meta
fields.push(formatNumber(meta.ergsPerPubdata || DEFAULT_ERGS_PER_PUBDATA_LIMIT, 'ergsPerPubdata'));
fields.push(formatNumber(meta.ergsPerPubdata || DEFAULT_GAS_PER_PUBDATA_LIMIT, 'gasPerPubdata'));
fields.push((meta.factoryDeps ?? []).map((dep) => utils.hexlify(dep)));

@@ -370,2 +378,10 @@

export function applyL1ToL2Alias(address: string): string {
return ethers.utils.hexlify(ethers.BigNumber.from(address).add(L1_TO_L2_ALIAS_OFFSET));
}
export function undoL1ToL2Alias(address: string): string {
return ethers.utils.hexlify(ethers.BigNumber.from(address).sub(L1_TO_L2_ALIAS_OFFSET));
}
// The method with similar functionality is already available in ethers.js,

@@ -372,0 +388,0 @@ // the only difference is that we provide additional `try { } catch { }`

@@ -27,3 +27,3 @@ /* Autogenerated file. Do not edit manually. */

"claimFailedDeposit(address,address,bytes32,uint256,uint256,uint16,bytes32[])": FunctionFragment;
"deposit(address,address,uint256)": FunctionFragment;
"deposit(address,address,uint256,uint256,uint256)": FunctionFragment;
"finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])": FunctionFragment;

@@ -48,3 +48,3 @@ "isWithdrawalFinalized(uint256,uint256)": FunctionFragment;

functionFragment: "deposit",
values: [string, string, BigNumberish]
values: [string, string, BigNumberish, BigNumberish, BigNumberish]
): string;

@@ -133,9 +133,13 @@ encodeFunctionData(

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<ContractTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -219,9 +223,13 @@ ): Promise<ContractTransaction>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<ContractTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -294,9 +302,13 @@ ): Promise<ContractTransaction>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: CallOverrides

@@ -394,9 +406,13 @@ ): Promise<string>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<BigNumber>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -473,9 +489,13 @@ ): Promise<BigNumber>;

_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides
): Promise<PopulatedTransaction>;
"deposit(address,address,uint256)"(
"deposit(address,address,uint256,uint256,uint256)"(
_l2Receiver: string,
_l1Token: string,
_amount: BigNumberish,
_l2TxGasLimit: BigNumberish,
_l2TxGasPerPubdataByte: BigNumberish,
overrides?: PayableOverrides

@@ -482,0 +502,0 @@ ): Promise<PopulatedTransaction>;

@@ -161,2 +161,12 @@ /* Autogenerated file. Do not edit manually. */

},
{
internalType: "uint256",
name: "_l2TxGasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2TxGasPerPubdataByte",
type: "uint256",
},
],

@@ -163,0 +173,0 @@ name: "deposit",

export { IZkSyncFactory } from './IZkSyncFactory';
export type { IZkSync } from './IZkSync';
export { IERC20Factory } from './IERC20Factory';
export type { IERC20 } from './IERC20';
export { IERC20MetadataFactory } from './IERC20MetadataFactory';
export type { IERC20Metadata } from './IERC20Metadata';
export { IL1BridgeFactory } from './IL1BridgeFactory';

@@ -11,1 +11,4 @@ export type { IL1Bridge } from './IL1Bridge';

export type { IAllowList } from './IAllowList';
export { IEthTokenFactory } from './IEthTokenFactory';
export type { IEthToken } from './IEthToken';

@@ -110,8 +110,2 @@ /* Autogenerated file. Do not edit manually. */

},
{
indexed: false,
internalType: "enum IExecutor.BlockVerificationMode",
name: "verificationMode",
type: "uint8",
},
],

@@ -125,46 +119,5 @@ name: "BlocksVerification",

{
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: [
{
indexed: false,
indexed: true,
internalType: "uint256",
name: "currentProposalId",
name: "proposalId",
type: "uint256",

@@ -175,7 +128,7 @@ },

internalType: "bytes32",
name: "proposedDiamondCutHash",
name: "proposalHash",
type: "bytes32",
},
],
name: "DiamondCutProposalCancelation",
name: "CancelUpgradeProposal",
type: "event",

@@ -187,48 +140,15 @@ },

{
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: true,
internalType: "address",
name: "to",
type: "address",
},
{
indexed: false,
internalType: "struct Diamond.DiamondCutData",
name: "_diamondCut",
type: "tuple",
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "DiamondCutProposalExecution",
name: "EthWithdrawalFinalized",
type: "event",

@@ -241,26 +161,20 @@ },

indexed: true,
internalType: "address",
name: "_address",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "currentProposalId",
name: "proposalId",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "securityCouncilEmergencyApprovals",
type: "uint256",
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
{
indexed: true,
indexed: false,
internalType: "bytes32",
name: "proposedDiamondCutHash",
name: "proposalSalt",
type: "bytes32",
},
],
name: "EmergencyDiamondCutApproved",
name: "ExecuteUpgrade",
type: "event",

@@ -271,3 +185,3 @@ },

inputs: [],
name: "EmergencyFreeze",
name: "Freeze",
type: "event",

@@ -382,3 +296,3 @@ },

internalType: "uint64",
name: "expirationBlock",
name: "expirationTimestamp",
type: "uint64",

@@ -405,3 +319,3 @@ },

internalType: "uint256",
name: "ergsLimit",
name: "gasLimit",
type: "uint256",

@@ -411,3 +325,3 @@ },

internalType: "uint256",
name: "ergsPerPubdataByteLimit",
name: "gasPerPubdataByteLimit",
type: "uint256",

@@ -417,3 +331,3 @@ },

internalType: "uint256",
name: "maxFeePerErg",
name: "maxFeePerGas",
type: "uint256",

@@ -423,3 +337,3 @@ },

internalType: "uint256",
name: "maxPriorityFeePerErg",
name: "maxPriorityFeePerGas",
type: "uint256",

@@ -433,5 +347,15 @@ },

{
internalType: "uint256[6]",
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "uint256[4]",
name: "reserved",
type: "uint256[6]",
type: "uint256[4]",
},

@@ -483,2 +407,21 @@ {

{
indexed: false,
internalType: "uint256",
name: "oldPriorityTxMaxGasLimit",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "newPriorityTxMaxGasLimit",
type: "uint256",
},
],
name: "NewPriorityTxMaxGasLimit",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,

@@ -556,8 +499,103 @@ internalType: "address",

{
indexed: true,
internalType: "uint256",
name: "proposalId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
],
name: "ProposeShadowUpgrade",
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",
},
{
indexed: true,
internalType: "uint256",
name: "lastDiamondFreezeTimestamp",
name: "proposalId",
type: "uint256",
},
{
indexed: false,
internalType: "bytes32",
name: "proposalSalt",
type: "bytes32",
},
],
name: "ProposeTransparentUpgrade",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "proposalId",
type: "uint256",
},
{
indexed: true,
internalType: "bytes32",
name: "proposalHash",
type: "bytes32",
},
],
name: "SecurityCouncilUpgradeApprove",
type: "event",
},
{
anonymous: false,
inputs: [],
name: "Unfreeze",

@@ -596,7 +634,7 @@ type: "event",

internalType: "bytes32",
name: "_diamondCutHash",
name: "_proposedUpgradeHash",
type: "bytes32",
},
],
name: "approveEmergencyDiamondCutAsSecurityCouncilMember",
name: "cancelUpgradeProposal",
outputs: [],

@@ -607,9 +645,2 @@ stateMutability: "nonpayable",

{
inputs: [],
name: "cancelDiamondCutProposal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [

@@ -737,9 +768,2 @@ {

{
inputs: [],
name: "emergencyFreezeDiamond",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [

@@ -845,4 +869,9 @@ {

},
{
internalType: "bytes32",
name: "_proposalSalt",
type: "bytes32",
},
],
name: "executeDiamondCutProposal",
name: "executeUpgrade",
outputs: [],

@@ -929,3 +958,43 @@ stateMutability: "nonpayable",

{
inputs: [
{
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
{
internalType: "uint16",
name: "_l2TxNumberInBlock",
type: "uint16",
},
{
internalType: "bytes",
name: "_message",
type: "bytes",
},
{
internalType: "bytes32[]",
name: "_merkleProof",
type: "bytes32[]",
},
],
name: "finalizeEthWithdrawal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "freezeDiamond",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "getCurrentProposalId",

@@ -970,8 +1039,8 @@ outputs: [

inputs: [],
name: "getLastDiamondFreezeTimestamp",
name: "getL2BootloaderBytecodeHash",
outputs: [
{
internalType: "uint256",
internalType: "bytes32",
name: "",
type: "uint256",
type: "bytes32",
},

@@ -984,2 +1053,15 @@ ],

inputs: [],
name: "getL2DefaultAccountBytecodeHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getPendingGovernor",

@@ -1011,8 +1093,8 @@ outputs: [

inputs: [],
name: "getProposedDiamondCutHash",
name: "getPriorityTxMaxGasLimit",
outputs: [
{
internalType: "bytes32",
internalType: "uint256",
name: "",
type: "bytes32",
type: "uint256",
},

@@ -1025,8 +1107,8 @@ ],

inputs: [],
name: "getProposedDiamondCutTimestamp",
name: "getProposedUpgradeHash",
outputs: [
{
internalType: "uint256",
internalType: "bytes32",
name: "",
type: "uint256",
type: "bytes32",
},

@@ -1039,3 +1121,3 @@ ],

inputs: [],
name: "getSecurityCouncilEmergencyApprovals",
name: "getProposedUpgradeTimestamp",
outputs: [

@@ -1052,10 +1134,17 @@ {

{
inputs: [
inputs: [],
name: "getSecurityCouncil",
outputs: [
{
internalType: "address",
name: "_address",
name: "",
type: "address",
},
],
name: "getSecurityCouncilMemberLastApprovedProposalId",
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getTotalBlocksCommitted",
outputs: [

@@ -1073,3 +1162,3 @@ {

inputs: [],
name: "getTotalBlocksCommitted",
name: "getTotalBlocksExecuted",
outputs: [

@@ -1087,3 +1176,3 @@ {

inputs: [],
name: "getTotalBlocksExecuted",
name: "getTotalBlocksVerified",
outputs: [

@@ -1101,3 +1190,3 @@ {

inputs: [],
name: "getTotalBlocksVerified",
name: "getTotalPriorityTxs",
outputs: [

@@ -1115,8 +1204,8 @@ {

inputs: [],
name: "getTotalPriorityTxs",
name: "getUpgradeProposalState",
outputs: [
{
internalType: "uint256",
internalType: "enum UpgradeState",
name: "",
type: "uint256",
type: "uint8",
},

@@ -1142,2 +1231,45 @@ ],

inputs: [],
name: "getVerifierParams",
outputs: [
{
components: [
{
internalType: "bytes32",
name: "recursionNodeLevelVkHash",
type: "bytes32",
},
{
internalType: "bytes32",
name: "recursionLeafLevelVkHash",
type: "bytes32",
},
{
internalType: "bytes32",
name: "recursionCircuitsSetVksHash",
type: "bytes32",
},
],
internalType: "struct VerifierParams",
name: "",
type: "tuple",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isApprovedBySecurityCouncil",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isDiamondStorageFrozen",

@@ -1157,8 +1289,13 @@ outputs: [

{
internalType: "bytes4",
name: "_selector",
type: "bytes4",
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
],
name: "isFunctionFreezable",
name: "isEthWithdrawalFinalized",
outputs: [

@@ -1178,10 +1315,29 @@ {

internalType: "address",
name: "_address",
name: "_facet",
type: "address",
},
],
name: "isSecurityCouncilMember",
name: "isFacetFreezable",
outputs: [
{
internalType: "bool",
name: "isFreezable",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes4",
name: "_selector",
type: "bytes4",
},
],
name: "isFunctionFreezable",
outputs: [
{
internalType: "bool",
name: "",

@@ -1241,9 +1397,9 @@ type: "bool",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint32",
name: "_calldataLength",
type: "uint32",
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},

@@ -1275,3 +1431,3 @@ ],

internalType: "uint64",
name: "expirationBlock",
name: "expirationTimestamp",
type: "uint64",

@@ -1296,35 +1452,70 @@ },

{
internalType: "bytes32",
name: "_proposalHash",
type: "bytes32",
},
{
internalType: "uint40",
name: "_proposalId",
type: "uint40",
},
],
name: "proposeShadowUpgrade",
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: "facet",
name: "initAddress",
type: "address",
},
{
internalType: "enum Diamond.Action",
name: "action",
type: "uint8",
internalType: "bytes",
name: "initCalldata",
type: "bytes",
},
{
internalType: "bool",
name: "isFreezable",
type: "bool",
},
{
internalType: "bytes4[]",
name: "selectors",
type: "bytes4[]",
},
],
internalType: "struct Diamond.FacetCut[]",
name: "_facetCuts",
type: "tuple[]",
internalType: "struct Diamond.DiamondCutData",
name: "_diamondCut",
type: "tuple",
},
{
internalType: "address",
name: "_initAddress",
type: "address",
internalType: "uint40",
name: "_proposalId",
type: "uint40",
},
],
name: "proposeDiamondCut",
name: "proposeTransparentUpgrade",
outputs: [],

@@ -1434,3 +1625,3 @@ stateMutability: "nonpayable",

internalType: "uint256[]",
name: "recurisiveAggregationInput",
name: "recursiveAggregationInput",
type: "uint256[]",

@@ -1448,7 +1639,2 @@ },

},
{
internalType: "enum IExecutor.BlockVerificationMode",
name: "_verificationMode",
type: "uint8",
},
],

@@ -1463,3 +1649,47 @@ name: "proveBlocks",

{
internalType: "bytes32",
name: "_l2TxHash",
type: "bytes32",
},
{
internalType: "uint256",
name: "_l2BlockNumber",
type: "uint256",
},
{
internalType: "uint256",
name: "_l2MessageIndex",
type: "uint256",
},
{
internalType: "uint16",
name: "_l2TxNumberInBlock",
type: "uint16",
},
{
internalType: "bytes32[]",
name: "_merkleProof",
type: "bytes32[]",
},
{
internalType: "enum TxStatus",
name: "_status",
type: "uint8",
},
],
name: "proveL1ToL2TransactionStatus",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "_blockNumber",

@@ -1597,6 +1827,11 @@ type: "uint256",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "bytes[]",

@@ -1606,2 +1841,7 @@ name: "_factoryDeps",

},
{
internalType: "address",
name: "_refundRecipient",
type: "address",
},
],

@@ -1635,2 +1875,15 @@ name: "requestL2Transaction",

{
internalType: "bytes32",
name: "_upgradeProposalHash",
type: "bytes32",
},
],
name: "securityCouncilUpgradeApprove",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",

@@ -1662,6 +1915,11 @@ name: "_txId",

internalType: "uint256",
name: "_ergsLimit",
name: "_gasLimit",
type: "uint256",
},
{
internalType: "uint256",
name: "_gasPerPubdataByteLimit",
type: "uint256",
},
{
internalType: "bytes[]",

@@ -1671,2 +1929,12 @@ name: "_factoryDeps",

},
{
internalType: "uint256",
name: "_toMint",
type: "uint256",
},
{
internalType: "address",
name: "_refundRecipient",
type: "address",
},
],

@@ -1694,3 +1962,3 @@ name: "serializeL2Transaction",

internalType: "uint256",
name: "ergsLimit",
name: "gasLimit",
type: "uint256",

@@ -1700,3 +1968,3 @@ },

internalType: "uint256",
name: "ergsPerPubdataByteLimit",
name: "gasPerPubdataByteLimit",
type: "uint256",

@@ -1706,3 +1974,3 @@ },

internalType: "uint256",
name: "maxFeePerErg",
name: "maxFeePerGas",
type: "uint256",

@@ -1712,3 +1980,3 @@ },

internalType: "uint256",
name: "maxPriorityFeePerErg",
name: "maxPriorityFeePerGas",
type: "uint256",

@@ -1722,5 +1990,15 @@ },

{
internalType: "uint256[6]",
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "uint256[4]",
name: "reserved",
type: "uint256[6]",
type: "uint256[4]",
},

@@ -1804,3 +2082,3 @@ {

internalType: "bool",
name: "_isPorterAvailable",
name: "_zkPorterIsAvailable",
type: "bool",

@@ -1817,2 +2095,15 @@ },

{
internalType: "uint256",
name: "_newPriorityTxMaxGasLimit",
type: "uint256",
},
],
name: "setPriorityTxMaxGasLimit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",

@@ -1902,2 +2193,70 @@ name: "_validator",

},
{
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",
},
{
internalType: "uint256",
name: "_proposalId",
type: "uint256",
},
{
internalType: "bytes32",
name: "_salt",
type: "bytes32",
},
],
name: "upgradeProposalHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "pure",
type: "function",
},
];

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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