diff --git a/abi/ContractDeployer.json b/abi/ContractDeployer.json index 15dfc3d..6daec33 100644 --- a/abi/ContractDeployer.json +++ b/abi/ContractDeployer.json @@ -208,6 +208,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_keccak256BytecodeHash", + "type": "bytes32" + } + ], + "name": "forceDeployKeccak256", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/abi/CronosTestnet.json b/abi/CronosTestnet.json new file mode 100644 index 0000000..0d04b91 --- /dev/null +++ b/abi/CronosTestnet.json @@ -0,0 +1,355 @@ +{ + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dest", + "type": "address" + }, + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/abi/IAllowList.json b/abi/IAllowList.json index abc5a14..de592da 100644 --- a/abi/IAllowList.json +++ b/abi/IAllowList.json @@ -56,6 +56,31 @@ "name": "UpdateCallPermission", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "depositLimitation", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "depositCap", + "type": "uint256" + } + ], + "name": "UpdateDepositLimit", + "type": "event" + }, { "inputs": [ { diff --git a/abi/IEthToken.json b/abi/IEthToken.json index f9bb264..26c2ed9 100644 --- a/abi/IEthToken.json +++ b/abi/IEthToken.json @@ -69,6 +69,37 @@ "name": "Withdrawal", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_l2Sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_additionalData", + "type": "bytes" + } + ], + "name": "WithdrawalWithMessage", + "type": "event" + }, { "inputs": [ { @@ -193,6 +224,24 @@ "outputs": [], "stateMutability": "payable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1Receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_additionalData", + "type": "bytes" + } + ], + "name": "withdrawWithMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" } ] } diff --git a/abi/IL1Bridge.json b/abi/IL1Bridge.json index f0cb575..802c266 100644 --- a/abi/IL1Bridge.json +++ b/abi/IL1Bridge.json @@ -28,6 +28,12 @@ { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "l2DepositTxHash", + "type": "bytes32" + }, { "indexed": true, "internalType": "address", @@ -41,7 +47,7 @@ "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", "name": "l1Token", "type": "address" @@ -100,7 +106,7 @@ }, { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -110,7 +116,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -150,6 +156,16 @@ "internalType": "uint256", "name": "_l2TxGasPerPubdataByte", "type": "uint256" + }, + { + "internalType": "address", + "name": "_refundRecipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_l1Amount", + "type": "uint256" } ], "name": "deposit", @@ -167,7 +183,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -177,7 +193,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -200,7 +216,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -220,6 +236,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "l2Bridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/abi/IL1Messenger.json b/abi/IL1Messenger.json index b2bbdd5..b53a4d1 100644 --- a/abi/IL1Messenger.json +++ b/abi/IL1Messenger.json @@ -1,5 +1,18 @@ { "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + } + ], + "name": "BytecodeL1PublicationRequested", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -25,6 +38,93 @@ "name": "L1MessageSent", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint8", + "name": "l2ShardId", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isService", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "txNumberInBlock", + "type": "uint16" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct L2ToL1Log", + "name": "_l2log", + "type": "tuple" + } + ], + "name": "L2ToL1LogSent", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_bytecodeHash", + "type": "bytes32" + } + ], + "name": "requestBytecodeL1Publication", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isService", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "sendL2ToL1Log", + "outputs": [ + { + "internalType": "uint256", + "name": "logIdInMerkleTree", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/abi/IL2Bridge.json b/abi/IL2Bridge.json index e62a099..d6ca3ce 100644 --- a/abi/IL2Bridge.json +++ b/abi/IL2Bridge.json @@ -92,7 +92,7 @@ ], "name": "finalizeDeposit", "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { diff --git a/abi/IZkSync.json b/abi/IZkSync.json index 0196291..300ad49 100644 --- a/abi/IZkSync.json +++ b/abi/IZkSync.json @@ -6,13 +6,13 @@ { "indexed": true, "internalType": "uint256", - "name": "blockNumber", + "name": "batchNumber", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -31,13 +31,13 @@ { "indexed": true, "internalType": "uint256", - "name": "blockNumber", + "name": "batchNumber", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -56,19 +56,19 @@ { "indexed": false, "internalType": "uint256", - "name": "totalBlocksCommitted", + "name": "totalBatchesCommitted", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "totalBlocksVerified", + "name": "totalBatchesVerified", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "totalBlocksExecuted", + "name": "totalBatchesExecuted", "type": "uint256" } ], @@ -81,38 +81,19 @@ { "indexed": true, "internalType": "uint256", - "name": "previousLastVerifiedBlock", + "name": "previousLastVerifiedBatch", "type": "uint256" }, { "indexed": true, "internalType": "uint256", - "name": "currentLastVerifiedBlock", + "name": "currentLastVerifiedBatch", "type": "uint256" } ], "name": "BlocksVerification", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - } - ], - "name": "CancelUpgradeProposal", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -136,22 +117,49 @@ "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "proposalHash", - "type": "bytes32" - }, - { + "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": "bytes32", - "name": "proposalSalt", - "type": "bytes32" + "internalType": "struct Diamond.DiamondCutData", + "name": "diamondCut", + "type": "tuple" } ], "name": "ExecuteUpgrade", @@ -182,17 +190,17 @@ { "indexed": true, "internalType": "address", - "name": "oldGovernor", + "name": "oldAdmin", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "newGovernor", + "name": "newAdmin", "type": "address" } ], - "name": "NewGovernor", + "name": "NewAdmin", "type": "event" }, { @@ -200,18 +208,18 @@ "inputs": [ { "indexed": true, - "internalType": "bytes32", - "name": "previousBytecodeHash", - "type": "bytes32" + "internalType": "address", + "name": "oldGovernor", + "type": "address" }, { "indexed": true, - "internalType": "bytes32", - "name": "newBytecodeHash", - "type": "bytes32" + "internalType": "address", + "name": "newGovernor", + "type": "address" } ], - "name": "NewL2BootloaderBytecodeHash", + "name": "NewGovernor", "type": "event" }, { @@ -219,18 +227,18 @@ "inputs": [ { "indexed": true, - "internalType": "bytes32", - "name": "previousBytecodeHash", - "type": "bytes32" + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" }, { "indexed": true, - "internalType": "bytes32", - "name": "newBytecodeHash", - "type": "bytes32" + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" } ], - "name": "NewL2DefaultAccountBytecodeHash", + "name": "NewPendingAdmin", "type": "event" }, { @@ -390,180 +398,6 @@ "name": "NewPriorityTxMaxGasLimit", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldVerifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newVerifier", - "type": "address" - } - ], - "name": "NewVerifier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct VerifierParams", - "name": "oldVerifierParams", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct VerifierParams", - "name": "newVerifierParams", - "type": "tuple" - } - ], - "name": "NewVerifierParams", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "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": "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": [], @@ -589,6 +423,13 @@ "name": "ValidatorStatusUpdate", "type": "event" }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "acceptGovernor", @@ -597,16 +438,16 @@ "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "baseTokenAddress", + "outputs": [ { - "internalType": "bytes32", - "name": "_proposedUpgradeHash", - "type": "bytes32" + "internalType": "address", + "name": "", + "type": "address" } ], - "name": "cancelUpgradeProposal", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -615,12 +456,12 @@ "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -654,15 +495,15 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo", - "name": "_lastCommittedBlockData", + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_lastCommittedBatchData", "type": "tuple" }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { @@ -687,46 +528,36 @@ }, { "internalType": "bytes32", - "name": "l2LogsTreeRoot", + "name": "priorityOperationsHash", "type": "bytes32" }, { "internalType": "bytes32", - "name": "priorityOperationsHash", + "name": "bootloaderHeapInitialContentsHash", "type": "bytes32" }, { - "internalType": "bytes", - "name": "initialStorageChanges", - "type": "bytes" + "internalType": "bytes32", + "name": "eventsQueueStateHash", + "type": "bytes32" }, { "internalType": "bytes", - "name": "repeatedStorageChanges", + "name": "systemLogs", "type": "bytes" }, { "internalType": "bytes", - "name": "l2Logs", + "name": "totalL2ToL1Pubdata", "type": "bytes" - }, - { - "internalType": "bytes[]", - "name": "l2ArbitraryLengthMessages", - "type": "bytes[]" - }, - { - "internalType": "bytes[]", - "name": "factoryDeps", - "type": "bytes[]" } ], - "internalType": "struct IExecutor.CommitBlockInfo[]", - "name": "_newBlocksData", + "internalType": "struct IExecutor.CommitBatchInfo[]", + "name": "_newBatchesData", "type": "tuple[]" } ], - "name": "commitBlocks", + "name": "commitBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -737,12 +568,12 @@ "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -776,12 +607,12 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo[]", - "name": "_blocksData", + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_batchesData", "type": "tuple[]" } ], - "name": "executeBlocks", + "name": "executeBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -831,11 +662,6 @@ "internalType": "struct Diamond.DiamondCutData", "name": "_diamondCut", "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "_proposalSalt", - "type": "bytes32" } ], "name": "executeUpgrade", @@ -923,7 +749,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -933,7 +759,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -961,12 +787,12 @@ }, { "inputs": [], - "name": "getCurrentProposalId", + "name": "getAllowList", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -1026,20 +852,7 @@ }, { "inputs": [], - "name": "getPendingGovernor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPriorityQueueSize", + "name": "getL2SystemContractsUpgradeBatchNumber", "outputs": [ { "internalType": "uint256", @@ -1052,7 +865,7 @@ }, { "inputs": [], - "name": "getProposedUpgradeHash", + "name": "getL2SystemContractsUpgradeTxHash", "outputs": [ { "internalType": "bytes32", @@ -1065,12 +878,12 @@ }, { "inputs": [], - "name": "getProposedUpgradeTimestamp", + "name": "getName", "outputs": [ { - "internalType": "uint256", + "internalType": "string", "name": "", - "type": "uint256" + "type": "string" } ], "stateMutability": "view", @@ -1078,7 +891,7 @@ }, { "inputs": [], - "name": "getSecurityCouncil", + "name": "getPendingGovernor", "outputs": [ { "internalType": "address", @@ -1091,7 +904,7 @@ }, { "inputs": [], - "name": "getTotalBlocksCommitted", + "name": "getPriorityQueueSize", "outputs": [ { "internalType": "uint256", @@ -1104,7 +917,7 @@ }, { "inputs": [], - "name": "getTotalBlocksExecuted", + "name": "getPriorityTxMaxGasLimit", "outputs": [ { "internalType": "uint256", @@ -1117,7 +930,7 @@ }, { "inputs": [], - "name": "getTotalBlocksVerified", + "name": "getProtocolVersion", "outputs": [ { "internalType": "uint256", @@ -1130,7 +943,7 @@ }, { "inputs": [], - "name": "getTotalPriorityTxs", + "name": "getTotalBatchesCommitted", "outputs": [ { "internalType": "uint256", @@ -1143,12 +956,12 @@ }, { "inputs": [], - "name": "getUpgradeProposalState", + "name": "getTotalBatchesExecuted", "outputs": [ { - "internalType": "enum UpgradeState", + "internalType": "uint256", "name": "", - "type": "uint8" + "type": "uint256" } ], "stateMutability": "view", @@ -1156,12 +969,12 @@ }, { "inputs": [], - "name": "getVerifier", + "name": "getTotalBatchesVerified", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "stateMutability": "view", @@ -1169,29 +982,12 @@ }, { "inputs": [], - "name": "getVerifierParams", + "name": "getTotalPriorityTxs", "outputs": [ { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "internalType": "struct VerifierParams", + "internalType": "uint256", "name": "", - "type": "tuple" + "type": "uint256" } ], "stateMutability": "view", @@ -1199,12 +995,12 @@ }, { "inputs": [], - "name": "getpriorityTxMaxGasLimit", + "name": "getVerifier", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -1212,12 +1008,29 @@ }, { "inputs": [], - "name": "isApprovedBySecurityCouncil", + "name": "getVerifierParams", "outputs": [ { - "internalType": "bool", + "components": [ + { + "internalType": "bytes32", + "name": "recursionNodeLevelVkHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "recursionLeafLevelVkHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "recursionCircuitsSetVksHash", + "type": "bytes32" + } + ], + "internalType": "struct VerifierParams", "name": "", - "type": "bool" + "type": "tuple" } ], "stateMutability": "view", @@ -1240,7 +1053,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1321,7 +1134,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" } ], @@ -1395,93 +1208,18 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "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": "initAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "initCalldata", - "type": "bytes" - } - ], - "internalType": "struct Diamond.DiamondCutData", - "name": "_diamondCut", - "type": "tuple" - }, - { - "internalType": "uint40", - "name": "_proposalId", - "type": "uint40" - } - ], - "name": "proposeTransparentUpgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -1515,20 +1253,20 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo", - "name": "_prevBlock", + "internalType": "struct IExecutor.StoredBatchInfo", + "name": "_prevBatch", "type": "tuple" }, { "components": [ { "internalType": "uint64", - "name": "blockNumber", + "name": "batchNumber", "type": "uint64" }, { "internalType": "bytes32", - "name": "blockHash", + "name": "batchHash", "type": "bytes32" }, { @@ -1562,8 +1300,8 @@ "type": "bytes32" } ], - "internalType": "struct IExecutor.StoredBlockInfo[]", - "name": "_committedBlocks", + "internalType": "struct IExecutor.StoredBatchInfo[]", + "name": "_committedBatches", "type": "tuple[]" }, { @@ -1584,7 +1322,7 @@ "type": "tuple" } ], - "name": "proveBlocks", + "name": "proveBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1598,7 +1336,7 @@ }, { "internalType": "uint256", - "name": "_l2BlockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1608,7 +1346,7 @@ }, { "internalType": "uint16", - "name": "_l2TxNumberInBlock", + "name": "_l2TxNumberInBatch", "type": "uint16" }, { @@ -1637,7 +1375,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1659,7 +1397,7 @@ }, { "internalType": "uint16", - "name": "txNumberInBlock", + "name": "txNumberInBatch", "type": "uint16" }, { @@ -1703,7 +1441,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_l2BatchNumber", "type": "uint256" }, { @@ -1715,7 +1453,7 @@ "components": [ { "internalType": "uint16", - "name": "txNumberInBlock", + "name": "txNumberInBatch", "type": "uint16" }, { @@ -1753,30 +1491,37 @@ { "inputs": [ { - "internalType": "address", - "name": "_contractL2", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_l2Value", - "type": "uint256" + "components": [ + { + "internalType": "address", + "name": "l2Contract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "l2Value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2GasPerPubdataByteLimit", + "type": "uint256" + } + ], + "internalType": "struct L2Transaction", + "name": "_l2tx", + "type": "tuple" }, { "internalType": "bytes", "name": "_calldata", "type": "bytes" }, - { - "internalType": "uint256", - "name": "_l2GasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_l2GasPerPubdataByteLimit", - "type": "uint256" - }, { "internalType": "bytes[]", "name": "_factoryDeps", @@ -1786,6 +1531,11 @@ "internalType": "address", "name": "_refundRecipient", "type": "address" + }, + { + "internalType": "uint256", + "name": "_baseAmount", + "type": "uint256" } ], "name": "requestL2Transaction", @@ -1803,11 +1553,11 @@ "inputs": [ { "internalType": "uint256", - "name": "_newLastBlock", + "name": "_newLastBatch", "type": "uint256" } ], - "name": "revertBlocks", + "name": "revertBatches", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1815,38 +1565,12 @@ { "inputs": [ { - "internalType": "bytes32", - "name": "_upgradeProposalHash", - "type": "bytes32" - } - ], - "name": "securityCouncilUpgradeApprove", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_l2BootloaderBytecodeHash", - "type": "bytes32" - } - ], - "name": "setL2BootloaderBytecodeHash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_l2DefaultAccountBytecodeHash", - "type": "bytes32" + "internalType": "address", + "name": "_newPendingAdmin", + "type": "address" } ], - "name": "setL2DefaultAccountBytecodeHash", + "name": "setPendingAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1908,58 +1632,15 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "contract Verifier", - "name": "_newVerifier", - "type": "address" - } - ], - "name": "setVerifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "recursionNodeLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionLeafLevelVkHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "recursionCircuitsSetVksHash", - "type": "bytes32" - } - ], - "internalType": "struct VerifierParams", - "name": "_newVerifierParams", - "type": "tuple" - } - ], - "name": "setVerifierParams", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "uint256", - "name": "_blockNumber", + "name": "_batchNumber", "type": "uint256" } ], - "name": "storedBlockHash", + "name": "storedBatchHash", "outputs": [ { "internalType": "bytes32", @@ -1976,74 +1657,6 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "facet", - "type": "address" - }, - { - "internalType": "enum Diamond.Action", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "isFreezable", - "type": "bool" - }, - { - "internalType": "bytes4[]", - "name": "selectors", - "type": "bytes4[]" - } - ], - "internalType": "struct Diamond.FacetCut[]", - "name": "facetCuts", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "initAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "initCalldata", - "type": "bytes" - } - ], - "internalType": "struct Diamond.DiamondCutData", - "name": "_diamondCut", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "_proposalId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_salt", - "type": "bytes32" - } - ], - "name": "upgradeProposalHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" } ] } diff --git a/abi/update-abi.sh b/abi/update-abi.sh index 5961ae3..c8c64ec 100755 --- a/abi/update-abi.sh +++ b/abi/update-abi.sh @@ -19,3 +19,5 @@ cat $ZKSYNC_CONTRACTS/interfaces/IPaymasterFlow.sol/IPaymasterFlow.json | jq '{ cat $SYSTEM_CONTRACTS/interfaces/IL1Messenger.sol/IL1Messenger.json | jq '{ abi: .abi}' > IL1Messenger.json cat $SYSTEM_CONTRACTS/interfaces/IEthToken.sol/IEthToken.json | jq '{ abi: .abi}' > IEthToken.json cat $SYSTEM_CONTRACTS/ContractDeployer.sol/ContractDeployer.json | jq '{ abi: .abi}' > ContractDeployer.json + +cat $ETHEREUM_CONTRACTS/dev-contracts/CronosTestnet.sol/CronosTestnet.json | jq '{ abi: .abi}' > CronosTestnet.json diff --git a/package.json b/package.json index a8d05c9..754bbdb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "ethers": "~5.7.0", "mocha": "^9.0.2", "ts-node": "^10.0.0", - "typescript": "^4.3.5" + "typescript": "^4.3.5", + "prettier": "3.0.3" }, "peerDependencies": { "ethers": "^5.7.0" @@ -26,6 +27,8 @@ "scripts": { "tests": "mocha -r ts-node/register tests/**/*.test.ts", "build": "tsc && cp -f typechain/*.d.ts build/typechain", - "watch": "tsc --watch" + "lint": "prettier . --write", + "watch": "tsc --watch", + "cro-test": "mocha -r ts-node/register --bail tests/baseToken.test.ts" } } diff --git a/src/adapters.ts b/src/adapters.ts index 5abc649..e182ce7 100644 --- a/src/adapters.ts +++ b/src/adapters.ts @@ -1,10 +1,9 @@ import { BigNumber, BigNumberish, BytesLike, ethers } from 'ethers'; -import { IERC20MetadataFactory, IL1BridgeFactory, IL2BridgeFactory, IZkSyncFactory } from '../typechain'; +import { IERC20MetadataFactory, IL1BridgeFactory, IL2BridgeFactory, IZkSyncFactory, CronosTestnetFactory} from '../typechain'; import { Provider } from './provider'; import { Address, BalancesMap, BlockTag, Eip712Meta, PriorityOpResponse, TransactionResponse } from './types'; import { BOOTLOADER_FORMAL_ADDRESS, - checkBaseCost, DEFAULT_GAS_PER_PUBDATA_LIMIT, REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, ETH_ADDRESS, @@ -12,9 +11,12 @@ import { L1_MESSENGER_ADDRESS, layer1TxDefaults, undoL1ToL2Alias, - estimateDefaultBridgeDepositL2Gas + estimateDefaultBridgeDepositL2Gas, + L2_ETH_TOKEN_ADDRESS } from './utils'; +import { CronosTestnet } from "../typechain/CronosTestnet"; + type Constructor = new (...args: any[]) => T; interface TxSender { @@ -34,11 +36,26 @@ export function AdapterL1>(Base: TBase) { throw new Error('Must be implemented by the derived class!'); } + _baseTokenAddress?: string; + async getMainContract() { const address = await this._providerL2().getMainContractAddress(); return IZkSyncFactory.connect(address, this._signerL1()); } + async getBaseTokenContract(): Promise { + return CronosTestnetFactory.connect(await this.baseTokenAddress(), this._signerL1()); + } + + async baseTokenAddress(): Promise { + if (this._baseTokenAddress == undefined) { + const zkSyncContract = await this.getMainContract(); + this._baseTokenAddress = (await zkSyncContract.baseTokenAddress()).toLowerCase(); + } + + return this._baseTokenAddress; + } + async getL1BridgeContracts() { const addresses = await this._providerL2().getDefaultBridgeAddresses(); return { @@ -59,6 +76,8 @@ export function AdapterL1>(Base: TBase) { async l2TokenAddress(token: Address) { if (token == ETH_ADDRESS) { return ETH_ADDRESS; + } else if (token.toLowerCase() == (await this.baseTokenAddress())) { + return ETH_ADDRESS; } else { const erc20Bridge = (await this.getL1BridgeContracts()).erc20; return await erc20Bridge.l2TokenAddress(token); @@ -86,6 +105,16 @@ export function AdapterL1>(Base: TBase) { return await erc20contract.approve(bridgeAddress, amount, overrides); } + async approveBaseToken(amount: BigNumberish): Promise { + const CRO = CronosTestnetFactory.connect(await this.baseTokenAddress(), this._signerL1()); + const contractAddress = await this._providerL2().getMainContractAddress(); + + console.info("Sending CRO approve tx"); + const approveTx = await CRO.approve(contractAddress, amount); + const receipt = await approveTx.wait(); + return receipt; + } + async getBaseCost(params: { gasLimit: BigNumberish; gasPerPubdataByte?: BigNumberish; @@ -114,12 +143,35 @@ export function AdapterL1>(Base: TBase) { approveERC20?: boolean; l2GasLimit?: BigNumberish; gasPerPubdataByte?: BigNumberish; + refundRecipient?: Address; overrides?: ethers.PayableOverrides; approveOverrides?: ethers.Overrides; }): Promise { const depositTx = await this.getDepositTx(transaction); if (transaction.token == ETH_ADDRESS) { return this.requestExecute(depositTx); + } else if (transaction.token == (await this.baseTokenAddress())) { + const CRO = CronosTestnetFactory.connect(transaction.token, this._signerL1()); + const contractAddress = await this._providerL2().getMainContractAddress(); + + let allowance = await CRO.allowance(await this.getAddress(), contractAddress); + + if (allowance < BigNumber.from(depositTx.amount)) { + console.info( + "CRO allowance amount is low:", + "allowance:", + ethers.utils.formatEther(allowance), + "tx-amount:", + ethers.utils.formatEther(transaction.amount), + "total cost:", + ethers.utils.formatEther(depositTx.overrides.value), + ); + console.info("Sending CRO approve tx"); + const approveTx = await CRO.approve(contractAddress, transaction.amount); + await approveTx.wait(); + } + + return await this.requestExecute(depositTx); } else { const bridgeContracts = await this.getL1BridgeContracts(); if (transaction.approveERC20) { @@ -129,6 +181,19 @@ export function AdapterL1>(Base: TBase) { }); await approveTx.wait(); } + + // the sender requires to approve base token to be able to proceed estimateGas + const CRO = CronosTestnetFactory.connect( + await this.baseTokenAddress(), + this._signerL1(), + ); + const contractAddress = await this._providerL2().getMainContractAddress(); + let allowance_CRO = await CRO.allowance(await this.getAddress(), contractAddress); + if (allowance_CRO < BigNumber.from(depositTx.value)) { + const approveTx = await CRO.approve(contractAddress, depositTx.value); + await approveTx.wait(); + } + return await this._providerL2().getPriorityOpResponse( await this._signerL1().sendTransaction(depositTx) ); @@ -161,6 +226,7 @@ export function AdapterL1>(Base: TBase) { bridgeAddress?: Address; l2GasLimit?: BigNumberish; gasPerPubdataByte?: BigNumberish; + refundRecipient?: Address; overrides?: ethers.PayableOverrides; }): Promise { const bridgeContracts = await this.getL1BridgeContracts(); @@ -183,7 +249,7 @@ export function AdapterL1>(Base: TBase) { tx.gasPerPubdataByte ); - const { to, token, amount, operatorTip, overrides } = tx; + const { to, token, amount, operatorTip, refundRecipient, overrides } = tx; await insertGasPrice(this._providerL1(), overrides); const gasPriceForEstimation = overrides.maxFeePerGas || overrides.gasPrice; @@ -208,17 +274,27 @@ export function AdapterL1>(Base: TBase) { l2GasLimit: tx.l2GasLimit!, ...tx }; + } else if (token.toLowerCase() == (await this.baseTokenAddress())) { + overrides.value ??= baseCost.add(BigNumber.from(operatorTip)); + return { + contractAddress: to, + calldata: "0x", + l2Value: 0, + ...tx, + }; } else { - const args: [Address, Address, BigNumberish, BigNumberish, BigNumberish] = [ + const l1Amount = baseCost.add(BigNumber.from(operatorTip)); + const args: [Address, Address, BigNumberish, BigNumberish, BigNumberish, Address, + BigNumberish] = [ to, token, amount, tx.l2GasLimit, - tx.gasPerPubdataByte + tx.gasPerPubdataByte, + refundRecipient, l1Amount, ]; - overrides.value ??= baseCost.add(operatorTip); - await checkBaseCost(baseCost, overrides.value); + overrides.value ??= l1Amount; // TODO: compatibility layer: using the old API which uses msg.sender as the // refund recipient, to make the SDK compatible with the old contracts. @@ -288,6 +364,17 @@ export function AdapterL1>(Base: TBase) { proof, overrides ?? {} ); + } else if (L2_ETH_TOKEN_ADDRESS == sender.toLowerCase()) { + const contractAddress = await this._providerL2().getMainContractAddress(); + const zksync = IZkSyncFactory.connect(contractAddress, this._signerL1()); + return await zksync.finalizeEthWithdrawal( + l1BatchNumber as BigNumberish, + l2MessageIndex as BigNumberish, + l2TxNumberInBlock as BigNumberish, + message, + proof, + overrides ?? {}, + ); } const l2Bridge = IL2BridgeFactory.connect(sender, this._providerL2()); @@ -361,6 +448,7 @@ export function AdapterL1>(Base: TBase) { async requestExecute(transaction: { contractAddress: Address; calldata: BytesLike; + amount: BigNumberish; l2GasLimit?: BigNumberish; l2Value?: BigNumberish; factoryDeps?: ethers.BytesLike[]; @@ -376,6 +464,7 @@ export function AdapterL1>(Base: TBase) { async estimateGasRequestExecute(transaction: { contractAddress: Address; calldata: BytesLike; + amount: BigNumberish; l2GasLimit?: BigNumberish; l2Value?: BigNumberish; factoryDeps?: ethers.BytesLike[]; @@ -391,6 +480,7 @@ export function AdapterL1>(Base: TBase) { async getRequestExecuteTx(transaction: { contractAddress: Address; calldata: BytesLike; + amount: BigNumberish; l2GasLimit?: BigNumberish; l2Value?: BigNumberish; factoryDeps?: ethers.BytesLike[]; @@ -419,7 +509,8 @@ export function AdapterL1>(Base: TBase) { operatorTip, overrides, gasPerPubdataByte, - refundRecipient + refundRecipient, + amount } = tx; await insertGasPrice(this._providerL1(), overrides); @@ -431,18 +522,23 @@ export function AdapterL1>(Base: TBase) { gasLimit: l2GasLimit }); - overrides.value ??= baseCost.add(operatorTip).add(l2Value); + // fee on L2 is subsctracted from the amount + // overrides.value ??= baseCost + BigInt(operatorTip) + BigInt(l2Value); + // await checkBaseCost(baseCost, overrides.value); - await checkBaseCost(baseCost, overrides.value); + let l2tx = { + l2Contract: contractAddress, + l2Value: l2Value, + l2GasLimit: l2GasLimit, + l2GasPerPubdataByteLimit: REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT + }; return await zksyncContract.populateTransaction.requestL2Transaction( - contractAddress, - l2Value, - calldata, - l2GasLimit, - REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT, + l2tx, + calldata, factoryDeps, refundRecipient, + amount, overrides ); } diff --git a/src/paymaster-utils.ts b/src/paymaster-utils.ts index d95f124..2df8403 100644 --- a/src/paymaster-utils.ts +++ b/src/paymaster-utils.ts @@ -2,7 +2,7 @@ import { BytesLike, ethers } from 'ethers'; import { Address, ApprovalBasedPaymasterInput, GeneralPaymasterInput, PaymasterInput, PaymasterParams } from './types'; -export const IPaymasterFlow = new ethers.utils.Interface(require('../../abi/IPaymasterFlow.json').abi); +export const IPaymasterFlow = new ethers.utils.Interface(require('../abi/IPaymasterFlow.json').abi); export function getApprovalBasedPaymasterInput(paymasterInput: ApprovalBasedPaymasterInput): BytesLike { return IPaymasterFlow.encodeFunctionData('approvalBased', [ diff --git a/src/provider.ts b/src/provider.ts index 47c5fa8..6b51dfc 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -44,6 +44,7 @@ export class Provider extends ethers.providers.JsonRpcProvider { mainContract?: Address; erc20BridgeL1?: Address; erc20BridgeL2?: Address; + baseToken?: Address; }; override async getTransactionReceipt(transactionHash: string | Promise): Promise { @@ -161,7 +162,10 @@ export class Provider extends ethers.providers.JsonRpcProvider { if (tokenAddress == null || isETH(tokenAddress)) { // requesting ETH balance return await super.getBalance(address, tag); - } else { + } else if (await this.isBaseTokenAddress(tokenAddress)) { + // requesting base token balance + return await super.getBalance(address, blockTag); + } else { try { let token = IERC20MetadataFactory.connect(tokenAddress, this); return await token.balanceOf(address, { blockTag: tag }); @@ -174,6 +178,8 @@ export class Provider extends ethers.providers.JsonRpcProvider { async l2TokenAddress(token: Address) { if (token == ETH_ADDRESS) { return ETH_ADDRESS; + } else if (await this.isBaseTokenAddress(token)) { + return ETH_ADDRESS; } else { const erc20BridgeAddress = (await this.getDefaultBridgeAddresses()).erc20L2; const erc20Bridge = IL2BridgeFactory.connect(erc20BridgeAddress, this); @@ -184,6 +190,15 @@ export class Provider extends ethers.providers.JsonRpcProvider { async l1TokenAddress(token: Address) { if (token == ETH_ADDRESS) { return ETH_ADDRESS; + } else if (token == this.contractAddresses.baseToken) { + // check if base token is ETH_ADDRESS or not, if it's not then return base token address, otherwise return ETH_ADDRESS + if ( + !this.contractAddresses.baseToken || + ETH_ADDRESS == this.contractAddresses.baseToken + ) { + return ETH_ADDRESS; + } + return token; } else { const erc20BridgeAddress = (await this.getDefaultBridgeAddresses()).erc20L2; const erc20Bridge = IL2BridgeFactory.connect(erc20BridgeAddress, this); @@ -330,10 +345,12 @@ export class Provider extends ethers.providers.JsonRpcProvider { let addresses = await this.send('zks_getBridgeContracts', []); this.contractAddresses.erc20BridgeL1 = addresses.l1Erc20DefaultBridge; this.contractAddresses.erc20BridgeL2 = addresses.l2Erc20DefaultBridge; + this.contractAddresses.baseToken = String(addresses.baseTokenAddr).toLowerCase(); } return { erc20L1: this.contractAddresses.erc20BridgeL1, - erc20L2: this.contractAddresses.erc20BridgeL2 + erc20L2: this.contractAddresses.erc20BridgeL2, + baseToken: String(this.contractAddresses.baseToken).toLowerCase() }; } @@ -409,6 +426,17 @@ export class Provider extends ethers.providers.JsonRpcProvider { const ethL2Token = IEthTokenFactory.connect(L2_ETH_TOKEN_ADDRESS, this); return ethL2Token.populateTransaction.withdraw(tx.to, tx.overrides); + } else if (await this.isBaseTokenAddress(tx.token)) { + if (!tx.overrides.value) { + tx.overrides.value = tx.amount; + } + const passedValue = BigNumber.from(tx.overrides.value); + if (passedValue != BigNumber.from(tx.amount)) { + 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 as Address, tx.overrides); } if (tx.bridgeAddress == null) { @@ -449,6 +477,12 @@ export class Provider extends ethers.providers.JsonRpcProvider { to: tx.to, value: tx.amount }; + } else if (await this.isBaseTokenAddress(tx.token)) { + return { + ...(await ethers.utils.resolveProperties(tx.overrides)), + to: tx.to, + value: tx.amount, + }; } else { const token = IERC20MetadataFactory.connect(tx.token, this); return await token.populateTransaction.transfer(tx.to, tx.amount, tx.overrides); @@ -629,6 +663,21 @@ export class Provider extends ethers.providers.JsonRpcProvider { return fee; } + + async getBaseTokenAddress(): Promise { + if (!this.contractAddresses.baseToken) { + await this.getDefaultBridgeAddresses(); + } + let baseToken = this.contractAddresses.baseToken; + if (baseToken == undefined) { + baseToken = "0x" + } + return baseToken; + } + + async isBaseTokenAddress(token: Address): Promise { + return token.toLowerCase() == (await this.getBaseTokenAddress()); + } } export class Web3Provider extends Provider { diff --git a/src/utils.ts b/src/utils.ts index 599aece..8aebc12 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -520,6 +520,14 @@ export async function estimateDefaultBridgeDepositL2Gas( calldata: '0x', l2Value: amount }); + } else if (await providerL2.isBaseTokenAddress(token)) { + return await providerL2.estimateL1ToL2Execute({ + contractAddress: to, + gasPerPubdataByte: gasPerPubdataByte, + caller: from, + calldata: "0x", + l2Value: 0, + }); } else { const l1ERC20BridgeAddresses = (await providerL2.getDefaultBridgeAddresses()).erc20L1; const erc20BridgeAddress = (await providerL2.getDefaultBridgeAddresses()).erc20L2; diff --git a/tests/basetoken.test.ts b/tests/basetoken.test.ts new file mode 100644 index 0000000..75bf4ee --- /dev/null +++ b/tests/basetoken.test.ts @@ -0,0 +1,267 @@ +import { expect } from "chai"; +import { Provider, Wallet } from "../src"; +import { BigNumber, ethers } from "ethers"; +import { Address } from "../src/types"; + +const mnemonic = "stuff slice staff easily soup parent arm payment cotton trade scatter struggle"; +const mnemonic2 = "test test test test test test test test test test test junk"; +const testTimeout = 30_000; +const provider = Provider.getDefaultProvider() as Provider; +const ethProvider = ethers.getDefaultProvider("http://127.0.0.1:8545"); + +describe("BaseToken", () => { + let mnemonicWallet = ethers.Wallet.fromMnemonic(mnemonic); + let mnemonicWallet2 = ethers.Wallet.fromMnemonic(mnemonic2); + + const wallet = new Wallet(mnemonicWallet.privateKey, provider, ethProvider); + const wallet2 = new Wallet(mnemonicWallet2.privateKey, provider, ethProvider); + let BASE_TOKEN_ADDR: Address; + + before("setup", async function () { + BASE_TOKEN_ADDR = await wallet.baseTokenAddress(); + }); + + //unsuuported test in SDK v0.14.4 + // describe("#depositFee()", async () => { + // it("should estimates the base token deposit fee", async () => { + // const deposit_amount = ethers.utils.parseEther("1"); + // const tx = { + // token: BASE_TOKEN_ADDR, + // amount: deposit_amount, + // }; + + // const depositTx = await wallet.getDepositTx(tx); + // const fee = await wallet.getFullRequiredDepositFee(depositTx); + // expect(fee).not.to.be.null; + // }).timeout(testTimeout); + // }); + + describe("#deposit()", async () => { + it("should deposit L1 balance to L2", async () => { + console.log("wallet address", await wallet.getAddress()); + const l1_balance = await wallet.getBalanceL1(BASE_TOKEN_ADDR); + console.log("w1_l1_balance: ", ethers.utils.formatEther(l1_balance)); + console.log("w1_l2_balance: ", ethers.utils.formatEther(await wallet.getBalance(BASE_TOKEN_ADDR))); + console.log("w1_l1_ETH_balance: ", ethers.utils.formatEther(await wallet.getBalanceL1())); + const deposit_amount = ethers.utils.parseEther("1.0"); + const deposit = await wallet.deposit({ + token: BASE_TOKEN_ADDR, + amount: deposit_amount, + }); + expect(deposit).not.to.be.null; + + const receipt = await deposit.waitFinalize(); + expect(receipt).not.to.be.null; + + const l1_balance_new = await wallet.getBalanceL1(BASE_TOKEN_ADDR); + console.log("w1_l1_balance after deposit: ", ethers.utils.formatEther(l1_balance_new)); + console.log( + "w1_l1_ETH_balance after deposit: ", + ethers.utils.formatEther(await wallet.getBalanceL1()), + ); + expect(l1_balance.sub(l1_balance_new).toBigInt()).to.be.equal(deposit_amount.toBigInt()); + console.log( + "w1_l2_balance after deposit: ", + ethers.utils.formatEther(await wallet.getBalance(BASE_TOKEN_ADDR)), + ); + }).timeout(testTimeout); + }); + + describe("#transfer()", () => { + it("should transfer L2 balance", async () => { + console.log("w1_l2_balance: ", ethers.utils.formatEther(await wallet.getBalance(BASE_TOKEN_ADDR))); + + const l2_balance = await wallet2.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_balance: ", ethers.utils.formatEther(l2_balance)); + + const transfer_amount = ethers.utils.parseEther("0.1"); + const transfer = await wallet.transfer({ + to: await wallet2.getAddress(), + token: BASE_TOKEN_ADDR, + amount: transfer_amount, + }); + expect(transfer).not.to.be.null; + + await transfer.waitFinalize(); + + console.log( + "w1_l2_balance after transfer: ", + ethers.utils.formatEther(await wallet.getBalance(BASE_TOKEN_ADDR)), + ); + + const l2_balance_new = await wallet2.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_balance after transfer: ", ethers.utils.formatEther(l2_balance_new)); + expect(l2_balance_new.sub(l2_balance).toBigInt()).to.be.equal(transfer_amount.toBigInt()); + }).timeout(testTimeout); + }); + + describe("#withdraw()", () => { + it("should withdraw L2 balance to L1", async () => { + const l1_balance = await wallet.getBalanceL1(BASE_TOKEN_ADDR); + console.log("w2_l1_balance: ", ethers.utils.formatEther(l1_balance)); + + const l2_balance = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_balance: ", ethers.utils.formatEther(l2_balance)); + + const withdraw_amount = ethers.utils.parseEther("0.1"); + expect(l2_balance > withdraw_amount).to.be.true; + const withdrawTx = await wallet.withdraw({ + token: BASE_TOKEN_ADDR, + amount: withdraw_amount, + }); + expect(withdrawTx).not.to.be.null; + + await withdrawTx.waitFinalize(); + const finalizeWithdrawTx = await wallet.finalizeWithdrawal(withdrawTx.hash); + const result = await finalizeWithdrawTx.wait(); + expect(result).not.to.be.null; + + const l1_balance_new = await wallet.getBalanceL1(BASE_TOKEN_ADDR); + console.log("w2_l1_balance after withdraw: ", ethers.utils.formatEther(l1_balance_new)); + + const l2_balance_new = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_balance after withdraw: ", ethers.utils.formatEther(l2_balance_new)); + + expect(l1_balance_new.sub(l1_balance).toBigInt()).to.be.equal(withdraw_amount.toBigInt()); + }).timeout(testTimeout); + }); +}); + + describe("ERC20", () => { + // make sure set the DAI ADDRESS correctly, the address be defined in the deployed test token list + const DAI_ADDRESS = "0x08A83d7767BAA61243bc5dAB4C6F6ab9e147e640"; + + let mnemonicWallet = ethers.Wallet.fromMnemonic(mnemonic); + let mnemonicWallet2 = ethers.Wallet.fromMnemonic(mnemonic2); + + const wallet = new Wallet(mnemonicWallet.privateKey, provider, ethProvider); + const wallet2 = new Wallet(mnemonicWallet2.privateKey, provider, ethProvider); + let BASE_TOKEN_ADDR: Address; + let L2_ERC20_ADDR: Address; + + before("setup", async function () { + BASE_TOKEN_ADDR = await wallet.baseTokenAddress(); + L2_ERC20_ADDR = await provider.l2TokenAddress(DAI_ADDRESS); + }); + + describe("#deposit()", async () => { + it("deposit DAI token on L2", async () => { + const l1_DAI_balance = await wallet.getBalanceL1(DAI_ADDRESS); + console.log("w1_l1_DAI_balance: ", ethers.utils.formatEther(l1_DAI_balance)); + const l2_DAI_balance = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance: ", ethers.utils.formatEther(l2_DAI_balance)); + + const deposit_amount = ethers.utils.parseEther("2"); + + const priorityOpResponse = await wallet.deposit({ + token: DAI_ADDRESS, + to: await wallet.getAddress(), + amount: deposit_amount, + approveERC20: true, + refundRecipient: await wallet.getAddress(), + }); + const receipt = await priorityOpResponse.waitFinalize(); + expect(receipt).not.to.be.null; + + const l1_DAI_balance_new = await wallet.getBalanceL1(DAI_ADDRESS); + console.log("w1_l1_DAI_balance after deposit: ", ethers.utils.formatEther(l1_DAI_balance_new)); + const l2_DAI_balance_new = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance after deposit: ", ethers.utils.formatEther(l2_DAI_balance_new)); + + expect(l1_DAI_balance.sub(l1_DAI_balance_new).toBigInt()).to.be.equal(deposit_amount.toBigInt()); + expect(l2_DAI_balance_new.sub(l2_DAI_balance).toBigInt()).to.be.equal(deposit_amount.toBigInt()); + }).timeout(testTimeout * 2); + }); + + describe("#transfer()", async () => { + it("should transfer L2 ERC20 balance", async () => { + const w1_l2_DAI_balance = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance: ", ethers.utils.formatEther(w1_l2_DAI_balance)); + const w2_l2_DAI_balance = await wallet2.getBalance(L2_ERC20_ADDR); + console.log("w2_l2_DAI_balance: ", ethers.utils.formatEther(w2_l2_DAI_balance)); + const w1_l2_base_token_balance = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_BASE_TOKEN_balance: ", ethers.utils.formatEther(w1_l2_base_token_balance)); + + const transfer_amount = ethers.utils.parseEther("1"); + + const transfer = await wallet.transfer({ + token: L2_ERC20_ADDR, + to: await wallet2.getAddress(), + amount: transfer_amount, + }); + expect(transfer).not.to.be.null; + + await transfer.waitFinalize(); + + const w1_l2_DAI_balance_new = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance after deposit: ", ethers.utils.formatEther(w1_l2_DAI_balance_new)); + const w2_l2_DAI_balance_new = await wallet2.getBalance(L2_ERC20_ADDR); + console.log("w2_l2_DAI_balance after deposit:", ethers.utils.formatEther(w2_l2_DAI_balance_new)); + const w1_l2_base_token_balance_new = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log( + "w2_l2_BASE_TOKEN_balance: after deposit", + ethers.utils.formatEther(w1_l2_base_token_balance_new), + ); + + expect(w1_l2_DAI_balance.sub(w1_l2_DAI_balance_new).toBigInt()).to.be.equal(transfer_amount.toBigInt()); + expect(w2_l2_DAI_balance_new.sub(w2_l2_DAI_balance).toBigInt()).to.be.equal(transfer_amount.toBigInt()); + expect(w1_l2_base_token_balance.sub(w1_l2_base_token_balance_new.toBigInt()).toBigInt() > BigNumber.from(0).toBigInt()).to.be.true; + }).timeout(testTimeout); + }); + + describe("#withdraw()", async () => { + it("should withdraw L2 ERC20 balance", async () => { + const w1_l2_DAI_balance = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance: ", ethers.utils.formatEther(w1_l2_DAI_balance)); + const w1_l1_DAI_balance = await wallet.getBalanceL1(DAI_ADDRESS); + console.log("w1_l1_DAI_balance: ", ethers.utils.formatEther(w1_l1_DAI_balance)); + const w1_l2_base_token_balance = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log("w2_l2_BASE_TOKEN_balance: ", ethers.utils.formatEther(w1_l2_base_token_balance)); + + const withdraw_amount = ethers.utils.parseEther("0.5"); + expect(w1_l2_DAI_balance.toBigInt() > withdraw_amount.toBigInt()).to.be.true; + + const withdrawTx = await wallet.withdraw({ + token: L2_ERC20_ADDR, + amount: withdraw_amount, + }); + expect(withdrawTx).not.to.be.null; + + await withdrawTx.waitFinalize(); + const finalizeWithdrawTx = await wallet.finalizeWithdrawal(withdrawTx.hash); + const result = await finalizeWithdrawTx.wait(); + expect(result).not.to.be.null; + + const w1_l2_DAI_balance_new = await wallet.getBalance(L2_ERC20_ADDR); + console.log("w1_l2_DAI_balance after deposit: ", ethers.utils.formatEther(w1_l2_DAI_balance_new)); + const w1_l1_DAI_balance_new = await wallet.getBalanceL1(DAI_ADDRESS); + console.log("w1_l1_DAI_balance after deposit:", ethers.utils.formatEther(w1_l1_DAI_balance_new)); + const w1_l2_base_token_balance_new = await wallet.getBalance(BASE_TOKEN_ADDR); + console.log( + "w2_l2_BASE_TOKEN_balance: after deposit", + ethers.utils.formatEther(w1_l2_base_token_balance_new), + ); + + expect(w1_l2_DAI_balance.sub(w1_l2_DAI_balance_new).toBigInt()).to.be.equal(withdraw_amount.toBigInt()); + expect(w1_l1_DAI_balance_new.sub(w1_l1_DAI_balance).toBigInt()).to.be.equal(withdraw_amount.toBigInt()); + expect(w1_l2_base_token_balance.sub(w1_l2_base_token_balance_new).toBigInt() > BigNumber.from(0).toBigInt()).to.be.true; + }).timeout(testTimeout); + }); + + //unsuuported test in SDK v0.14.4 + // describe("#depositFee()", async () => { + // it("should estimates the DAI token deposit fee", async () => { + // const deposit_amount = ethers.utils.parseEther("1"); + // const tx = { + // token: DAI_ADDRESS, + // amount: deposit_amount, + // to: await wallet.getAddress(), + // approveERC20: true, + // refundRecipient: await wallet.getAddress(), + // }; + + // const fee = await wallet.getFullRequiredDepositFee(tx); + // expect(fee).not.to.be.null; + // }).timeout(testTimeout); + // }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5fad5f8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "Node16", + "target": "ES2020", + "moduleResolution": "Node16", + + "outDir": "./build", + "esModuleInterop": true, + "declaration": true, + + "preserveSymlinks": true, + "preserveWatchOutput": true, + + "noImplicitOverride": true + }, + "files": ["./src/index.ts"] +} diff --git a/typechain/CronosTestnet.d.ts b/typechain/CronosTestnet.d.ts new file mode 100644 index 0000000..4747456 --- /dev/null +++ b/typechain/CronosTestnet.d.ts @@ -0,0 +1,837 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { + ethers, + EventFilter, + Signer, + BigNumber, + BigNumberish, + PopulatedTransaction, +} from "ethers"; +import { + Contract, + ContractTransaction, + Overrides, + CallOverrides, +} from "@ethersproject/contracts"; +import { BytesLike } from "@ethersproject/bytes"; +import { Listener, Provider } from "@ethersproject/providers"; +import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; + +interface CronosTestnetInterface extends ethers.utils.Interface { + functions: { + "allowance(address,address)": FunctionFragment; + "approve(address,uint256)": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "decimals()": FunctionFragment; + "decreaseAllowance(address,uint256)": FunctionFragment; + "increaseAllowance(address,uint256)": FunctionFragment; + "mint(address,uint256)": FunctionFragment; + "name()": FunctionFragment; + "owner()": FunctionFragment; + "renounceOwnership()": FunctionFragment; + "symbol()": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "allowance", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [string, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [string, string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + + events: { + "Approval(address,address,uint256)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; +} + +export class CronosTestnet extends Contract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + on(event: EventFilter | string, listener: Listener): this; + once(event: EventFilter | string, listener: Listener): this; + addListener(eventName: EventFilter | string, listener: Listener): this; + removeAllListeners(eventName: EventFilter | string): this; + removeListener(eventName: any, listener: Listener): this; + + interface: CronosTestnetInterface; + + functions: { + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<{ + 0: BigNumber; + }>; + + "allowance(address,address)"( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise<{ + 0: BigNumber; + }>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "approve(address,uint256)"( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise<{ + 0: BigNumber; + }>; + + "balanceOf(address)"( + account: string, + overrides?: CallOverrides + ): Promise<{ + 0: BigNumber; + }>; + + decimals(overrides?: CallOverrides): Promise<{ + 0: number; + }>; + + "decimals()"(overrides?: CallOverrides): Promise<{ + 0: number; + }>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "decreaseAllowance(address,uint256)"( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "increaseAllowance(address,uint256)"( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + mint( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + "mint(address,uint256)"( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + name(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + "name()"(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + owner(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + "owner()"(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + renounceOwnership(overrides?: Overrides): Promise; + + "renounceOwnership()"(overrides?: Overrides): Promise; + + symbol(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + "symbol()"(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + totalSupply(overrides?: CallOverrides): Promise<{ + 0: BigNumber; + }>; + + "totalSupply()"(overrides?: CallOverrides): Promise<{ + 0: BigNumber; + }>; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transfer(address,uint256)"( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides + ): Promise; + + "transferOwnership(address)"( + newOwner: string, + overrides?: Overrides + ): Promise; + }; + + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + "allowance(address,address)"( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "approve(address,uint256)"( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + "balanceOf(address)"( + account: string, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + "decimals()"(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "decreaseAllowance(address,uint256)"( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "increaseAllowance(address,uint256)"( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + mint( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + "mint(address,uint256)"( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + "name()"(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + "owner()"(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides): Promise; + + "renounceOwnership()"(overrides?: Overrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + "symbol()"(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + "totalSupply()"(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transfer(address,uint256)"( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides + ): Promise; + + "transferOwnership(address)"( + newOwner: string, + overrides?: Overrides + ): Promise; + + callStatic: { + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + "allowance(address,address)"( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "approve(address,uint256)"( + spender: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + "balanceOf(address)"( + account: string, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + "decimals()"(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "decreaseAllowance(address,uint256)"( + spender: string, + subtractedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "increaseAllowance(address,uint256)"( + spender: string, + addedValue: BigNumberish, + overrides?: CallOverrides + ): Promise; + + mint( + dest: string, + wad: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "mint(address,uint256)"( + dest: string, + wad: BigNumberish, + overrides?: CallOverrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + "name()"(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + "owner()"(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + "renounceOwnership()"(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + "symbol()"(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + "totalSupply()"(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "transfer(address,uint256)"( + to: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + amount: BigNumberish, + overrides?: CallOverrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides + ): Promise; + + "transferOwnership(address)"( + newOwner: string, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + Approval( + owner: string | null, + spender: string | null, + value: null + ): EventFilter; + + OwnershipTransferred( + previousOwner: string | null, + newOwner: string | null + ): EventFilter; + + Transfer(from: string | null, to: string | null, value: null): EventFilter; + }; + + estimateGas: { + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + "allowance(address,address)"( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "approve(address,uint256)"( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + "balanceOf(address)"( + account: string, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + "decimals()"(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "decreaseAllowance(address,uint256)"( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "increaseAllowance(address,uint256)"( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + mint( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + "mint(address,uint256)"( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + "name()"(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + "owner()"(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides): Promise; + + "renounceOwnership()"(overrides?: Overrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + "symbol()"(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + "totalSupply()"(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transfer(address,uint256)"( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides + ): Promise; + + "transferOwnership(address)"( + newOwner: string, + overrides?: Overrides + ): Promise; + }; + + populateTransaction: { + allowance( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + "allowance(address,address)"( + owner: string, + spender: string, + overrides?: CallOverrides + ): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "approve(address,uint256)"( + spender: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + balanceOf( + account: string, + overrides?: CallOverrides + ): Promise; + + "balanceOf(address)"( + account: string, + overrides?: CallOverrides + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + "decimals()"(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "decreaseAllowance(address,uint256)"( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + "increaseAllowance(address,uint256)"( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides + ): Promise; + + mint( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + "mint(address,uint256)"( + dest: string, + wad: BigNumberish, + overrides?: Overrides + ): Promise; + + name(overrides?: CallOverrides): Promise; + + "name()"(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + "owner()"(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides): Promise; + + "renounceOwnership()"(overrides?: Overrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + "symbol()"(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + "totalSupply()"(overrides?: CallOverrides): Promise; + + transfer( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transfer(address,uint256)"( + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferFrom( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + "transferFrom(address,address,uint256)"( + from: string, + to: string, + amount: BigNumberish, + overrides?: Overrides + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides + ): Promise; + + "transferOwnership(address)"( + newOwner: string, + overrides?: Overrides + ): Promise; + }; +} diff --git a/typechain/CronosTestnetFactory.ts b/typechain/CronosTestnetFactory.ts new file mode 100644 index 0000000..a3699c4 --- /dev/null +++ b/typechain/CronosTestnetFactory.ts @@ -0,0 +1,391 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Signer } from "ethers"; +import { Provider, TransactionRequest } from "@ethersproject/providers"; +import { Contract, ContractFactory, Overrides } from "@ethersproject/contracts"; + +import type { CronosTestnet } from "./CronosTestnet"; + +export class CronosTestnetFactory extends ContractFactory { + constructor(signer?: Signer) { + super(_abi, _bytecode, signer); + } + + override deploy(overrides?: Overrides): Promise { + return super.deploy(overrides || {}) as Promise; + } + override getDeployTransaction(overrides?: Overrides): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + override attach(address: string): CronosTestnet { + return super.attach(address) as CronosTestnet; + } + override connect(signer: Signer): CronosTestnetFactory { + return super.connect(signer) as CronosTestnetFactory; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): CronosTestnet { + return new Contract(address, _abi, signerOrProvider) as CronosTestnet; + } +} + +const _abi = [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "dest", + type: "address", + }, + { + internalType: "uint256", + name: "wad", + type: "uint256", + }, + ], + name: "mint", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +const _bytecode = + "0x60806040526005805460ff60a01b1916600960a11b1790553480156200002457600080fd5b506040518060400160405280600e81526020016d10dc9bdb9bdcc815195cdd1b995d60921b815250604051806040016040528060048152602001635443524f60e01b81525081600390816200007a9190620001a7565b506004620000898282620001a7565b505050620000a6620000a0620000ac60201b60201c565b620000b0565b62000273565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012d57607f821691505b6020821081036200014e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a257600081815260208120601f850160051c810160208610156200017d5750805b601f850160051c820191505b818110156200019e5782815560010162000189565b5050505b505050565b81516001600160401b03811115620001c357620001c362000102565b620001db81620001d4845462000118565b8462000154565b602080601f831160018114620002135760008415620001fa5750858301515b600019600386901b1c1916600185901b1785556200019e565b600085815260208120601f198616915b82811015620002445788860151825594840194600190910190840162000223565b5085821015620002635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610e9380620002836000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610226578063a9059cbb14610239578063dd62ed3e1461024c578063f2fde38b1461029257600080fd5b806370a08231146101b6578063715018a6146101ec5780638da5cb5b146101f657806395d89b411461021e57600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019057806340c10f19146101a357600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b6101026102a5565b60405161010f9190610c80565b60405180910390f35b61012b610126366004610d15565b610337565b604051901515815260200161010f565b6002545b60405190815260200161010f565b61012b61015b366004610d3f565b610351565b60055474010000000000000000000000000000000000000000900460ff1660405160ff909116815260200161010f565b61012b61019e366004610d15565b610375565b61012b6101b1366004610d15565b6103c1565b61013f6101c4366004610d7b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101f46103de565b005b60055460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b6101026103f2565b61012b610234366004610d15565b610401565b61012b610247366004610d15565b6104d7565b61013f61025a366004610d9d565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101f46102a0366004610d7b565b6104e5565b6060600380546102b490610dd0565b80601f01602080910402602001604051908101604052809291908181526020018280546102e090610dd0565b801561032d5780601f106103025761010080835404028352916020019161032d565b820191906000526020600020905b81548152906001019060200180831161031057829003601f168201915b5050505050905090565b60003361034581858561059c565b60019150505b92915050565b60003361035f85828561074f565b61036a858585610826565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061034590829086906103bc908790610e23565b61059c565b60006103cb610a95565b6103d58383610b16565b50600192915050565b6103e6610a95565b6103f06000610c09565b565b6060600480546102b490610dd0565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156104ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61036a828686840361059c565b600033610345818585610826565b6104ed610a95565b73ffffffffffffffffffffffffffffffffffffffff8116610590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104c1565b61059981610c09565b50565b73ffffffffffffffffffffffffffffffffffffffff831661063e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104c1565b73ffffffffffffffffffffffffffffffffffffffff82166106e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104c1565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146108205781811015610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104c1565b610820848484840361059c565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166108c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104c1565b73ffffffffffffffffffffffffffffffffffffffff821661096c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104c1565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610a22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016104c1565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610820565b60055473ffffffffffffffffffffffffffffffffffffffff1633146103f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c1565b73ffffffffffffffffffffffffffffffffffffffff8216610b93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104c1565b8060026000828254610ba59190610e23565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208083528351808285015260005b81811015610cad57858101830151858201604001528201610c91565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610d1057600080fd5b919050565b60008060408385031215610d2857600080fd5b610d3183610cec565b946020939093013593505050565b600080600060608486031215610d5457600080fd5b610d5d84610cec565b9250610d6b60208501610cec565b9150604084013590509250925092565b600060208284031215610d8d57600080fd5b610d9682610cec565b9392505050565b60008060408385031215610db057600080fd5b610db983610cec565b9150610dc760208401610cec565b90509250929050565b600181811c90821680610de457607f821691505b602082108103610e1d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8082018082111561034b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212202eeeebba761df315320d9033f941871479aaca882a067be364ee1a147346936864736f6c63430008140033"; diff --git a/typechain/IAllowList.d.ts b/typechain/IAllowList.d.ts index c7e4e1e..2d018c6 100644 --- a/typechain/IAllowList.d.ts +++ b/typechain/IAllowList.d.ts @@ -107,10 +107,12 @@ interface IAllowListInterface extends ethers.utils.Interface { events: { "UpdateAccessMode(address,uint8,uint8)": EventFragment; "UpdateCallPermission(address,address,bytes4,bool)": EventFragment; + "UpdateDepositLimit(address,bool,uint256)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "UpdateAccessMode"): EventFragment; getEvent(nameOrSignatureOrTopic: "UpdateCallPermission"): EventFragment; + getEvent(nameOrSignatureOrTopic: "UpdateDepositLimit"): EventFragment; } export class IAllowList extends Contract { @@ -537,6 +539,12 @@ export class IAllowList extends Contract { functionSig: BytesLike | null, status: null ): EventFilter; + + UpdateDepositLimit( + l1Token: string | null, + depositLimitation: null, + depositCap: null + ): EventFilter; }; estimateGas: { diff --git a/typechain/IAllowListFactory.ts b/typechain/IAllowListFactory.ts index 37ebcd0..7563387 100644 --- a/typechain/IAllowListFactory.ts +++ b/typechain/IAllowListFactory.ts @@ -73,6 +73,31 @@ const _abi = [ name: "UpdateCallPermission", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "l1Token", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "depositLimitation", + type: "bool", + }, + { + indexed: false, + internalType: "uint256", + name: "depositCap", + type: "uint256", + }, + ], + name: "UpdateDepositLimit", + type: "event", + }, { inputs: [ { diff --git a/typechain/IL1Bridge.d.ts b/typechain/IL1Bridge.d.ts index e770ca8..5aa5ade 100644 --- a/typechain/IL1Bridge.d.ts +++ b/typechain/IL1Bridge.d.ts @@ -24,9 +24,10 @@ import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; interface IL1BridgeInterface extends ethers.utils.Interface { functions: { "claimFailedDeposit(address,address,bytes32,uint256,uint256,uint16,bytes32[])": FunctionFragment; - "deposit(address,address,uint256,uint256,uint256)": FunctionFragment; + "deposit(address,address,uint256,uint256,uint256,address,uint256)": FunctionFragment; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])": FunctionFragment; "isWithdrawalFinalized(uint256,uint256)": FunctionFragment; + "l2Bridge()": FunctionFragment; "l2TokenAddress(address)": FunctionFragment; }; @@ -44,7 +45,15 @@ interface IL1BridgeInterface extends ethers.utils.Interface { ): string; encodeFunctionData( functionFragment: "deposit", - values: [string, string, BigNumberish, BigNumberish, BigNumberish] + values: [ + string, + string, + BigNumberish, + BigNumberish, + BigNumberish, + string, + BigNumberish + ] ): string; encodeFunctionData( functionFragment: "finalizeWithdrawal", @@ -54,6 +63,7 @@ interface IL1BridgeInterface extends ethers.utils.Interface { functionFragment: "isWithdrawalFinalized", values: [BigNumberish, BigNumberish] ): string; + encodeFunctionData(functionFragment: "l2Bridge", values?: undefined): string; encodeFunctionData( functionFragment: "l2TokenAddress", values: [string] @@ -72,6 +82,7 @@ interface IL1BridgeInterface extends ethers.utils.Interface { functionFragment: "isWithdrawalFinalized", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "l2Bridge", data: BytesLike): Result; decodeFunctionResult( functionFragment: "l2TokenAddress", data: BytesLike @@ -79,7 +90,7 @@ interface IL1BridgeInterface extends ethers.utils.Interface { events: { "ClaimedFailedDeposit(address,address,uint256)": EventFragment; - "DepositInitiated(address,address,address,uint256)": EventFragment; + "DepositInitiated(bytes32,address,address,address,uint256)": EventFragment; "WithdrawalFinalized(address,address,uint256)": EventFragment; }; @@ -106,9 +117,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -117,9 +128,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -130,38 +141,42 @@ export class IL1Bridge extends Contract { _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; - "deposit(address,address,uint256,uint256,uint256)"( + "deposit(address,address,uint256,uint256,uint256,address,uint256)"( _l2Receiver: string, _l1Token: string, _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; finalizeWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; isWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise<{ @@ -169,13 +184,21 @@ export class IL1Bridge extends Contract { }>; "isWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise<{ 0: boolean; }>; + l2Bridge(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + + "l2Bridge()"(overrides?: CallOverrides): Promise<{ + 0: string; + }>; + l2TokenAddress( _l1Token: string, overrides?: CallOverrides @@ -195,9 +218,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -206,9 +229,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -219,48 +242,56 @@ export class IL1Bridge extends Contract { _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; - "deposit(address,address,uint256,uint256,uint256)"( + "deposit(address,address,uint256,uint256,uint256,address,uint256)"( _l2Receiver: string, _l1Token: string, _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; finalizeWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; isWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; + l2Bridge(overrides?: CallOverrides): Promise; + + "l2Bridge()"(overrides?: CallOverrides): Promise; + l2TokenAddress(_l1Token: string, overrides?: CallOverrides): Promise; "l2TokenAddress(address)"( @@ -273,9 +304,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: CallOverrides ): Promise; @@ -284,9 +315,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: CallOverrides ): Promise; @@ -297,48 +328,56 @@ export class IL1Bridge extends Contract { _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: CallOverrides ): Promise; - "deposit(address,address,uint256,uint256,uint256)"( + "deposit(address,address,uint256,uint256,uint256,address,uint256)"( _l2Receiver: string, _l1Token: string, _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: CallOverrides ): Promise; finalizeWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: CallOverrides ): Promise; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: CallOverrides ): Promise; isWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; + l2Bridge(overrides?: CallOverrides): Promise; + + "l2Bridge()"(overrides?: CallOverrides): Promise; + l2TokenAddress( _l1Token: string, overrides?: CallOverrides @@ -358,9 +397,10 @@ export class IL1Bridge extends Contract { ): EventFilter; DepositInitiated( + l2DepositTxHash: BytesLike | null, from: string | null, to: string | null, - l1Token: string | null, + l1Token: null, amount: null ): EventFilter; @@ -376,9 +416,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -387,9 +427,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -400,48 +440,56 @@ export class IL1Bridge extends Contract { _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; - "deposit(address,address,uint256,uint256,uint256)"( + "deposit(address,address,uint256,uint256,uint256,address,uint256)"( _l2Receiver: string, _l1Token: string, _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; finalizeWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; isWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; + l2Bridge(overrides?: CallOverrides): Promise; + + "l2Bridge()"(overrides?: CallOverrides): Promise; + l2TokenAddress( _l1Token: string, overrides?: CallOverrides @@ -458,9 +506,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -469,9 +517,9 @@ export class IL1Bridge extends Contract { _depositSender: string, _l1Token: string, _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; @@ -482,48 +530,56 @@ export class IL1Bridge extends Contract { _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; - "deposit(address,address,uint256,uint256,uint256)"( + "deposit(address,address,uint256,uint256,uint256,address,uint256)"( _l2Receiver: string, _l1Token: string, _amount: BigNumberish, _l2TxGasLimit: BigNumberish, _l2TxGasPerPubdataByte: BigNumberish, + _refundRecipient: string, + _l1Amount: BigNumberish, overrides?: PayableOverrides ): Promise; finalizeWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; isWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; + l2Bridge(overrides?: CallOverrides): Promise; + + "l2Bridge()"(overrides?: CallOverrides): Promise; + l2TokenAddress( _l1Token: string, overrides?: CallOverrides @@ -534,4 +590,4 @@ export class IL1Bridge extends Contract { overrides?: CallOverrides ): Promise; }; -} \ No newline at end of file +} diff --git a/typechain/IL1BridgeFactory.ts b/typechain/IL1BridgeFactory.ts index 4251186..a194807 100644 --- a/typechain/IL1BridgeFactory.ts +++ b/typechain/IL1BridgeFactory.ts @@ -45,6 +45,12 @@ const _abi = [ { anonymous: false, inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "l2DepositTxHash", + type: "bytes32", + }, { indexed: true, internalType: "address", @@ -58,7 +64,7 @@ const _abi = [ type: "address", }, { - indexed: true, + indexed: false, internalType: "address", name: "l1Token", type: "address", @@ -117,7 +123,7 @@ const _abi = [ }, { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -127,7 +133,7 @@ const _abi = [ }, { internalType: "uint16", - name: "_l2TxNumberInBlock", + name: "_l2TxNumberInBatch", type: "uint16", }, { @@ -168,6 +174,16 @@ const _abi = [ name: "_l2TxGasPerPubdataByte", type: "uint256", }, + { + internalType: "address", + name: "_refundRecipient", + type: "address", + }, + { + internalType: "uint256", + name: "_l1Amount", + type: "uint256", + }, ], name: "deposit", outputs: [ @@ -184,7 +200,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -194,7 +210,7 @@ const _abi = [ }, { internalType: "uint16", - name: "_l2TxNumberInBlock", + name: "_l2TxNumberInBatch", type: "uint16", }, { @@ -217,7 +233,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -237,6 +253,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "l2Bridge", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -256,4 +285,4 @@ const _abi = [ stateMutability: "view", type: "function", }, -]; \ No newline at end of file +]; diff --git a/typechain/IL2Bridge.d.ts b/typechain/IL2Bridge.d.ts index 7e3e33e..e71a3b2 100644 --- a/typechain/IL2Bridge.d.ts +++ b/typechain/IL2Bridge.d.ts @@ -14,6 +14,7 @@ import { Contract, ContractTransaction, Overrides, + PayableOverrides, CallOverrides, } from "@ethersproject/contracts"; import { BytesLike } from "@ethersproject/bytes"; @@ -23,7 +24,6 @@ import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; interface IL2BridgeInterface extends ethers.utils.Interface { functions: { "finalizeDeposit(address,address,address,uint256,bytes)": FunctionFragment; - "initialize(address,bytes32,address)": FunctionFragment; "l1Bridge()": FunctionFragment; "l1TokenAddress(address)": FunctionFragment; "l2TokenAddress(address)": FunctionFragment; @@ -34,10 +34,6 @@ interface IL2BridgeInterface extends ethers.utils.Interface { functionFragment: "finalizeDeposit", values: [string, string, string, BigNumberish, BytesLike] ): string; - encodeFunctionData( - functionFragment: "initialize", - values: [string, BytesLike, string] - ): string; encodeFunctionData(functionFragment: "l1Bridge", values?: undefined): string; encodeFunctionData( functionFragment: "l1TokenAddress", @@ -56,7 +52,6 @@ interface IL2BridgeInterface extends ethers.utils.Interface { functionFragment: "finalizeDeposit", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; decodeFunctionResult(functionFragment: "l1Bridge", data: BytesLike): Result; decodeFunctionResult( functionFragment: "l1TokenAddress", @@ -91,7 +86,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; "finalizeDeposit(address,address,address,uint256,bytes)"( @@ -100,21 +95,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides - ): Promise; - - initialize( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides - ): Promise; - - "initialize(address,bytes32,address)"( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; l1Bridge(overrides?: CallOverrides): Promise<{ @@ -174,7 +155,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; "finalizeDeposit(address,address,address,uint256,bytes)"( @@ -183,21 +164,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides - ): Promise; - - initialize( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides - ): Promise; - - "initialize(address,bytes32,address)"( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; l1Bridge(overrides?: CallOverrides): Promise; @@ -251,20 +218,6 @@ export class IL2Bridge extends Contract { overrides?: CallOverrides ): Promise; - initialize( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: CallOverrides - ): Promise; - - "initialize(address,bytes32,address)"( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: CallOverrides - ): Promise; - l1Bridge(overrides?: CallOverrides): Promise; "l1Bridge()"(overrides?: CallOverrides): Promise; @@ -313,7 +266,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; "finalizeDeposit(address,address,address,uint256,bytes)"( @@ -322,21 +275,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides - ): Promise; - - initialize( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides - ): Promise; - - "initialize(address,bytes32,address)"( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; l1Bridge(overrides?: CallOverrides): Promise; @@ -385,7 +324,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; "finalizeDeposit(address,address,address,uint256,bytes)"( @@ -394,21 +333,7 @@ export class IL2Bridge extends Contract { _l1Token: string, _amount: BigNumberish, _data: BytesLike, - overrides?: Overrides - ): Promise; - - initialize( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides - ): Promise; - - "initialize(address,bytes32,address)"( - _l1Bridge: string, - _l2TokenProxyBytecodeHash: BytesLike, - _governor: string, - overrides?: Overrides + overrides?: PayableOverrides ): Promise; l1Bridge(overrides?: CallOverrides): Promise; diff --git a/typechain/IL2BridgeFactory.ts b/typechain/IL2BridgeFactory.ts index 5de8477..3c7c0dd 100644 --- a/typechain/IL2BridgeFactory.ts +++ b/typechain/IL2BridgeFactory.ts @@ -47,30 +47,7 @@ const _abi = [ ], name: "finalizeDeposit", outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_l1Bridge", - type: "address", - }, - { - internalType: "bytes32", - name: "_l2TokenProxyBytecodeHash", - type: "bytes32", - }, - { - internalType: "address", - name: "_governor", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "payable", type: "function", }, { diff --git a/typechain/IZkSync.d.ts b/typechain/IZkSync.d.ts index 34d2062..29e6c8c 100644 --- a/typechain/IZkSync.d.ts +++ b/typechain/IZkSync.d.ts @@ -23,36 +23,36 @@ import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; interface IZkSyncInterface extends ethers.utils.Interface { functions: { + "acceptAdmin()": FunctionFragment; "acceptGovernor()": FunctionFragment; - "cancelUpgradeProposal(bytes32)": FunctionFragment; - "commitBlocks(tuple,tuple[])": FunctionFragment; - "executeBlocks(tuple[])": FunctionFragment; - "executeUpgrade(tuple,bytes32)": FunctionFragment; + "baseTokenAddress()": FunctionFragment; + "commitBatches(tuple,tuple[])": FunctionFragment; + "executeBatches(tuple[])": FunctionFragment; + "executeUpgrade(tuple)": FunctionFragment; "facetAddress(bytes4)": FunctionFragment; "facetAddresses()": FunctionFragment; "facetFunctionSelectors(address)": FunctionFragment; "facets()": FunctionFragment; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])": FunctionFragment; "freezeDiamond()": FunctionFragment; - "getCurrentProposalId()": FunctionFragment; + "getAllowList()": FunctionFragment; "getFirstUnprocessedPriorityTx()": FunctionFragment; "getGovernor()": FunctionFragment; "getL2BootloaderBytecodeHash()": FunctionFragment; "getL2DefaultAccountBytecodeHash()": FunctionFragment; + "getL2SystemContractsUpgradeBatchNumber()": FunctionFragment; + "getL2SystemContractsUpgradeTxHash()": FunctionFragment; + "getName()": FunctionFragment; "getPendingGovernor()": FunctionFragment; "getPriorityQueueSize()": FunctionFragment; - "getProposedUpgradeHash()": FunctionFragment; - "getProposedUpgradeTimestamp()": FunctionFragment; - "getSecurityCouncil()": FunctionFragment; - "getTotalBlocksCommitted()": FunctionFragment; - "getTotalBlocksExecuted()": FunctionFragment; - "getTotalBlocksVerified()": FunctionFragment; + "getPriorityTxMaxGasLimit()": FunctionFragment; + "getProtocolVersion()": FunctionFragment; + "getTotalBatchesCommitted()": FunctionFragment; + "getTotalBatchesExecuted()": FunctionFragment; + "getTotalBatchesVerified()": FunctionFragment; "getTotalPriorityTxs()": FunctionFragment; - "getUpgradeProposalState()": FunctionFragment; "getVerifier()": FunctionFragment; "getVerifierParams()": FunctionFragment; - "getpriorityTxMaxGasLimit()": FunctionFragment; - "isApprovedBySecurityCouncil()": FunctionFragment; "isDiamondStorageFrozen()": FunctionFragment; "isEthWithdrawalFinalized(uint256,uint256)": FunctionFragment; "isFacetFreezable(address)": FunctionFragment; @@ -61,42 +61,39 @@ interface IZkSyncInterface extends ethers.utils.Interface { "l2LogsRootHash(uint256)": FunctionFragment; "l2TransactionBaseCost(uint256,uint256,uint256)": FunctionFragment; "priorityQueueFrontOperation()": FunctionFragment; - "proposeShadowUpgrade(bytes32,uint40)": FunctionFragment; - "proposeTransparentUpgrade(tuple,uint40)": FunctionFragment; - "proveBlocks(tuple,tuple[],tuple)": FunctionFragment; + "proveBatches(tuple,tuple[],tuple)": FunctionFragment; "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)": FunctionFragment; "proveL2LogInclusion(uint256,uint256,tuple,bytes32[])": FunctionFragment; "proveL2MessageInclusion(uint256,uint256,tuple,bytes32[])": FunctionFragment; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)": FunctionFragment; - "revertBlocks(uint256)": FunctionFragment; - "securityCouncilUpgradeApprove(bytes32)": FunctionFragment; - "setL2BootloaderBytecodeHash(bytes32)": FunctionFragment; - "setL2DefaultAccountBytecodeHash(bytes32)": FunctionFragment; + "requestL2Transaction(tuple,bytes,bytes[],address,uint256)": FunctionFragment; + "revertBatches(uint256)": FunctionFragment; + "setPendingAdmin(address)": FunctionFragment; "setPendingGovernor(address)": FunctionFragment; "setPorterAvailability(bool)": FunctionFragment; "setPriorityTxMaxGasLimit(uint256)": FunctionFragment; "setValidator(address,bool)": FunctionFragment; - "setVerifier(address)": FunctionFragment; - "setVerifierParams(tuple)": FunctionFragment; - "storedBlockHash(uint256)": FunctionFragment; + "storedBatchHash(uint256)": FunctionFragment; "unfreezeDiamond()": FunctionFragment; - "upgradeProposalHash(tuple,uint256,bytes32)": FunctionFragment; }; + encodeFunctionData( + functionFragment: "acceptAdmin", + values?: undefined + ): string; encodeFunctionData( functionFragment: "acceptGovernor", values?: undefined ): string; encodeFunctionData( - functionFragment: "cancelUpgradeProposal", - values: [BytesLike] + functionFragment: "baseTokenAddress", + values?: undefined ): string; encodeFunctionData( - functionFragment: "commitBlocks", + functionFragment: "commitBatches", values: [ { - blockNumber: BigNumberish; - blockHash: BytesLike; + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -105,27 +102,25 @@ interface IZkSyncInterface extends ethers.utils.Interface { commitment: BytesLike; }, { - blockNumber: BigNumberish; + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[] ] ): string; encodeFunctionData( - functionFragment: "executeBlocks", + functionFragment: "executeBatches", values: [ { - blockNumber: BigNumberish; - blockHash: BytesLike; + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -147,8 +142,7 @@ interface IZkSyncInterface extends ethers.utils.Interface { }[]; initAddress: string; initCalldata: BytesLike; - }, - BytesLike + } ] ): string; encodeFunctionData( @@ -173,7 +167,7 @@ interface IZkSyncInterface extends ethers.utils.Interface { values?: undefined ): string; encodeFunctionData( - functionFragment: "getCurrentProposalId", + functionFragment: "getAllowList", values?: undefined ): string; encodeFunctionData( @@ -193,43 +187,44 @@ interface IZkSyncInterface extends ethers.utils.Interface { values?: undefined ): string; encodeFunctionData( - functionFragment: "getPendingGovernor", + functionFragment: "getL2SystemContractsUpgradeBatchNumber", values?: undefined ): string; encodeFunctionData( - functionFragment: "getPriorityQueueSize", + functionFragment: "getL2SystemContractsUpgradeTxHash", values?: undefined ): string; + encodeFunctionData(functionFragment: "getName", values?: undefined): string; encodeFunctionData( - functionFragment: "getProposedUpgradeHash", + functionFragment: "getPendingGovernor", values?: undefined ): string; encodeFunctionData( - functionFragment: "getProposedUpgradeTimestamp", + functionFragment: "getPriorityQueueSize", values?: undefined ): string; encodeFunctionData( - functionFragment: "getSecurityCouncil", + functionFragment: "getPriorityTxMaxGasLimit", values?: undefined ): string; encodeFunctionData( - functionFragment: "getTotalBlocksCommitted", + functionFragment: "getProtocolVersion", values?: undefined ): string; encodeFunctionData( - functionFragment: "getTotalBlocksExecuted", + functionFragment: "getTotalBatchesCommitted", values?: undefined ): string; encodeFunctionData( - functionFragment: "getTotalBlocksVerified", + functionFragment: "getTotalBatchesExecuted", values?: undefined ): string; encodeFunctionData( - functionFragment: "getTotalPriorityTxs", + functionFragment: "getTotalBatchesVerified", values?: undefined ): string; encodeFunctionData( - functionFragment: "getUpgradeProposalState", + functionFragment: "getTotalPriorityTxs", values?: undefined ): string; encodeFunctionData( @@ -240,14 +235,6 @@ interface IZkSyncInterface extends ethers.utils.Interface { functionFragment: "getVerifierParams", values?: undefined ): string; - encodeFunctionData( - functionFragment: "getpriorityTxMaxGasLimit", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "isApprovedBySecurityCouncil", - values?: undefined - ): string; encodeFunctionData( functionFragment: "isDiamondStorageFrozen", values?: undefined @@ -278,31 +265,11 @@ interface IZkSyncInterface extends ethers.utils.Interface { values?: undefined ): string; encodeFunctionData( - functionFragment: "proposeShadowUpgrade", - values: [BytesLike, BigNumberish] - ): string; - encodeFunctionData( - functionFragment: "proposeTransparentUpgrade", - values: [ - { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - BigNumberish - ] - ): string; - encodeFunctionData( - functionFragment: "proveBlocks", + functionFragment: "proveBatches", values: [ { - blockNumber: BigNumberish; - blockHash: BytesLike; + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -311,8 +278,8 @@ interface IZkSyncInterface extends ethers.utils.Interface { commitment: BytesLike; }, { - blockNumber: BigNumberish; - blockHash: BytesLike; + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -345,7 +312,7 @@ interface IZkSyncInterface extends ethers.utils.Interface { { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -358,37 +325,32 @@ interface IZkSyncInterface extends ethers.utils.Interface { values: [ BigNumberish, BigNumberish, - { txNumberInBlock: BigNumberish; sender: string; data: BytesLike }, + { txNumberInBatch: BigNumberish; sender: string; data: BytesLike }, BytesLike[] ] ): string; encodeFunctionData( functionFragment: "requestL2Transaction", values: [ - string, - BigNumberish, + { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, BytesLike, - BigNumberish, - BigNumberish, BytesLike[], - string + string, + BigNumberish ] ): string; encodeFunctionData( - functionFragment: "revertBlocks", + functionFragment: "revertBatches", values: [BigNumberish] ): string; encodeFunctionData( - functionFragment: "securityCouncilUpgradeApprove", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "setL2BootloaderBytecodeHash", - values: [BytesLike] - ): string; - encodeFunctionData( - functionFragment: "setL2DefaultAccountBytecodeHash", - values: [BytesLike] + functionFragment: "setPendingAdmin", + values: [string] ): string; encodeFunctionData( functionFragment: "setPendingGovernor", @@ -406,57 +368,33 @@ interface IZkSyncInterface extends ethers.utils.Interface { functionFragment: "setValidator", values: [string, boolean] ): string; - encodeFunctionData(functionFragment: "setVerifier", values: [string]): string; - encodeFunctionData( - functionFragment: "setVerifierParams", - values: [ - { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - } - ] - ): string; encodeFunctionData( - functionFragment: "storedBlockHash", + functionFragment: "storedBatchHash", values: [BigNumberish] ): string; encodeFunctionData( functionFragment: "unfreezeDiamond", values?: undefined ): string; - encodeFunctionData( - functionFragment: "upgradeProposalHash", - values: [ - { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - BigNumberish, - BytesLike - ] - ): string; + decodeFunctionResult( + functionFragment: "acceptAdmin", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "acceptGovernor", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "cancelUpgradeProposal", + functionFragment: "baseTokenAddress", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "commitBlocks", + functionFragment: "commitBatches", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "executeBlocks", + functionFragment: "executeBatches", data: BytesLike ): Result; decodeFunctionResult( @@ -485,7 +423,7 @@ interface IZkSyncInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getCurrentProposalId", + functionFragment: "getAllowList", data: BytesLike ): Result; decodeFunctionResult( @@ -505,43 +443,44 @@ interface IZkSyncInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getPendingGovernor", + functionFragment: "getL2SystemContractsUpgradeBatchNumber", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getPriorityQueueSize", + functionFragment: "getL2SystemContractsUpgradeTxHash", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "getName", data: BytesLike): Result; decodeFunctionResult( - functionFragment: "getProposedUpgradeHash", + functionFragment: "getPendingGovernor", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getProposedUpgradeTimestamp", + functionFragment: "getPriorityQueueSize", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getSecurityCouncil", + functionFragment: "getPriorityTxMaxGasLimit", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getTotalBlocksCommitted", + functionFragment: "getProtocolVersion", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getTotalBlocksExecuted", + functionFragment: "getTotalBatchesCommitted", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getTotalBlocksVerified", + functionFragment: "getTotalBatchesExecuted", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getTotalPriorityTxs", + functionFragment: "getTotalBatchesVerified", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "getUpgradeProposalState", + functionFragment: "getTotalPriorityTxs", data: BytesLike ): Result; decodeFunctionResult( @@ -552,14 +491,6 @@ interface IZkSyncInterface extends ethers.utils.Interface { functionFragment: "getVerifierParams", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "getpriorityTxMaxGasLimit", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "isApprovedBySecurityCouncil", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "isDiamondStorageFrozen", data: BytesLike @@ -593,15 +524,7 @@ interface IZkSyncInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "proposeShadowUpgrade", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "proposeTransparentUpgrade", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "proveBlocks", + functionFragment: "proveBatches", data: BytesLike ): Result; decodeFunctionResult( @@ -621,19 +544,11 @@ interface IZkSyncInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "revertBlocks", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "securityCouncilUpgradeApprove", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setL2BootloaderBytecodeHash", + functionFragment: "revertBatches", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "setL2DefaultAccountBytecodeHash", + functionFragment: "setPendingAdmin", data: BytesLike ): Result; decodeFunctionResult( @@ -653,47 +568,29 @@ interface IZkSyncInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "setVerifier", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "setVerifierParams", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "storedBlockHash", + functionFragment: "storedBatchHash", data: BytesLike ): Result; decodeFunctionResult( functionFragment: "unfreezeDiamond", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "upgradeProposalHash", - data: BytesLike - ): Result; events: { "BlockCommit(uint256,bytes32,bytes32)": EventFragment; "BlockExecution(uint256,bytes32,bytes32)": EventFragment; "BlocksRevert(uint256,uint256,uint256)": EventFragment; "BlocksVerification(uint256,uint256)": EventFragment; - "CancelUpgradeProposal(uint256,bytes32)": EventFragment; "EthWithdrawalFinalized(address,uint256)": EventFragment; - "ExecuteUpgrade(uint256,bytes32,bytes32)": EventFragment; + "ExecuteUpgrade(tuple)": EventFragment; "Freeze()": EventFragment; "IsPorterAvailableStatusUpdate(bool)": EventFragment; + "NewAdmin(address,address)": EventFragment; "NewGovernor(address,address)": EventFragment; - "NewL2BootloaderBytecodeHash(bytes32,bytes32)": EventFragment; - "NewL2DefaultAccountBytecodeHash(bytes32,bytes32)": EventFragment; + "NewPendingAdmin(address,address)": EventFragment; "NewPendingGovernor(address,address)": EventFragment; "NewPriorityRequest(uint256,bytes32,uint64,tuple,bytes[])": EventFragment; "NewPriorityTxMaxGasLimit(uint256,uint256)": EventFragment; - "NewVerifier(address,address)": EventFragment; - "NewVerifierParams(tuple,tuple)": EventFragment; - "ProposeShadowUpgrade(uint256,bytes32)": EventFragment; - "ProposeTransparentUpgrade(tuple,uint256,bytes32)": EventFragment; - "SecurityCouncilUpgradeApprove(uint256,bytes32)": EventFragment; "Unfreeze()": EventFragment; "ValidatorStatusUpdate(address,bool)": EventFragment; }; @@ -702,30 +599,18 @@ interface IZkSyncInterface extends ethers.utils.Interface { getEvent(nameOrSignatureOrTopic: "BlockExecution"): EventFragment; getEvent(nameOrSignatureOrTopic: "BlocksRevert"): EventFragment; getEvent(nameOrSignatureOrTopic: "BlocksVerification"): EventFragment; - getEvent(nameOrSignatureOrTopic: "CancelUpgradeProposal"): EventFragment; getEvent(nameOrSignatureOrTopic: "EthWithdrawalFinalized"): EventFragment; getEvent(nameOrSignatureOrTopic: "ExecuteUpgrade"): EventFragment; getEvent(nameOrSignatureOrTopic: "Freeze"): EventFragment; getEvent( nameOrSignatureOrTopic: "IsPorterAvailableStatusUpdate" ): EventFragment; + getEvent(nameOrSignatureOrTopic: "NewAdmin"): EventFragment; getEvent(nameOrSignatureOrTopic: "NewGovernor"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "NewL2BootloaderBytecodeHash" - ): EventFragment; - getEvent( - nameOrSignatureOrTopic: "NewL2DefaultAccountBytecodeHash" - ): EventFragment; + getEvent(nameOrSignatureOrTopic: "NewPendingAdmin"): EventFragment; getEvent(nameOrSignatureOrTopic: "NewPendingGovernor"): EventFragment; getEvent(nameOrSignatureOrTopic: "NewPriorityRequest"): EventFragment; getEvent(nameOrSignatureOrTopic: "NewPriorityTxMaxGasLimit"): EventFragment; - getEvent(nameOrSignatureOrTopic: "NewVerifier"): EventFragment; - getEvent(nameOrSignatureOrTopic: "NewVerifierParams"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ProposeShadowUpgrade"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ProposeTransparentUpgrade"): EventFragment; - getEvent( - nameOrSignatureOrTopic: "SecurityCouncilUpgradeApprove" - ): EventFragment; getEvent(nameOrSignatureOrTopic: "Unfreeze"): EventFragment; getEvent(nameOrSignatureOrTopic: "ValidatorStatusUpdate"): EventFragment; } @@ -744,24 +629,26 @@ export class IZkSync extends Contract { interface: IZkSyncInterface; functions: { + acceptAdmin(overrides?: Overrides): Promise; + + "acceptAdmin()"(overrides?: Overrides): Promise; + acceptGovernor(overrides?: Overrides): Promise; "acceptGovernor()"(overrides?: Overrides): Promise; - cancelUpgradeProposal( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + baseTokenAddress(overrides?: CallOverrides): Promise<{ + 0: string; + }>; - "cancelUpgradeProposal(bytes32)"( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + "baseTokenAddress()"(overrides?: CallOverrides): Promise<{ + 0: string; + }>; - commitBlocks( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + commitBatches( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -769,27 +656,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - "commitBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "commitBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -797,27 +682,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - executeBlocks( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + executeBatches( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -828,10 +711,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "executeBlocks(tuple[])"( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "executeBatches(tuple[])"( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -853,11 +736,10 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; - "executeUpgrade((tuple[],address,bytes),bytes32)"( + "executeUpgrade((tuple[],address,bytes))"( _diamondCut: { facetCuts: { facet: string; @@ -868,7 +750,6 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; @@ -921,18 +802,18 @@ export class IZkSync extends Contract { }>; finalizeEthWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides @@ -942,12 +823,12 @@ export class IZkSync extends Contract { "freezeDiamond()"(overrides?: Overrides): Promise; - getCurrentProposalId(overrides?: CallOverrides): Promise<{ - 0: BigNumber; + getAllowList(overrides?: CallOverrides): Promise<{ + 0: string; }>; - "getCurrentProposalId()"(overrides?: CallOverrides): Promise<{ - 0: BigNumber; + "getAllowList()"(overrides?: CallOverrides): Promise<{ + 0: string; }>; getFirstUnprocessedPriorityTx(overrides?: CallOverrides): Promise<{ @@ -982,84 +863,94 @@ export class IZkSync extends Contract { 0: string; }>; - getPendingGovernor(overrides?: CallOverrides): Promise<{ + getL2SystemContractsUpgradeBatchNumber(overrides?: CallOverrides): Promise<{ + 0: BigNumber; + }>; + + "getL2SystemContractsUpgradeBatchNumber()"( + overrides?: CallOverrides + ): Promise<{ + 0: BigNumber; + }>; + + getL2SystemContractsUpgradeTxHash(overrides?: CallOverrides): Promise<{ 0: string; }>; - "getPendingGovernor()"(overrides?: CallOverrides): Promise<{ + "getL2SystemContractsUpgradeTxHash()"(overrides?: CallOverrides): Promise<{ 0: string; }>; - getPriorityQueueSize(overrides?: CallOverrides): Promise<{ - 0: BigNumber; + getName(overrides?: CallOverrides): Promise<{ + 0: string; }>; - "getPriorityQueueSize()"(overrides?: CallOverrides): Promise<{ - 0: BigNumber; + "getName()"(overrides?: CallOverrides): Promise<{ + 0: string; }>; - getProposedUpgradeHash(overrides?: CallOverrides): Promise<{ + getPendingGovernor(overrides?: CallOverrides): Promise<{ 0: string; }>; - "getProposedUpgradeHash()"(overrides?: CallOverrides): Promise<{ + "getPendingGovernor()"(overrides?: CallOverrides): Promise<{ 0: string; }>; - getProposedUpgradeTimestamp(overrides?: CallOverrides): Promise<{ + getPriorityQueueSize(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - "getProposedUpgradeTimestamp()"(overrides?: CallOverrides): Promise<{ + "getPriorityQueueSize()"(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - getSecurityCouncil(overrides?: CallOverrides): Promise<{ - 0: string; + getPriorityTxMaxGasLimit(overrides?: CallOverrides): Promise<{ + 0: BigNumber; }>; - "getSecurityCouncil()"(overrides?: CallOverrides): Promise<{ - 0: string; + "getPriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise<{ + 0: BigNumber; }>; - getTotalBlocksCommitted(overrides?: CallOverrides): Promise<{ + getProtocolVersion(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - "getTotalBlocksCommitted()"(overrides?: CallOverrides): Promise<{ + "getProtocolVersion()"(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - getTotalBlocksExecuted(overrides?: CallOverrides): Promise<{ + getTotalBatchesCommitted(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - "getTotalBlocksExecuted()"(overrides?: CallOverrides): Promise<{ + "getTotalBatchesCommitted()"(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - getTotalBlocksVerified(overrides?: CallOverrides): Promise<{ + getTotalBatchesExecuted(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - "getTotalBlocksVerified()"(overrides?: CallOverrides): Promise<{ + "getTotalBatchesExecuted()"(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - getTotalPriorityTxs(overrides?: CallOverrides): Promise<{ + getTotalBatchesVerified(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - "getTotalPriorityTxs()"(overrides?: CallOverrides): Promise<{ + "getTotalBatchesVerified()"(overrides?: CallOverrides): Promise<{ 0: BigNumber; }>; - getUpgradeProposalState(overrides?: CallOverrides): Promise<{ - 0: number; + getTotalPriorityTxs(overrides?: CallOverrides): Promise<{ + 0: BigNumber; }>; - "getUpgradeProposalState()"(overrides?: CallOverrides): Promise<{ - 0: number; + "getTotalPriorityTxs()"(overrides?: CallOverrides): Promise<{ + 0: BigNumber; }>; getVerifier(overrides?: CallOverrides): Promise<{ @@ -1092,22 +983,6 @@ export class IZkSync extends Contract { }; }>; - getpriorityTxMaxGasLimit(overrides?: CallOverrides): Promise<{ - 0: BigNumber; - }>; - - "getpriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise<{ - 0: BigNumber; - }>; - - isApprovedBySecurityCouncil(overrides?: CallOverrides): Promise<{ - 0: boolean; - }>; - - "isApprovedBySecurityCouncil()"(overrides?: CallOverrides): Promise<{ - 0: boolean; - }>; - isDiamondStorageFrozen(overrides?: CallOverrides): Promise<{ 0: boolean; }>; @@ -1117,7 +992,7 @@ export class IZkSync extends Contract { }>; isEthWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise<{ @@ -1125,7 +1000,7 @@ export class IZkSync extends Contract { }>; "isEthWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise<{ @@ -1177,7 +1052,7 @@ export class IZkSync extends Contract { }>; l2LogsRootHash( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise<{ hash: string; @@ -1185,7 +1060,7 @@ export class IZkSync extends Contract { }>; "l2LogsRootHash(uint256)"( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise<{ hash: string; @@ -1232,52 +1107,10 @@ export class IZkSync extends Contract { }; }>; - proposeShadowUpgrade( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeShadowUpgrade(bytes32,uint40)"( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proposeTransparentUpgrade( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeTransparentUpgrade((tuple[],address,bytes),uint40)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proveBlocks( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + proveBatches( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1285,9 +1118,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1302,10 +1135,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "proveBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1313,9 +1146,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1332,9 +1165,9 @@ export class IZkSync extends Contract { proveL1ToL2TransactionStatus( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -1344,9 +1177,9 @@ export class IZkSync extends Contract { "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)"( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -1355,12 +1188,12 @@ export class IZkSync extends Contract { }>; proveL2LogInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -1372,12 +1205,12 @@ export class IZkSync extends Contract { }>; "proveL2LogInclusion(uint256,uint256,(uint8,bool,uint16,address,bytes32,bytes32),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -1389,10 +1222,10 @@ export class IZkSync extends Contract { }>; proveL2MessageInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -1403,10 +1236,10 @@ export class IZkSync extends Contract { }>; "proveL2MessageInclusion(uint256,uint256,(uint16,address,bytes),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -1417,64 +1250,50 @@ export class IZkSync extends Contract { }>; requestL2Transaction( - _contractL2: string, - _l2Value: BigNumberish, + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)"( - _contractL2: string, - _l2Value: BigNumberish, + "requestL2Transaction((address,uint256,uint256,uint256),bytes,bytes[],address,uint256)"( + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - revertBlocks( - _newLastBlock: BigNumberish, - overrides?: Overrides - ): Promise; - - "revertBlocks(uint256)"( - _newLastBlock: BigNumberish, - overrides?: Overrides - ): Promise; - - securityCouncilUpgradeApprove( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - "securityCouncilUpgradeApprove(bytes32)"( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2BootloaderBytecodeHash( - _l2BootloaderBytecodeHash: BytesLike, + revertBatches( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - "setL2BootloaderBytecodeHash(bytes32)"( - _l2BootloaderBytecodeHash: BytesLike, + "revertBatches(uint256)"( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - setL2DefaultAccountBytecodeHash( - _l2DefaultAccountBytecodeHash: BytesLike, + setPendingAdmin( + _newPendingAdmin: string, overrides?: Overrides ): Promise; - "setL2DefaultAccountBytecodeHash(bytes32)"( - _l2DefaultAccountBytecodeHash: BytesLike, + "setPendingAdmin(address)"( + _newPendingAdmin: string, overrides?: Overrides ): Promise; @@ -1520,43 +1339,15 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - setVerifier( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - "setVerifier(address)"( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - setVerifierParams( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - "setVerifierParams((bytes32,bytes32,bytes32))"( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - storedBlockHash( - _blockNumber: BigNumberish, + storedBatchHash( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise<{ 0: string; }>; - "storedBlockHash(uint256)"( - _blockNumber: BigNumberish, + "storedBatchHash(uint256)"( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise<{ 0: string; @@ -1565,62 +1356,24 @@ export class IZkSync extends Contract { unfreezeDiamond(overrides?: Overrides): Promise; "unfreezeDiamond()"(overrides?: Overrides): Promise; + }; - upgradeProposalHash( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise<{ - 0: string; - }>; + acceptAdmin(overrides?: Overrides): Promise; - "upgradeProposalHash((tuple[],address,bytes),uint256,bytes32)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise<{ - 0: string; - }>; - }; + "acceptAdmin()"(overrides?: Overrides): Promise; acceptGovernor(overrides?: Overrides): Promise; "acceptGovernor()"(overrides?: Overrides): Promise; - cancelUpgradeProposal( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + baseTokenAddress(overrides?: CallOverrides): Promise; - "cancelUpgradeProposal(bytes32)"( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + "baseTokenAddress()"(overrides?: CallOverrides): Promise; - commitBlocks( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + commitBatches( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1628,27 +1381,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - "commitBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "commitBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1656,27 +1407,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - executeBlocks( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + executeBatches( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1687,10 +1436,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "executeBlocks(tuple[])"( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "executeBatches(tuple[])"( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -1712,11 +1461,10 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; - "executeUpgrade((tuple[],address,bytes),bytes32)"( + "executeUpgrade((tuple[],address,bytes))"( _diamondCut: { facetCuts: { facet: string; @@ -1727,7 +1475,6 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; @@ -1764,18 +1511,18 @@ export class IZkSync extends Contract { ): Promise<{ addr: string; selectors: string[]; 0: string; 1: string[] }[]>; finalizeEthWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides @@ -1785,9 +1532,9 @@ export class IZkSync extends Contract { "freezeDiamond()"(overrides?: Overrides): Promise; - getCurrentProposalId(overrides?: CallOverrides): Promise; + getAllowList(overrides?: CallOverrides): Promise; - "getCurrentProposalId()"(overrides?: CallOverrides): Promise; + "getAllowList()"(overrides?: CallOverrides): Promise; getFirstUnprocessedPriorityTx(overrides?: CallOverrides): Promise; @@ -1809,6 +1556,24 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; + getL2SystemContractsUpgradeBatchNumber( + overrides?: CallOverrides + ): Promise; + + "getL2SystemContractsUpgradeBatchNumber()"( + overrides?: CallOverrides + ): Promise; + + getL2SystemContractsUpgradeTxHash(overrides?: CallOverrides): Promise; + + "getL2SystemContractsUpgradeTxHash()"( + overrides?: CallOverrides + ): Promise; + + getName(overrides?: CallOverrides): Promise; + + "getName()"(overrides?: CallOverrides): Promise; + getPendingGovernor(overrides?: CallOverrides): Promise; "getPendingGovernor()"(overrides?: CallOverrides): Promise; @@ -1817,40 +1582,30 @@ export class IZkSync extends Contract { "getPriorityQueueSize()"(overrides?: CallOverrides): Promise; - getProposedUpgradeHash(overrides?: CallOverrides): Promise; - - "getProposedUpgradeHash()"(overrides?: CallOverrides): Promise; - - getProposedUpgradeTimestamp(overrides?: CallOverrides): Promise; + getPriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - "getProposedUpgradeTimestamp()"( - overrides?: CallOverrides - ): Promise; + "getPriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - getSecurityCouncil(overrides?: CallOverrides): Promise; + getProtocolVersion(overrides?: CallOverrides): Promise; - "getSecurityCouncil()"(overrides?: CallOverrides): Promise; + "getProtocolVersion()"(overrides?: CallOverrides): Promise; - getTotalBlocksCommitted(overrides?: CallOverrides): Promise; + getTotalBatchesCommitted(overrides?: CallOverrides): Promise; - "getTotalBlocksCommitted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesCommitted()"(overrides?: CallOverrides): Promise; - getTotalBlocksExecuted(overrides?: CallOverrides): Promise; + getTotalBatchesExecuted(overrides?: CallOverrides): Promise; - "getTotalBlocksExecuted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesExecuted()"(overrides?: CallOverrides): Promise; - getTotalBlocksVerified(overrides?: CallOverrides): Promise; + getTotalBatchesVerified(overrides?: CallOverrides): Promise; - "getTotalBlocksVerified()"(overrides?: CallOverrides): Promise; + "getTotalBatchesVerified()"(overrides?: CallOverrides): Promise; getTotalPriorityTxs(overrides?: CallOverrides): Promise; "getTotalPriorityTxs()"(overrides?: CallOverrides): Promise; - getUpgradeProposalState(overrides?: CallOverrides): Promise; - - "getUpgradeProposalState()"(overrides?: CallOverrides): Promise; - getVerifier(overrides?: CallOverrides): Promise; "getVerifier()"(overrides?: CallOverrides): Promise; @@ -1877,26 +1632,18 @@ export class IZkSync extends Contract { 2: string; }>; - getpriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - - "getpriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - - isApprovedBySecurityCouncil(overrides?: CallOverrides): Promise; - - "isApprovedBySecurityCouncil()"(overrides?: CallOverrides): Promise; - isDiamondStorageFrozen(overrides?: CallOverrides): Promise; "isDiamondStorageFrozen()"(overrides?: CallOverrides): Promise; isEthWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isEthWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1926,12 +1673,12 @@ export class IZkSync extends Contract { ): Promise; l2LogsRootHash( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; "l2LogsRootHash(uint256)"( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1971,52 +1718,10 @@ export class IZkSync extends Contract { 2: BigNumber; }>; - proposeShadowUpgrade( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeShadowUpgrade(bytes32,uint40)"( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proposeTransparentUpgrade( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeTransparentUpgrade((tuple[],address,bytes),uint40)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proveBlocks( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + proveBatches( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2024,9 +1729,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2041,10 +1746,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "proveBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2052,9 +1757,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2071,9 +1776,9 @@ export class IZkSync extends Contract { proveL1ToL2TransactionStatus( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -2081,21 +1786,21 @@ export class IZkSync extends Contract { "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)"( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides ): Promise; proveL2LogInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -2105,12 +1810,12 @@ export class IZkSync extends Contract { ): Promise; "proveL2LogInclusion(uint256,uint256,(uint8,bool,uint16,address,bytes32,bytes32),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -2120,10 +1825,10 @@ export class IZkSync extends Contract { ): Promise; proveL2MessageInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -2132,10 +1837,10 @@ export class IZkSync extends Contract { ): Promise; "proveL2MessageInclusion(uint256,uint256,(uint16,address,bytes),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -2144,64 +1849,50 @@ export class IZkSync extends Contract { ): Promise; requestL2Transaction( - _contractL2: string, - _l2Value: BigNumberish, + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)"( - _contractL2: string, - _l2Value: BigNumberish, + "requestL2Transaction((address,uint256,uint256,uint256),bytes,bytes[],address,uint256)"( + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - revertBlocks( - _newLastBlock: BigNumberish, - overrides?: Overrides - ): Promise; - - "revertBlocks(uint256)"( - _newLastBlock: BigNumberish, - overrides?: Overrides - ): Promise; - - securityCouncilUpgradeApprove( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - "securityCouncilUpgradeApprove(bytes32)"( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2BootloaderBytecodeHash( - _l2BootloaderBytecodeHash: BytesLike, + revertBatches( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - "setL2BootloaderBytecodeHash(bytes32)"( - _l2BootloaderBytecodeHash: BytesLike, + "revertBatches(uint256)"( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - setL2DefaultAccountBytecodeHash( - _l2DefaultAccountBytecodeHash: BytesLike, + setPendingAdmin( + _newPendingAdmin: string, overrides?: Overrides ): Promise; - "setL2DefaultAccountBytecodeHash(bytes32)"( - _l2DefaultAccountBytecodeHash: BytesLike, + "setPendingAdmin(address)"( + _newPendingAdmin: string, overrides?: Overrides ): Promise; @@ -2247,41 +1938,13 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - setVerifier( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - "setVerifier(address)"( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - setVerifierParams( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - "setVerifierParams((bytes32,bytes32,bytes32))"( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - storedBlockHash( - _blockNumber: BigNumberish, + storedBatchHash( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; - "storedBlockHash(uint256)"( - _blockNumber: BigNumberish, + "storedBatchHash(uint256)"( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; @@ -2289,57 +1952,23 @@ export class IZkSync extends Contract { "unfreezeDiamond()"(overrides?: Overrides): Promise; - upgradeProposalHash( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; + callStatic: { + acceptAdmin(overrides?: CallOverrides): Promise; - "upgradeProposalHash((tuple[],address,bytes),uint256,bytes32)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; + "acceptAdmin()"(overrides?: CallOverrides): Promise; - callStatic: { acceptGovernor(overrides?: CallOverrides): Promise; "acceptGovernor()"(overrides?: CallOverrides): Promise; - cancelUpgradeProposal( - _proposedUpgradeHash: BytesLike, - overrides?: CallOverrides - ): Promise; + baseTokenAddress(overrides?: CallOverrides): Promise; - "cancelUpgradeProposal(bytes32)"( - _proposedUpgradeHash: BytesLike, - overrides?: CallOverrides - ): Promise; + "baseTokenAddress()"(overrides?: CallOverrides): Promise; - commitBlocks( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + commitBatches( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2347,27 +1976,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: CallOverrides ): Promise; - "commitBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "commitBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2375,27 +2002,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: CallOverrides ): Promise; - executeBlocks( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + executeBatches( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2406,10 +2031,10 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - "executeBlocks(tuple[])"( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "executeBatches(tuple[])"( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2431,11 +2056,10 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: CallOverrides ): Promise; - "executeUpgrade((tuple[],address,bytes),bytes32)"( + "executeUpgrade((tuple[],address,bytes))"( _diamondCut: { facetCuts: { facet: string; @@ -2446,7 +2070,6 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: CallOverrides ): Promise; @@ -2483,18 +2106,18 @@ export class IZkSync extends Contract { ): Promise<{ addr: string; selectors: string[]; 0: string; 1: string[] }[]>; finalizeEthWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: CallOverrides ): Promise; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: CallOverrides @@ -2504,9 +2127,9 @@ export class IZkSync extends Contract { "freezeDiamond()"(overrides?: CallOverrides): Promise; - getCurrentProposalId(overrides?: CallOverrides): Promise; + getAllowList(overrides?: CallOverrides): Promise; - "getCurrentProposalId()"(overrides?: CallOverrides): Promise; + "getAllowList()"(overrides?: CallOverrides): Promise; getFirstUnprocessedPriorityTx( overrides?: CallOverrides @@ -2530,6 +2153,26 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; + getL2SystemContractsUpgradeBatchNumber( + overrides?: CallOverrides + ): Promise; + + "getL2SystemContractsUpgradeBatchNumber()"( + overrides?: CallOverrides + ): Promise; + + getL2SystemContractsUpgradeTxHash( + overrides?: CallOverrides + ): Promise; + + "getL2SystemContractsUpgradeTxHash()"( + overrides?: CallOverrides + ): Promise; + + getName(overrides?: CallOverrides): Promise; + + "getName()"(overrides?: CallOverrides): Promise; + getPendingGovernor(overrides?: CallOverrides): Promise; "getPendingGovernor()"(overrides?: CallOverrides): Promise; @@ -2538,40 +2181,30 @@ export class IZkSync extends Contract { "getPriorityQueueSize()"(overrides?: CallOverrides): Promise; - getProposedUpgradeHash(overrides?: CallOverrides): Promise; - - "getProposedUpgradeHash()"(overrides?: CallOverrides): Promise; - - getProposedUpgradeTimestamp(overrides?: CallOverrides): Promise; + getPriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - "getProposedUpgradeTimestamp()"( - overrides?: CallOverrides - ): Promise; + "getPriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - getSecurityCouncil(overrides?: CallOverrides): Promise; + getProtocolVersion(overrides?: CallOverrides): Promise; - "getSecurityCouncil()"(overrides?: CallOverrides): Promise; + "getProtocolVersion()"(overrides?: CallOverrides): Promise; - getTotalBlocksCommitted(overrides?: CallOverrides): Promise; + getTotalBatchesCommitted(overrides?: CallOverrides): Promise; - "getTotalBlocksCommitted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesCommitted()"(overrides?: CallOverrides): Promise; - getTotalBlocksExecuted(overrides?: CallOverrides): Promise; + getTotalBatchesExecuted(overrides?: CallOverrides): Promise; - "getTotalBlocksExecuted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesExecuted()"(overrides?: CallOverrides): Promise; - getTotalBlocksVerified(overrides?: CallOverrides): Promise; + getTotalBatchesVerified(overrides?: CallOverrides): Promise; - "getTotalBlocksVerified()"(overrides?: CallOverrides): Promise; + "getTotalBatchesVerified()"(overrides?: CallOverrides): Promise; getTotalPriorityTxs(overrides?: CallOverrides): Promise; "getTotalPriorityTxs()"(overrides?: CallOverrides): Promise; - getUpgradeProposalState(overrides?: CallOverrides): Promise; - - "getUpgradeProposalState()"(overrides?: CallOverrides): Promise; - getVerifier(overrides?: CallOverrides): Promise; "getVerifier()"(overrides?: CallOverrides): Promise; @@ -2598,28 +2231,18 @@ export class IZkSync extends Contract { 2: string; }>; - getpriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - - "getpriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - - isApprovedBySecurityCouncil(overrides?: CallOverrides): Promise; - - "isApprovedBySecurityCouncil()"( - overrides?: CallOverrides - ): Promise; - isDiamondStorageFrozen(overrides?: CallOverrides): Promise; "isDiamondStorageFrozen()"(overrides?: CallOverrides): Promise; isEthWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isEthWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; @@ -2652,12 +2275,12 @@ export class IZkSync extends Contract { ): Promise; l2LogsRootHash( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; "l2LogsRootHash(uint256)"( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; @@ -2697,52 +2320,10 @@ export class IZkSync extends Contract { 2: BigNumber; }>; - proposeShadowUpgrade( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "proposeShadowUpgrade(bytes32,uint40)"( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: CallOverrides - ): Promise; - - proposeTransparentUpgrade( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "proposeTransparentUpgrade((tuple[],address,bytes),uint40)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: CallOverrides - ): Promise; - - proveBlocks( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + proveBatches( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2750,9 +2331,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2767,10 +2348,10 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - "proveBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2778,9 +2359,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -2797,9 +2378,9 @@ export class IZkSync extends Contract { proveL1ToL2TransactionStatus( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -2807,21 +2388,21 @@ export class IZkSync extends Contract { "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)"( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides ): Promise; proveL2LogInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -2831,12 +2412,12 @@ export class IZkSync extends Contract { ): Promise; "proveL2LogInclusion(uint256,uint256,(uint8,bool,uint16,address,bytes32,bytes32),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -2846,10 +2427,10 @@ export class IZkSync extends Contract { ): Promise; proveL2MessageInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -2858,10 +2439,10 @@ export class IZkSync extends Contract { ): Promise; "proveL2MessageInclusion(uint256,uint256,(uint16,address,bytes),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -2870,64 +2451,50 @@ export class IZkSync extends Contract { ): Promise; requestL2Transaction( - _contractL2: string, - _l2Value: BigNumberish, + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: CallOverrides ): Promise; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)"( - _contractL2: string, - _l2Value: BigNumberish, + "requestL2Transaction((address,uint256,uint256,uint256),bytes,bytes[],address,uint256)"( + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: CallOverrides ): Promise; - revertBlocks( - _newLastBlock: BigNumberish, - overrides?: CallOverrides - ): Promise; - - "revertBlocks(uint256)"( - _newLastBlock: BigNumberish, - overrides?: CallOverrides - ): Promise; - - securityCouncilUpgradeApprove( - _upgradeProposalHash: BytesLike, - overrides?: CallOverrides - ): Promise; - - "securityCouncilUpgradeApprove(bytes32)"( - _upgradeProposalHash: BytesLike, - overrides?: CallOverrides - ): Promise; - - setL2BootloaderBytecodeHash( - _l2BootloaderBytecodeHash: BytesLike, + revertBatches( + _newLastBatch: BigNumberish, overrides?: CallOverrides ): Promise; - "setL2BootloaderBytecodeHash(bytes32)"( - _l2BootloaderBytecodeHash: BytesLike, + "revertBatches(uint256)"( + _newLastBatch: BigNumberish, overrides?: CallOverrides ): Promise; - setL2DefaultAccountBytecodeHash( - _l2DefaultAccountBytecodeHash: BytesLike, + setPendingAdmin( + _newPendingAdmin: string, overrides?: CallOverrides ): Promise; - "setL2DefaultAccountBytecodeHash(bytes32)"( - _l2DefaultAccountBytecodeHash: BytesLike, + "setPendingAdmin(address)"( + _newPendingAdmin: string, overrides?: CallOverrides ): Promise; @@ -2973,132 +2540,63 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - setVerifier(_newVerifier: string, overrides?: CallOverrides): Promise; - - "setVerifier(address)"( - _newVerifier: string, - overrides?: CallOverrides - ): Promise; - - setVerifierParams( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: CallOverrides - ): Promise; - - "setVerifierParams((bytes32,bytes32,bytes32))"( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: CallOverrides - ): Promise; - - storedBlockHash( - _blockNumber: BigNumberish, + storedBatchHash( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; - "storedBlockHash(uint256)"( - _blockNumber: BigNumberish, + "storedBatchHash(uint256)"( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; unfreezeDiamond(overrides?: CallOverrides): Promise; "unfreezeDiamond()"(overrides?: CallOverrides): Promise; - - upgradeProposalHash( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; - - "upgradeProposalHash((tuple[],address,bytes),uint256,bytes32)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; }; filters: { BlockCommit( - blockNumber: BigNumberish | null, - blockHash: BytesLike | null, + batchNumber: BigNumberish | null, + batchHash: BytesLike | null, commitment: BytesLike | null ): EventFilter; BlockExecution( - blockNumber: BigNumberish | null, - blockHash: BytesLike | null, + batchNumber: BigNumberish | null, + batchHash: BytesLike | null, commitment: BytesLike | null ): EventFilter; BlocksRevert( - totalBlocksCommitted: null, - totalBlocksVerified: null, - totalBlocksExecuted: null + totalBatchesCommitted: null, + totalBatchesVerified: null, + totalBatchesExecuted: null ): EventFilter; BlocksVerification( - previousLastVerifiedBlock: BigNumberish | null, - currentLastVerifiedBlock: BigNumberish | null - ): EventFilter; - - CancelUpgradeProposal( - proposalId: BigNumberish | null, - proposalHash: BytesLike | null + previousLastVerifiedBatch: BigNumberish | null, + currentLastVerifiedBatch: BigNumberish | null ): EventFilter; EthWithdrawalFinalized(to: string | null, amount: null): EventFilter; - ExecuteUpgrade( - proposalId: BigNumberish | null, - proposalHash: BytesLike | null, - proposalSalt: null - ): EventFilter; + ExecuteUpgrade(diamondCut: null): EventFilter; Freeze(): EventFilter; IsPorterAvailableStatusUpdate(isPorterAvailable: null): EventFilter; + NewAdmin(oldAdmin: string | null, newAdmin: string | null): EventFilter; + NewGovernor( oldGovernor: string | null, newGovernor: string | null ): EventFilter; - NewL2BootloaderBytecodeHash( - previousBytecodeHash: BytesLike | null, - newBytecodeHash: BytesLike | null - ): EventFilter; - - NewL2DefaultAccountBytecodeHash( - previousBytecodeHash: BytesLike | null, - newBytecodeHash: BytesLike | null + NewPendingAdmin( + oldPendingAdmin: string | null, + newPendingAdmin: string | null ): EventFilter; NewPendingGovernor( @@ -3119,32 +2617,6 @@ export class IZkSync extends Contract { newPriorityTxMaxGasLimit: null ): EventFilter; - NewVerifier( - oldVerifier: string | null, - newVerifier: string | null - ): EventFilter; - - NewVerifierParams( - oldVerifierParams: null, - newVerifierParams: null - ): EventFilter; - - ProposeShadowUpgrade( - proposalId: BigNumberish | null, - proposalHash: BytesLike | null - ): EventFilter; - - ProposeTransparentUpgrade( - diamondCut: null, - proposalId: BigNumberish | null, - proposalSalt: null - ): EventFilter; - - SecurityCouncilUpgradeApprove( - proposalId: BigNumberish | null, - proposalHash: BytesLike | null - ): EventFilter; - Unfreeze(): EventFilter; ValidatorStatusUpdate( @@ -3154,24 +2626,22 @@ export class IZkSync extends Contract { }; estimateGas: { + acceptAdmin(overrides?: Overrides): Promise; + + "acceptAdmin()"(overrides?: Overrides): Promise; + acceptGovernor(overrides?: Overrides): Promise; "acceptGovernor()"(overrides?: Overrides): Promise; - cancelUpgradeProposal( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + baseTokenAddress(overrides?: CallOverrides): Promise; - "cancelUpgradeProposal(bytes32)"( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + "baseTokenAddress()"(overrides?: CallOverrides): Promise; - commitBlocks( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + commitBatches( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3179,27 +2649,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - "commitBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "commitBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3207,27 +2675,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - executeBlocks( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + executeBatches( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3238,10 +2704,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "executeBlocks(tuple[])"( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "executeBatches(tuple[])"( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3263,11 +2729,10 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; - "executeUpgrade((tuple[],address,bytes),bytes32)"( + "executeUpgrade((tuple[],address,bytes))"( _diamondCut: { facetCuts: { facet: string; @@ -3278,7 +2743,6 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; @@ -3311,18 +2775,18 @@ export class IZkSync extends Contract { "facets()"(overrides?: CallOverrides): Promise; finalizeEthWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides @@ -3332,9 +2796,9 @@ export class IZkSync extends Contract { "freezeDiamond()"(overrides?: Overrides): Promise; - getCurrentProposalId(overrides?: CallOverrides): Promise; + getAllowList(overrides?: CallOverrides): Promise; - "getCurrentProposalId()"(overrides?: CallOverrides): Promise; + "getAllowList()"(overrides?: CallOverrides): Promise; getFirstUnprocessedPriorityTx( overrides?: CallOverrides @@ -3362,6 +2826,26 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; + getL2SystemContractsUpgradeBatchNumber( + overrides?: CallOverrides + ): Promise; + + "getL2SystemContractsUpgradeBatchNumber()"( + overrides?: CallOverrides + ): Promise; + + getL2SystemContractsUpgradeTxHash( + overrides?: CallOverrides + ): Promise; + + "getL2SystemContractsUpgradeTxHash()"( + overrides?: CallOverrides + ): Promise; + + getName(overrides?: CallOverrides): Promise; + + "getName()"(overrides?: CallOverrides): Promise; + getPendingGovernor(overrides?: CallOverrides): Promise; "getPendingGovernor()"(overrides?: CallOverrides): Promise; @@ -3370,40 +2854,30 @@ export class IZkSync extends Contract { "getPriorityQueueSize()"(overrides?: CallOverrides): Promise; - getProposedUpgradeHash(overrides?: CallOverrides): Promise; - - "getProposedUpgradeHash()"(overrides?: CallOverrides): Promise; + getPriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - getProposedUpgradeTimestamp(overrides?: CallOverrides): Promise; + "getPriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - "getProposedUpgradeTimestamp()"( - overrides?: CallOverrides - ): Promise; - - getSecurityCouncil(overrides?: CallOverrides): Promise; + getProtocolVersion(overrides?: CallOverrides): Promise; - "getSecurityCouncil()"(overrides?: CallOverrides): Promise; + "getProtocolVersion()"(overrides?: CallOverrides): Promise; - getTotalBlocksCommitted(overrides?: CallOverrides): Promise; + getTotalBatchesCommitted(overrides?: CallOverrides): Promise; - "getTotalBlocksCommitted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesCommitted()"(overrides?: CallOverrides): Promise; - getTotalBlocksExecuted(overrides?: CallOverrides): Promise; + getTotalBatchesExecuted(overrides?: CallOverrides): Promise; - "getTotalBlocksExecuted()"(overrides?: CallOverrides): Promise; + "getTotalBatchesExecuted()"(overrides?: CallOverrides): Promise; - getTotalBlocksVerified(overrides?: CallOverrides): Promise; + getTotalBatchesVerified(overrides?: CallOverrides): Promise; - "getTotalBlocksVerified()"(overrides?: CallOverrides): Promise; + "getTotalBatchesVerified()"(overrides?: CallOverrides): Promise; getTotalPriorityTxs(overrides?: CallOverrides): Promise; "getTotalPriorityTxs()"(overrides?: CallOverrides): Promise; - getUpgradeProposalState(overrides?: CallOverrides): Promise; - - "getUpgradeProposalState()"(overrides?: CallOverrides): Promise; - getVerifier(overrides?: CallOverrides): Promise; "getVerifier()"(overrides?: CallOverrides): Promise; @@ -3412,28 +2886,18 @@ export class IZkSync extends Contract { "getVerifierParams()"(overrides?: CallOverrides): Promise; - getpriorityTxMaxGasLimit(overrides?: CallOverrides): Promise; - - "getpriorityTxMaxGasLimit()"(overrides?: CallOverrides): Promise; - - isApprovedBySecurityCouncil(overrides?: CallOverrides): Promise; - - "isApprovedBySecurityCouncil()"( - overrides?: CallOverrides - ): Promise; - isDiamondStorageFrozen(overrides?: CallOverrides): Promise; "isDiamondStorageFrozen()"(overrides?: CallOverrides): Promise; isEthWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isEthWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; @@ -3469,12 +2933,12 @@ export class IZkSync extends Contract { ): Promise; l2LogsRootHash( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; "l2LogsRootHash(uint256)"( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; @@ -3498,52 +2962,10 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - proposeShadowUpgrade( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeShadowUpgrade(bytes32,uint40)"( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proposeTransparentUpgrade( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeTransparentUpgrade((tuple[],address,bytes),uint40)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proveBlocks( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + proveBatches( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3551,9 +2973,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3568,10 +2990,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "proveBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3579,9 +3001,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3598,9 +3020,9 @@ export class IZkSync extends Contract { proveL1ToL2TransactionStatus( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -3608,21 +3030,21 @@ export class IZkSync extends Contract { "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)"( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides ): Promise; proveL2LogInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -3632,12 +3054,12 @@ export class IZkSync extends Contract { ): Promise; "proveL2LogInclusion(uint256,uint256,(uint8,bool,uint16,address,bytes32,bytes32),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -3647,10 +3069,10 @@ export class IZkSync extends Contract { ): Promise; proveL2MessageInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -3659,10 +3081,10 @@ export class IZkSync extends Contract { ): Promise; "proveL2MessageInclusion(uint256,uint256,(uint16,address,bytes),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -3671,64 +3093,50 @@ export class IZkSync extends Contract { ): Promise; requestL2Transaction( - _contractL2: string, - _l2Value: BigNumberish, + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)"( - _contractL2: string, - _l2Value: BigNumberish, + "requestL2Transaction((address,uint256,uint256,uint256),bytes,bytes[],address,uint256)"( + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - revertBlocks( - _newLastBlock: BigNumberish, + revertBatches( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - "revertBlocks(uint256)"( - _newLastBlock: BigNumberish, + "revertBatches(uint256)"( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - securityCouncilUpgradeApprove( - _upgradeProposalHash: BytesLike, + setPendingAdmin( + _newPendingAdmin: string, overrides?: Overrides ): Promise; - "securityCouncilUpgradeApprove(bytes32)"( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2BootloaderBytecodeHash( - _l2BootloaderBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - "setL2BootloaderBytecodeHash(bytes32)"( - _l2BootloaderBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2DefaultAccountBytecodeHash( - _l2DefaultAccountBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - "setL2DefaultAccountBytecodeHash(bytes32)"( - _l2DefaultAccountBytecodeHash: BytesLike, + "setPendingAdmin(address)"( + _newPendingAdmin: string, overrides?: Overrides ): Promise; @@ -3774,100 +3182,40 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - setVerifier( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - "setVerifier(address)"( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - setVerifierParams( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - "setVerifierParams((bytes32,bytes32,bytes32))"( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - storedBlockHash( - _blockNumber: BigNumberish, + storedBatchHash( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; - "storedBlockHash(uint256)"( - _blockNumber: BigNumberish, + "storedBatchHash(uint256)"( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; unfreezeDiamond(overrides?: Overrides): Promise; "unfreezeDiamond()"(overrides?: Overrides): Promise; - - upgradeProposalHash( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; - - "upgradeProposalHash((tuple[],address,bytes),uint256,bytes32)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; }; populateTransaction: { + acceptAdmin(overrides?: Overrides): Promise; + + "acceptAdmin()"(overrides?: Overrides): Promise; + acceptGovernor(overrides?: Overrides): Promise; "acceptGovernor()"(overrides?: Overrides): Promise; - cancelUpgradeProposal( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides - ): Promise; + baseTokenAddress(overrides?: CallOverrides): Promise; - "cancelUpgradeProposal(bytes32)"( - _proposedUpgradeHash: BytesLike, - overrides?: Overrides + "baseTokenAddress()"( + overrides?: CallOverrides ): Promise; - commitBlocks( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + commitBatches( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3875,27 +3223,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - "commitBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( - _lastCommittedBlockData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "commitBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[])"( + _lastCommittedBatchData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3903,27 +3249,25 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _newBlocksData: { - blockNumber: BigNumberish; + _newBatchesData: { + batchNumber: BigNumberish; timestamp: BigNumberish; indexRepeatedStorageChanges: BigNumberish; newStateRoot: BytesLike; numberOfLayer1Txs: BigNumberish; - l2LogsTreeRoot: BytesLike; priorityOperationsHash: BytesLike; - initialStorageChanges: BytesLike; - repeatedStorageChanges: BytesLike; - l2Logs: BytesLike; - l2ArbitraryLengthMessages: BytesLike[]; - factoryDeps: BytesLike[]; + bootloaderHeapInitialContentsHash: BytesLike; + eventsQueueStateHash: BytesLike; + systemLogs: BytesLike; + totalL2ToL1Pubdata: BytesLike; }[], overrides?: Overrides ): Promise; - executeBlocks( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + executeBatches( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3934,10 +3278,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "executeBlocks(tuple[])"( - _blocksData: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "executeBatches(tuple[])"( + _batchesData: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -3959,11 +3303,10 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; - "executeUpgrade((tuple[],address,bytes),bytes32)"( + "executeUpgrade((tuple[],address,bytes))"( _diamondCut: { facetCuts: { facet: string; @@ -3974,7 +3317,6 @@ export class IZkSync extends Contract { initAddress: string; initCalldata: BytesLike; }, - _proposalSalt: BytesLike, overrides?: Overrides ): Promise; @@ -4009,18 +3351,18 @@ export class IZkSync extends Contract { "facets()"(overrides?: CallOverrides): Promise; finalizeEthWithdrawal( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides ): Promise; "finalizeEthWithdrawal(uint256,uint256,uint16,bytes,bytes32[])"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _message: BytesLike, _merkleProof: BytesLike[], overrides?: Overrides @@ -4030,13 +3372,9 @@ export class IZkSync extends Contract { "freezeDiamond()"(overrides?: Overrides): Promise; - getCurrentProposalId( - overrides?: CallOverrides - ): Promise; + getAllowList(overrides?: CallOverrides): Promise; - "getCurrentProposalId()"( - overrides?: CallOverrides - ): Promise; + "getAllowList()"(overrides?: CallOverrides): Promise; getFirstUnprocessedPriorityTx( overrides?: CallOverrides @@ -4066,83 +3404,87 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - getPendingGovernor( + getL2SystemContractsUpgradeBatchNumber( overrides?: CallOverrides ): Promise; - "getPendingGovernor()"( + "getL2SystemContractsUpgradeBatchNumber()"( overrides?: CallOverrides ): Promise; - getPriorityQueueSize( + getL2SystemContractsUpgradeTxHash( overrides?: CallOverrides ): Promise; - "getPriorityQueueSize()"( + "getL2SystemContractsUpgradeTxHash()"( overrides?: CallOverrides ): Promise; - getProposedUpgradeHash( + getName(overrides?: CallOverrides): Promise; + + "getName()"(overrides?: CallOverrides): Promise; + + getPendingGovernor( overrides?: CallOverrides ): Promise; - "getProposedUpgradeHash()"( + "getPendingGovernor()"( overrides?: CallOverrides ): Promise; - getProposedUpgradeTimestamp( + getPriorityQueueSize( overrides?: CallOverrides ): Promise; - "getProposedUpgradeTimestamp()"( + "getPriorityQueueSize()"( overrides?: CallOverrides ): Promise; - getSecurityCouncil( + getPriorityTxMaxGasLimit( overrides?: CallOverrides ): Promise; - "getSecurityCouncil()"( + "getPriorityTxMaxGasLimit()"( overrides?: CallOverrides ): Promise; - getTotalBlocksCommitted( + getProtocolVersion( overrides?: CallOverrides ): Promise; - "getTotalBlocksCommitted()"( + "getProtocolVersion()"( overrides?: CallOverrides ): Promise; - getTotalBlocksExecuted( + getTotalBatchesCommitted( overrides?: CallOverrides ): Promise; - "getTotalBlocksExecuted()"( + "getTotalBatchesCommitted()"( overrides?: CallOverrides ): Promise; - getTotalBlocksVerified( + getTotalBatchesExecuted( overrides?: CallOverrides ): Promise; - "getTotalBlocksVerified()"( + "getTotalBatchesExecuted()"( overrides?: CallOverrides ): Promise; - getTotalPriorityTxs( + getTotalBatchesVerified( overrides?: CallOverrides ): Promise; - "getTotalPriorityTxs()"( + "getTotalBatchesVerified()"( overrides?: CallOverrides ): Promise; - getUpgradeProposalState( + getTotalPriorityTxs( overrides?: CallOverrides ): Promise; - "getUpgradeProposalState()"( + "getTotalPriorityTxs()"( overrides?: CallOverrides ): Promise; @@ -4156,22 +3498,6 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - getpriorityTxMaxGasLimit( - overrides?: CallOverrides - ): Promise; - - "getpriorityTxMaxGasLimit()"( - overrides?: CallOverrides - ): Promise; - - isApprovedBySecurityCouncil( - overrides?: CallOverrides - ): Promise; - - "isApprovedBySecurityCouncil()"( - overrides?: CallOverrides - ): Promise; - isDiamondStorageFrozen( overrides?: CallOverrides ): Promise; @@ -4181,13 +3507,13 @@ export class IZkSync extends Contract { ): Promise; isEthWithdrawalFinalized( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; "isEthWithdrawalFinalized(uint256,uint256)"( - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, overrides?: CallOverrides ): Promise; @@ -4223,12 +3549,12 @@ export class IZkSync extends Contract { ): Promise; l2LogsRootHash( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; "l2LogsRootHash(uint256)"( - _blockNumber: BigNumberish, + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; @@ -4254,52 +3580,10 @@ export class IZkSync extends Contract { overrides?: CallOverrides ): Promise; - proposeShadowUpgrade( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeShadowUpgrade(bytes32,uint40)"( - _proposalHash: BytesLike, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proposeTransparentUpgrade( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - "proposeTransparentUpgrade((tuple[],address,bytes),uint40)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - overrides?: Overrides - ): Promise; - - proveBlocks( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + proveBatches( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -4307,9 +3591,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -4324,10 +3608,10 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - "proveBlocks((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( - _prevBlock: { - blockNumber: BigNumberish; - blockHash: BytesLike; + "proveBatches((uint64,bytes32,uint64,uint256,bytes32,bytes32,uint256,bytes32),tuple[],(uint256[],uint256[]))"( + _prevBatch: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -4335,9 +3619,9 @@ export class IZkSync extends Contract { timestamp: BigNumberish; commitment: BytesLike; }, - _committedBlocks: { - blockNumber: BigNumberish; - blockHash: BytesLike; + _committedBatches: { + batchNumber: BigNumberish; + batchHash: BytesLike; indexRepeatedStorageChanges: BigNumberish; numberOfLayer1Txs: BigNumberish; priorityOperationsHash: BytesLike; @@ -4354,9 +3638,9 @@ export class IZkSync extends Contract { proveL1ToL2TransactionStatus( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides @@ -4364,21 +3648,21 @@ export class IZkSync extends Contract { "proveL1ToL2TransactionStatus(bytes32,uint256,uint256,uint16,bytes32[],uint8)"( _l2TxHash: BytesLike, - _l2BlockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _l2MessageIndex: BigNumberish, - _l2TxNumberInBlock: BigNumberish, + _l2TxNumberInBatch: BigNumberish, _merkleProof: BytesLike[], _status: BigNumberish, overrides?: CallOverrides ): Promise; proveL2LogInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -4388,12 +3672,12 @@ export class IZkSync extends Contract { ): Promise; "proveL2LogInclusion(uint256,uint256,(uint8,bool,uint16,address,bytes32,bytes32),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _log: { l2ShardId: BigNumberish; isService: boolean; - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; key: BytesLike; value: BytesLike; @@ -4403,10 +3687,10 @@ export class IZkSync extends Contract { ): Promise; proveL2MessageInclusion( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -4415,10 +3699,10 @@ export class IZkSync extends Contract { ): Promise; "proveL2MessageInclusion(uint256,uint256,(uint16,address,bytes),bytes32[])"( - _blockNumber: BigNumberish, + _l2BatchNumber: BigNumberish, _index: BigNumberish, _message: { - txNumberInBlock: BigNumberish; + txNumberInBatch: BigNumberish; sender: string; data: BytesLike; }, @@ -4427,64 +3711,50 @@ export class IZkSync extends Contract { ): Promise; requestL2Transaction( - _contractL2: string, - _l2Value: BigNumberish, + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - "requestL2Transaction(address,uint256,bytes,uint256,uint256,bytes[],address)"( - _contractL2: string, - _l2Value: BigNumberish, + "requestL2Transaction((address,uint256,uint256,uint256),bytes,bytes[],address,uint256)"( + _l2tx: { + l2Contract: string; + l2Value: BigNumberish; + l2GasLimit: BigNumberish; + l2GasPerPubdataByteLimit: BigNumberish; + }, _calldata: BytesLike, - _l2GasLimit: BigNumberish, - _l2GasPerPubdataByteLimit: BigNumberish, _factoryDeps: BytesLike[], _refundRecipient: string, + _baseAmount: BigNumberish, overrides?: PayableOverrides ): Promise; - revertBlocks( - _newLastBlock: BigNumberish, + revertBatches( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - "revertBlocks(uint256)"( - _newLastBlock: BigNumberish, + "revertBatches(uint256)"( + _newLastBatch: BigNumberish, overrides?: Overrides ): Promise; - securityCouncilUpgradeApprove( - _upgradeProposalHash: BytesLike, + setPendingAdmin( + _newPendingAdmin: string, overrides?: Overrides ): Promise; - "securityCouncilUpgradeApprove(bytes32)"( - _upgradeProposalHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2BootloaderBytecodeHash( - _l2BootloaderBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - "setL2BootloaderBytecodeHash(bytes32)"( - _l2BootloaderBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - setL2DefaultAccountBytecodeHash( - _l2DefaultAccountBytecodeHash: BytesLike, - overrides?: Overrides - ): Promise; - - "setL2DefaultAccountBytecodeHash(bytes32)"( - _l2DefaultAccountBytecodeHash: BytesLike, + "setPendingAdmin(address)"( + _newPendingAdmin: string, overrides?: Overrides ): Promise; @@ -4530,78 +3800,18 @@ export class IZkSync extends Contract { overrides?: Overrides ): Promise; - setVerifier( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - "setVerifier(address)"( - _newVerifier: string, - overrides?: Overrides - ): Promise; - - setVerifierParams( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - "setVerifierParams((bytes32,bytes32,bytes32))"( - _newVerifierParams: { - recursionNodeLevelVkHash: BytesLike; - recursionLeafLevelVkHash: BytesLike; - recursionCircuitsSetVksHash: BytesLike; - }, - overrides?: Overrides - ): Promise; - - storedBlockHash( - _blockNumber: BigNumberish, + storedBatchHash( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; - "storedBlockHash(uint256)"( - _blockNumber: BigNumberish, + "storedBatchHash(uint256)"( + _batchNumber: BigNumberish, overrides?: CallOverrides ): Promise; unfreezeDiamond(overrides?: Overrides): Promise; "unfreezeDiamond()"(overrides?: Overrides): Promise; - - upgradeProposalHash( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; - - "upgradeProposalHash((tuple[],address,bytes),uint256,bytes32)"( - _diamondCut: { - facetCuts: { - facet: string; - action: BigNumberish; - isFreezable: boolean; - selectors: BytesLike[]; - }[]; - initAddress: string; - initCalldata: BytesLike; - }, - _proposalId: BigNumberish, - _salt: BytesLike, - overrides?: CallOverrides - ): Promise; }; } diff --git a/typechain/IZkSyncFactory.ts b/typechain/IZkSyncFactory.ts index 7fdf22e..6404002 100644 --- a/typechain/IZkSyncFactory.ts +++ b/typechain/IZkSyncFactory.ts @@ -23,13 +23,13 @@ const _abi = [ { indexed: true, internalType: "uint256", - name: "blockNumber", + name: "batchNumber", type: "uint256", }, { indexed: true, internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -48,13 +48,13 @@ const _abi = [ { indexed: true, internalType: "uint256", - name: "blockNumber", + name: "batchNumber", type: "uint256", }, { indexed: true, internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -73,19 +73,19 @@ const _abi = [ { indexed: false, internalType: "uint256", - name: "totalBlocksCommitted", + name: "totalBatchesCommitted", type: "uint256", }, { indexed: false, internalType: "uint256", - name: "totalBlocksVerified", + name: "totalBatchesVerified", type: "uint256", }, { indexed: false, internalType: "uint256", - name: "totalBlocksExecuted", + name: "totalBatchesExecuted", type: "uint256", }, ], @@ -98,38 +98,19 @@ const _abi = [ { indexed: true, internalType: "uint256", - name: "previousLastVerifiedBlock", + name: "previousLastVerifiedBatch", type: "uint256", }, { indexed: true, internalType: "uint256", - name: "currentLastVerifiedBlock", + name: "currentLastVerifiedBatch", type: "uint256", }, ], name: "BlocksVerification", type: "event", }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "proposalId", - type: "uint256", - }, - { - indexed: true, - internalType: "bytes32", - name: "proposalHash", - type: "bytes32", - }, - ], - name: "CancelUpgradeProposal", - type: "event", - }, { anonymous: false, inputs: [ @@ -153,22 +134,49 @@ const _abi = [ anonymous: false, inputs: [ { - indexed: true, - internalType: "uint256", - name: "proposalId", - type: "uint256", - }, - { - indexed: true, - internalType: "bytes32", - name: "proposalHash", - type: "bytes32", - }, - { + 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: "bytes32", - name: "proposalSalt", - type: "bytes32", + internalType: "struct Diamond.DiamondCutData", + name: "diamondCut", + type: "tuple", }, ], name: "ExecuteUpgrade", @@ -199,17 +207,17 @@ const _abi = [ { indexed: true, internalType: "address", - name: "oldGovernor", + name: "oldAdmin", type: "address", }, { indexed: true, internalType: "address", - name: "newGovernor", + name: "newAdmin", type: "address", }, ], - name: "NewGovernor", + name: "NewAdmin", type: "event", }, { @@ -217,18 +225,18 @@ const _abi = [ inputs: [ { indexed: true, - internalType: "bytes32", - name: "previousBytecodeHash", - type: "bytes32", + internalType: "address", + name: "oldGovernor", + type: "address", }, { indexed: true, - internalType: "bytes32", - name: "newBytecodeHash", - type: "bytes32", + internalType: "address", + name: "newGovernor", + type: "address", }, ], - name: "NewL2BootloaderBytecodeHash", + name: "NewGovernor", type: "event", }, { @@ -236,18 +244,18 @@ const _abi = [ inputs: [ { indexed: true, - internalType: "bytes32", - name: "previousBytecodeHash", - type: "bytes32", + internalType: "address", + name: "oldPendingAdmin", + type: "address", }, { indexed: true, - internalType: "bytes32", - name: "newBytecodeHash", - type: "bytes32", + internalType: "address", + name: "newPendingAdmin", + type: "address", }, ], - name: "NewL2DefaultAccountBytecodeHash", + name: "NewPendingAdmin", type: "event", }, { @@ -407,180 +415,6 @@ const _abi = [ name: "NewPriorityTxMaxGasLimit", type: "event", }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "oldVerifier", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newVerifier", - type: "address", - }, - ], - name: "NewVerifier", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - components: [ - { - internalType: "bytes32", - name: "recursionNodeLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionLeafLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionCircuitsSetVksHash", - type: "bytes32", - }, - ], - indexed: false, - internalType: "struct VerifierParams", - name: "oldVerifierParams", - type: "tuple", - }, - { - components: [ - { - internalType: "bytes32", - name: "recursionNodeLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionLeafLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionCircuitsSetVksHash", - type: "bytes32", - }, - ], - indexed: false, - internalType: "struct VerifierParams", - name: "newVerifierParams", - type: "tuple", - }, - ], - name: "NewVerifierParams", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - 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: "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: [], @@ -606,6 +440,13 @@ const _abi = [ name: "ValidatorStatusUpdate", type: "event", }, + { + inputs: [], + name: "acceptAdmin", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [], name: "acceptGovernor", @@ -614,16 +455,16 @@ const _abi = [ type: "function", }, { - inputs: [ + inputs: [], + name: "baseTokenAddress", + outputs: [ { - internalType: "bytes32", - name: "_proposedUpgradeHash", - type: "bytes32", + internalType: "address", + name: "", + type: "address", }, ], - name: "cancelUpgradeProposal", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { @@ -632,12 +473,12 @@ const _abi = [ components: [ { internalType: "uint64", - name: "blockNumber", + name: "batchNumber", type: "uint64", }, { internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -671,15 +512,15 @@ const _abi = [ type: "bytes32", }, ], - internalType: "struct IExecutor.StoredBlockInfo", - name: "_lastCommittedBlockData", + internalType: "struct IExecutor.StoredBatchInfo", + name: "_lastCommittedBatchData", type: "tuple", }, { components: [ { internalType: "uint64", - name: "blockNumber", + name: "batchNumber", type: "uint64", }, { @@ -704,46 +545,36 @@ const _abi = [ }, { internalType: "bytes32", - name: "l2LogsTreeRoot", + name: "priorityOperationsHash", type: "bytes32", }, { internalType: "bytes32", - name: "priorityOperationsHash", + name: "bootloaderHeapInitialContentsHash", type: "bytes32", }, { - internalType: "bytes", - name: "initialStorageChanges", - type: "bytes", + internalType: "bytes32", + name: "eventsQueueStateHash", + type: "bytes32", }, { internalType: "bytes", - name: "repeatedStorageChanges", + name: "systemLogs", type: "bytes", }, { internalType: "bytes", - name: "l2Logs", + name: "totalL2ToL1Pubdata", type: "bytes", }, - { - internalType: "bytes[]", - name: "l2ArbitraryLengthMessages", - type: "bytes[]", - }, - { - internalType: "bytes[]", - name: "factoryDeps", - type: "bytes[]", - }, ], - internalType: "struct IExecutor.CommitBlockInfo[]", - name: "_newBlocksData", + internalType: "struct IExecutor.CommitBatchInfo[]", + name: "_newBatchesData", type: "tuple[]", }, ], - name: "commitBlocks", + name: "commitBatches", outputs: [], stateMutability: "nonpayable", type: "function", @@ -754,12 +585,12 @@ const _abi = [ components: [ { internalType: "uint64", - name: "blockNumber", + name: "batchNumber", type: "uint64", }, { internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -793,12 +624,12 @@ const _abi = [ type: "bytes32", }, ], - internalType: "struct IExecutor.StoredBlockInfo[]", - name: "_blocksData", + internalType: "struct IExecutor.StoredBatchInfo[]", + name: "_batchesData", type: "tuple[]", }, ], - name: "executeBlocks", + name: "executeBatches", outputs: [], stateMutability: "nonpayable", type: "function", @@ -849,11 +680,6 @@ const _abi = [ name: "_diamondCut", type: "tuple", }, - { - internalType: "bytes32", - name: "_proposalSalt", - type: "bytes32", - }, ], name: "executeUpgrade", outputs: [], @@ -940,7 +766,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -950,7 +776,7 @@ const _abi = [ }, { internalType: "uint16", - name: "_l2TxNumberInBlock", + name: "_l2TxNumberInBatch", type: "uint16", }, { @@ -978,12 +804,12 @@ const _abi = [ }, { inputs: [], - name: "getCurrentProposalId", + name: "getAllowList", outputs: [ { - internalType: "uint256", + internalType: "address", name: "", - type: "uint256", + type: "address", }, ], stateMutability: "view", @@ -1043,20 +869,7 @@ const _abi = [ }, { inputs: [], - name: "getPendingGovernor", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getPriorityQueueSize", + name: "getL2SystemContractsUpgradeBatchNumber", outputs: [ { internalType: "uint256", @@ -1069,7 +882,7 @@ const _abi = [ }, { inputs: [], - name: "getProposedUpgradeHash", + name: "getL2SystemContractsUpgradeTxHash", outputs: [ { internalType: "bytes32", @@ -1082,12 +895,12 @@ const _abi = [ }, { inputs: [], - name: "getProposedUpgradeTimestamp", + name: "getName", outputs: [ { - internalType: "uint256", + internalType: "string", name: "", - type: "uint256", + type: "string", }, ], stateMutability: "view", @@ -1095,7 +908,7 @@ const _abi = [ }, { inputs: [], - name: "getSecurityCouncil", + name: "getPendingGovernor", outputs: [ { internalType: "address", @@ -1108,7 +921,7 @@ const _abi = [ }, { inputs: [], - name: "getTotalBlocksCommitted", + name: "getPriorityQueueSize", outputs: [ { internalType: "uint256", @@ -1121,7 +934,7 @@ const _abi = [ }, { inputs: [], - name: "getTotalBlocksExecuted", + name: "getPriorityTxMaxGasLimit", outputs: [ { internalType: "uint256", @@ -1134,7 +947,7 @@ const _abi = [ }, { inputs: [], - name: "getTotalBlocksVerified", + name: "getProtocolVersion", outputs: [ { internalType: "uint256", @@ -1147,7 +960,7 @@ const _abi = [ }, { inputs: [], - name: "getTotalPriorityTxs", + name: "getTotalBatchesCommitted", outputs: [ { internalType: "uint256", @@ -1160,12 +973,12 @@ const _abi = [ }, { inputs: [], - name: "getUpgradeProposalState", + name: "getTotalBatchesExecuted", outputs: [ { - internalType: "enum UpgradeState", + internalType: "uint256", name: "", - type: "uint8", + type: "uint256", }, ], stateMutability: "view", @@ -1173,12 +986,12 @@ const _abi = [ }, { inputs: [], - name: "getVerifier", + name: "getTotalBatchesVerified", outputs: [ { - internalType: "address", + internalType: "uint256", name: "", - type: "address", + type: "uint256", }, ], stateMutability: "view", @@ -1186,29 +999,12 @@ const _abi = [ }, { inputs: [], - name: "getVerifierParams", + name: "getTotalPriorityTxs", outputs: [ { - components: [ - { - internalType: "bytes32", - name: "recursionNodeLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionLeafLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionCircuitsSetVksHash", - type: "bytes32", - }, - ], - internalType: "struct VerifierParams", + internalType: "uint256", name: "", - type: "tuple", + type: "uint256", }, ], stateMutability: "view", @@ -1216,12 +1012,12 @@ const _abi = [ }, { inputs: [], - name: "getpriorityTxMaxGasLimit", + name: "getVerifier", outputs: [ { - internalType: "uint256", + internalType: "address", name: "", - type: "uint256", + type: "address", }, ], stateMutability: "view", @@ -1229,12 +1025,29 @@ const _abi = [ }, { inputs: [], - name: "isApprovedBySecurityCouncil", + name: "getVerifierParams", outputs: [ { - internalType: "bool", + components: [ + { + internalType: "bytes32", + name: "recursionNodeLevelVkHash", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "recursionLeafLevelVkHash", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "recursionCircuitsSetVksHash", + type: "bytes32", + }, + ], + internalType: "struct VerifierParams", name: "", - type: "bool", + type: "tuple", }, ], stateMutability: "view", @@ -1257,7 +1070,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -1338,7 +1151,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_blockNumber", + name: "_batchNumber", type: "uint256", }, ], @@ -1412,93 +1225,18 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [ - { - 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: "initAddress", - type: "address", - }, - { - internalType: "bytes", - name: "initCalldata", - type: "bytes", - }, - ], - internalType: "struct Diamond.DiamondCutData", - name: "_diamondCut", - type: "tuple", - }, - { - internalType: "uint40", - name: "_proposalId", - type: "uint40", - }, - ], - name: "proposeTransparentUpgrade", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, { inputs: [ { components: [ { internalType: "uint64", - name: "blockNumber", + name: "batchNumber", type: "uint64", }, { internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -1532,20 +1270,20 @@ const _abi = [ type: "bytes32", }, ], - internalType: "struct IExecutor.StoredBlockInfo", - name: "_prevBlock", + internalType: "struct IExecutor.StoredBatchInfo", + name: "_prevBatch", type: "tuple", }, { components: [ { internalType: "uint64", - name: "blockNumber", + name: "batchNumber", type: "uint64", }, { internalType: "bytes32", - name: "blockHash", + name: "batchHash", type: "bytes32", }, { @@ -1579,8 +1317,8 @@ const _abi = [ type: "bytes32", }, ], - internalType: "struct IExecutor.StoredBlockInfo[]", - name: "_committedBlocks", + internalType: "struct IExecutor.StoredBatchInfo[]", + name: "_committedBatches", type: "tuple[]", }, { @@ -1601,7 +1339,7 @@ const _abi = [ type: "tuple", }, ], - name: "proveBlocks", + name: "proveBatches", outputs: [], stateMutability: "nonpayable", type: "function", @@ -1615,7 +1353,7 @@ const _abi = [ }, { internalType: "uint256", - name: "_l2BlockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -1625,7 +1363,7 @@ const _abi = [ }, { internalType: "uint16", - name: "_l2TxNumberInBlock", + name: "_l2TxNumberInBatch", type: "uint16", }, { @@ -1654,7 +1392,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_blockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -1676,7 +1414,7 @@ const _abi = [ }, { internalType: "uint16", - name: "txNumberInBlock", + name: "txNumberInBatch", type: "uint16", }, { @@ -1720,7 +1458,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_blockNumber", + name: "_l2BatchNumber", type: "uint256", }, { @@ -1732,7 +1470,7 @@ const _abi = [ components: [ { internalType: "uint16", - name: "txNumberInBlock", + name: "txNumberInBatch", type: "uint16", }, { @@ -1770,30 +1508,37 @@ const _abi = [ { inputs: [ { - internalType: "address", - name: "_contractL2", - type: "address", - }, - { - internalType: "uint256", - name: "_l2Value", - type: "uint256", + components: [ + { + internalType: "address", + name: "l2Contract", + type: "address", + }, + { + internalType: "uint256", + name: "l2Value", + type: "uint256", + }, + { + internalType: "uint256", + name: "l2GasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "l2GasPerPubdataByteLimit", + type: "uint256", + }, + ], + internalType: "struct L2Transaction", + name: "_l2tx", + type: "tuple", }, { internalType: "bytes", name: "_calldata", type: "bytes", }, - { - internalType: "uint256", - name: "_l2GasLimit", - type: "uint256", - }, - { - internalType: "uint256", - name: "_l2GasPerPubdataByteLimit", - type: "uint256", - }, { internalType: "bytes[]", name: "_factoryDeps", @@ -1804,6 +1549,11 @@ const _abi = [ name: "_refundRecipient", type: "address", }, + { + internalType: "uint256", + name: "_baseAmount", + type: "uint256", + }, ], name: "requestL2Transaction", outputs: [ @@ -1820,11 +1570,11 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "_newLastBlock", + name: "_newLastBatch", type: "uint256", }, ], - name: "revertBlocks", + name: "revertBatches", outputs: [], stateMutability: "nonpayable", type: "function", @@ -1832,38 +1582,12 @@ const _abi = [ { inputs: [ { - internalType: "bytes32", - name: "_upgradeProposalHash", - type: "bytes32", - }, - ], - name: "securityCouncilUpgradeApprove", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_l2BootloaderBytecodeHash", - type: "bytes32", - }, - ], - name: "setL2BootloaderBytecodeHash", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "_l2DefaultAccountBytecodeHash", - type: "bytes32", + internalType: "address", + name: "_newPendingAdmin", + type: "address", }, ], - name: "setL2DefaultAccountBytecodeHash", + name: "setPendingAdmin", outputs: [], stateMutability: "nonpayable", type: "function", @@ -1925,58 +1649,15 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "contract Verifier", - name: "_newVerifier", - type: "address", - }, - ], - name: "setVerifier", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "bytes32", - name: "recursionNodeLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionLeafLevelVkHash", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "recursionCircuitsSetVksHash", - type: "bytes32", - }, - ], - internalType: "struct VerifierParams", - name: "_newVerifierParams", - type: "tuple", - }, - ], - name: "setVerifierParams", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, { inputs: [ { internalType: "uint256", - name: "_blockNumber", + name: "_batchNumber", type: "uint256", }, ], - name: "storedBlockHash", + name: "storedBatchHash", outputs: [ { internalType: "bytes32", @@ -1994,72 +1675,4 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - components: [ - { - components: [ - { - internalType: "address", - name: "facet", - type: "address", - }, - { - internalType: "enum Diamond.Action", - name: "action", - type: "uint8", - }, - { - internalType: "bool", - name: "isFreezable", - type: "bool", - }, - { - internalType: "bytes4[]", - name: "selectors", - type: "bytes4[]", - }, - ], - internalType: "struct Diamond.FacetCut[]", - name: "facetCuts", - type: "tuple[]", - }, - { - internalType: "address", - name: "initAddress", - type: "address", - }, - { - internalType: "bytes", - name: "initCalldata", - type: "bytes", - }, - ], - internalType: "struct Diamond.DiamondCutData", - name: "_diamondCut", - type: "tuple", - }, - { - internalType: "uint256", - name: "_proposalId", - type: "uint256", - }, - { - internalType: "bytes32", - name: "_salt", - type: "bytes32", - }, - ], - name: "upgradeProposalHash", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "pure", - type: "function", - }, ]; diff --git a/typechain/index.ts b/typechain/index.ts index 1434b69..83f31eb 100644 --- a/typechain/index.ts +++ b/typechain/index.ts @@ -10,4 +10,5 @@ export { IAllowListFactory } from './IAllowListFactory'; export type { IAllowList } from './IAllowList'; export { IEthTokenFactory } from './IEthTokenFactory'; export type { IEthToken } from './IEthToken'; +export { CronosTestnetFactory } from "./CronosTestnetFactory"; diff --git a/typechain/update.sh b/typechain/update.sh index 848bad9..4bf0292 100755 --- a/typechain/update.sh +++ b/typechain/update.sh @@ -2,5 +2,5 @@ cd `dirname $0` -cp -f $ZKSYNC_HOME/contracts/ethereum/typechain/{IZkSync,IL2Bridge,IL1Bridge,IERC20Metadata,IAllowList}.d.ts . -cp -f $ZKSYNC_HOME/contracts/ethereum/typechain/{IZkSync,IL2Bridge,IL1Bridge,IERC20Metadata,IAllowList}Factory.ts . +cp -f $ZKSYNC_HOME/contracts/ethereum/typechain/{IZkSync,IL2Bridge,IL1Bridge,IERC20Metadata,IAllowList,CronosTestnet}.d.ts . +cp -f $ZKSYNC_HOME/contracts/ethereum/typechain/{IZkSync,IL2Bridge,IL1Bridge,IERC20Metadata,IAllowList,CronosTestnet}Factory.ts .