From a14ceef7fe68f4fad5fbd64a6f022e67d9377bd7 Mon Sep 17 00:00:00 2001 From: petarTxFusion Date: Fri, 7 Jun 2024 12:07:04 +0200 Subject: [PATCH] refactor: use L2_BASE_TOKEN_ADDRESS as a address when working with base token --- .../io/zksync/protocol/JsonRpc2_0ZkSync.java | 33 +- .../io/zksync/wrappers/IL2SharedBridge.java | 238 ++++++++ ...Transition.java => IZkSyncHyperchain.java} | 532 +++++++++--------- 3 files changed, 500 insertions(+), 303 deletions(-) create mode 100644 src/main/java/io/zksync/wrappers/IL2SharedBridge.java rename src/main/java/io/zksync/wrappers/{IZkSyncStateTransition.java => IZkSyncHyperchain.java} (80%) diff --git a/src/main/java/io/zksync/protocol/JsonRpc2_0ZkSync.java b/src/main/java/io/zksync/protocol/JsonRpc2_0ZkSync.java index 8ab4eab..b1ec5dd 100755 --- a/src/main/java/io/zksync/protocol/JsonRpc2_0ZkSync.java +++ b/src/main/java/io/zksync/protocol/JsonRpc2_0ZkSync.java @@ -218,22 +218,11 @@ public Request estimateL1ToL2Execute(String contractAddress, } public Transaction getWithdrawTransaction(WithdrawTransaction tx, ContractGasProvider gasProvider, TransactionManager transactionManager) throws Exception { - boolean isEthBasedChain = isEthBasedChain(); - - if (tx.tokenAddress != null && - !tx.tokenAddress.isEmpty() && - tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.LEGACY_ETH_ADDRESS) && - !isEthBasedChain){ + tx.tokenAddress = tx.tokenAddress == null ? ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS : tx.tokenAddress; + if (tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.LEGACY_ETH_ADDRESS) || tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.ETH_ADDRESS_IN_CONTRACTS)){ tx.tokenAddress = l2TokenAddress(ZkSyncAddresses.ETH_ADDRESS_IN_CONTRACTS); - } else if (tx.tokenAddress == null || - tx.tokenAddress.isEmpty() || - isBaseToken(tx.tokenAddress)){ - tx.tokenAddress = ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS; } - if (tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.LEGACY_ETH_ADDRESS)){ - tx.tokenAddress = ZkSyncAddresses.ETH_ADDRESS_IN_CONTRACTS; - } if (tx.from == null && tx.to == null){ throw new Error("Withdrawal target address is undefined!"); } @@ -241,7 +230,7 @@ public Transaction getWithdrawTransaction(WithdrawTransaction tx, ContractGasPro tx.to = tx.to == null ? tx.from : tx.to; tx.options = tx.options == null ? new TransactionOptions() : tx.options; - if (ZkSyncAddresses.isEth(tx.tokenAddress)){ + if (tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS)){ if (tx.options.getValue() == null){ tx.options.setValue(tx.amount); } @@ -253,7 +242,7 @@ public Transaction getWithdrawTransaction(WithdrawTransaction tx, ContractGasPro } IEthToken ethL2Token = IEthToken.load(ZkSyncAddresses.L2_ETH_TOKEN_ADDRESS, this, transactionManager, gasProvider); - String data = ethL2Token.encodeWithdraw(tx.to, passedValue); + String data = ethL2Token.encodeWithdraw(tx.to); Eip712Meta meta = new Eip712Meta(BigInteger.valueOf(50000), null, null, tx.paymasterParams); return new Transaction(tx.from, ZkSyncAddresses.L2_ETH_TOKEN_ADDRESS, BigInteger.ZERO, BigInteger.ZERO, tx.amount, data, meta); @@ -275,17 +264,9 @@ public Transaction getWithdrawTransaction(WithdrawTransaction tx, ContractGasPro } public Transaction getTransferTransaction(TransferTransaction tx, TransactionManager transactionManager, ContractGasProvider gasProvider){ - boolean isEthBasedChain = isEthBasedChain(); - - if (tx.tokenAddress != null && - !tx.tokenAddress.isEmpty() && - tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.LEGACY_ETH_ADDRESS) && - !isEthBasedChain){ + tx.tokenAddress = tx.tokenAddress == null ? ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS : tx.tokenAddress; + if (tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.LEGACY_ETH_ADDRESS) || tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.ETH_ADDRESS_IN_CONTRACTS)){ tx.tokenAddress = l2TokenAddress(ZkSyncAddresses.ETH_ADDRESS_IN_CONTRACTS); - } else if (tx.tokenAddress == null || - tx.tokenAddress.isEmpty() || - isBaseToken(tx.tokenAddress)){ - tx.tokenAddress = ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS; } tx.to = tx.to == null ? tx.from : tx.to; @@ -299,7 +280,7 @@ public Transaction getTransferTransaction(TransferTransaction tx, TransactionMan } Eip712Meta meta = new Eip712Meta(tx.gasPerPubData, null, null, tx.paymasterParams); - if (tx.tokenAddress == null || tx.tokenAddress == ZkSyncAddresses.LEGACY_ETH_ADDRESS || isBaseToken(tx.tokenAddress)){ + if (tx.tokenAddress.equalsIgnoreCase(ZkSyncAddresses.L2_BASE_TOKEN_ADDRESS)){ return new Transaction(tx.from, tx.to, BigInteger.ZERO, gasPrice, tx.amount, "0x", meta); } ERC20 token = ERC20.load(tx.tokenAddress, this, transactionManager, gasProvider); diff --git a/src/main/java/io/zksync/wrappers/IL2SharedBridge.java b/src/main/java/io/zksync/wrappers/IL2SharedBridge.java new file mode 100644 index 0000000..b301773 --- /dev/null +++ b/src/main/java/io/zksync/wrappers/IL2SharedBridge.java @@ -0,0 +1,238 @@ +package io.zksync.wrappers; + +import io.reactivex.Flowable; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.web3j.abi.EventEncoder; +import org.web3j.abi.TypeReference; +import org.web3j.abi.datatypes.Address; +import org.web3j.abi.datatypes.Event; +import org.web3j.abi.datatypes.Function; +import org.web3j.abi.datatypes.Type; +import org.web3j.abi.datatypes.generated.Uint256; +import org.web3j.crypto.Credentials; +import org.web3j.protocol.Web3j; +import org.web3j.protocol.core.DefaultBlockParameter; +import org.web3j.protocol.core.RemoteFunctionCall; +import org.web3j.protocol.core.methods.request.EthFilter; +import org.web3j.protocol.core.methods.response.BaseEventResponse; +import org.web3j.protocol.core.methods.response.Log; +import org.web3j.protocol.core.methods.response.TransactionReceipt; +import org.web3j.tx.Contract; +import org.web3j.tx.TransactionManager; +import org.web3j.tx.gas.ContractGasProvider; + +/** + *

Auto generated code. + *

Do not modify! + *

Please use the web3j command line tools, + * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the + * codegen module to update. + * + *

Generated with web3j version 1.5.0. + */ +@SuppressWarnings("rawtypes") +public class IL2SharedBridge extends Contract { + public static final String BINARY = "Bin file was not provided"; + + public static final String FUNC_FINALIZEDEPOSIT = "finalizeDeposit"; + + public static final String FUNC_L1BRIDGE = "l1Bridge"; + + public static final String FUNC_L1SHAREDBRIDGE = "l1SharedBridge"; + + public static final String FUNC_L1TOKENADDRESS = "l1TokenAddress"; + + public static final String FUNC_L2TOKENADDRESS = "l2TokenAddress"; + + public static final String FUNC_WITHDRAW = "withdraw"; + + public static final Event FINALIZEDEPOSIT_EVENT = new Event("FinalizeDeposit", + Arrays.>asList(new TypeReference

(true) {}, new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; + + public static final Event WITHDRAWALINITIATED_EVENT = new Event("WithdrawalInitiated", + Arrays.>asList(new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference
(true) {}, new TypeReference() {})); + ; + + @Deprecated + protected IL2SharedBridge(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + protected IL2SharedBridge(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + super(BINARY, contractAddress, web3j, credentials, contractGasProvider); + } + + @Deprecated + protected IL2SharedBridge(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + protected IL2SharedBridge(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); + } + + public static List getFinalizeDepositEvents(TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(FINALIZEDEPOSIT_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + FinalizeDepositEventResponse typedResponse = new FinalizeDepositEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.l1Sender = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.l2Receiver = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.l2Token = (String) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static FinalizeDepositEventResponse getFinalizeDepositEventFromLog(Log log) { + EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FINALIZEDEPOSIT_EVENT, log); + FinalizeDepositEventResponse typedResponse = new FinalizeDepositEventResponse(); + typedResponse.log = log; + typedResponse.l1Sender = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.l2Receiver = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.l2Token = (String) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable finalizeDepositEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getFinalizeDepositEventFromLog(log)); + } + + public Flowable finalizeDepositEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(FINALIZEDEPOSIT_EVENT)); + return finalizeDepositEventFlowable(filter); + } + + public static List getWithdrawalInitiatedEvents(TransactionReceipt transactionReceipt) { + List valueList = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, transactionReceipt); + ArrayList responses = new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + WithdrawalInitiatedEventResponse typedResponse = new WithdrawalInitiatedEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.l2Sender = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.l1Receiver = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.l2Token = (String) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public static WithdrawalInitiatedEventResponse getWithdrawalInitiatedEventFromLog(Log log) { + EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDRAWALINITIATED_EVENT, log); + WithdrawalInitiatedEventResponse typedResponse = new WithdrawalInitiatedEventResponse(); + typedResponse.log = log; + typedResponse.l2Sender = (String) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.l1Receiver = (String) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.l2Token = (String) eventValues.getIndexedValues().get(2).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); + return typedResponse; + } + + public Flowable withdrawalInitiatedEventFlowable(EthFilter filter) { + return web3j.ethLogFlowable(filter).map(log -> getWithdrawalInitiatedEventFromLog(log)); + } + + public Flowable withdrawalInitiatedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { + EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); + filter.addSingleTopic(EventEncoder.encode(WITHDRAWALINITIATED_EVENT)); + return withdrawalInitiatedEventFlowable(filter); + } + + public RemoteFunctionCall finalizeDeposit(String _l1Sender, String _l2Receiver, String _l1Token, BigInteger _amount, byte[] _data) { + final Function function = new Function( + FUNC_FINALIZEDEPOSIT, + Arrays.asList(new Address(160, _l1Sender), + new Address(160, _l2Receiver), + new Address(160, _l1Token), + new Uint256(_amount), + new org.web3j.abi.datatypes.DynamicBytes(_data)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall l1Bridge() { + final Function function = new Function(FUNC_L1BRIDGE, + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); + return executeRemoteCallSingleValueReturn(function, String.class); + } + + public RemoteFunctionCall l1SharedBridge() { + final Function function = new Function(FUNC_L1SHAREDBRIDGE, + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); + return executeRemoteCallSingleValueReturn(function, String.class); + } + + public RemoteFunctionCall l1TokenAddress(String _l2Token) { + final Function function = new Function(FUNC_L1TOKENADDRESS, + Arrays.asList(new Address(160, _l2Token)), + Arrays.>asList(new TypeReference
() {})); + return executeRemoteCallSingleValueReturn(function, String.class); + } + + public RemoteFunctionCall l2TokenAddress(String _l1Token) { + final Function function = new Function(FUNC_L2TOKENADDRESS, + Arrays.asList(new Address(160, _l1Token)), + Arrays.>asList(new TypeReference
() {})); + return executeRemoteCallSingleValueReturn(function, String.class); + } + + public RemoteFunctionCall withdraw(String _l1Receiver, String _l2Token, BigInteger _amount) { + final Function function = new Function( + FUNC_WITHDRAW, + Arrays.asList(new Address(160, _l1Receiver), + new Address(160, _l2Token), + new Uint256(_amount)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + @Deprecated + public static IL2SharedBridge load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + return new IL2SharedBridge(contractAddress, web3j, credentials, gasPrice, gasLimit); + } + + @Deprecated + public static IL2SharedBridge load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new IL2SharedBridge(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + } + + public static IL2SharedBridge load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + return new IL2SharedBridge(contractAddress, web3j, credentials, contractGasProvider); + } + + public static IL2SharedBridge load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new IL2SharedBridge(contractAddress, web3j, transactionManager, contractGasProvider); + } + + public static class FinalizeDepositEventResponse extends BaseEventResponse { + public String l1Sender; + + public String l2Receiver; + + public String l2Token; + + public BigInteger amount; + } + + public static class WithdrawalInitiatedEventResponse extends BaseEventResponse { + public String l2Sender; + + public String l1Receiver; + + public String l2Token; + + public BigInteger amount; + } +} diff --git a/src/main/java/io/zksync/wrappers/IZkSyncStateTransition.java b/src/main/java/io/zksync/wrappers/IZkSyncHyperchain.java similarity index 80% rename from src/main/java/io/zksync/wrappers/IZkSyncStateTransition.java rename to src/main/java/io/zksync/wrappers/IZkSyncHyperchain.java index 2ea270c..d8d2406 100644 --- a/src/main/java/io/zksync/wrappers/IZkSyncStateTransition.java +++ b/src/main/java/io/zksync/wrappers/IZkSyncHyperchain.java @@ -40,6 +40,7 @@ import org.web3j.protocol.core.methods.response.BaseEventResponse; import org.web3j.protocol.core.methods.response.Log; import org.web3j.protocol.core.methods.response.TransactionReceipt; +import org.web3j.tuples.generated.Tuple3; import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; @@ -54,7 +55,7 @@ *

Generated with web3j version 1.5.0. */ @SuppressWarnings("rawtypes") -public class IZkSyncStateTransition extends Contract { +public class IZkSyncHyperchain extends Contract { public static final String BINARY = "Bin file was not provided"; public static final String FUNC_ACCEPTADMIN = "acceptAdmin"; @@ -119,6 +120,8 @@ public class IZkSyncStateTransition extends Contract { public static final String FUNC_GETPUBDATAPRICINGMODE = "getPubdataPricingMode"; + public static final String FUNC_GETSEMVERPROTOCOLVERSION = "getSemverProtocolVersion"; + public static final String FUNC_GETSTATETRANSITIONMANAGER = "getStateTransitionManager"; public static final String FUNC_GETTOTALBATCHESCOMMITTED = "getTotalBatchesCommitted"; @@ -171,14 +174,14 @@ public class IZkSyncStateTransition extends Contract { public static final String FUNC_SETPRIORITYTXMAXGASLIMIT = "setPriorityTxMaxGasLimit"; + public static final String FUNC_SETPUBDATAPRICINGMODE = "setPubdataPricingMode"; + public static final String FUNC_SETTOKENMULTIPLIER = "setTokenMultiplier"; public static final String FUNC_SETTRANSACTIONFILTERER = "setTransactionFilterer"; public static final String FUNC_SETVALIDATOR = "setValidator"; - public static final String FUNC_SETVALIDIUMMODE = "setValidiumMode"; - public static final String FUNC_STOREDBATCHHASH = "storedBatchHash"; public static final String FUNC_TRANSFERETHTOSHAREDBRIDGE = "transferEthToSharedBridge"; @@ -203,10 +206,6 @@ public class IZkSyncStateTransition extends Contract { Arrays.>asList(new TypeReference(true) {}, new TypeReference(true) {})); ; - public static final Event ETHWITHDRAWALFINALIZED_EVENT = new Event("EthWithdrawalFinalized", - Arrays.>asList(new TypeReference

(true) {}, new TypeReference() {})); - ; - public static final Event EXECUTEUPGRADE_EVENT = new Event("ExecuteUpgrade", Arrays.>asList(new TypeReference() {})); ; @@ -264,27 +263,27 @@ public class IZkSyncStateTransition extends Contract { ; @Deprecated - protected IZkSyncStateTransition(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + protected IZkSyncHyperchain(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } - protected IZkSyncStateTransition(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + protected IZkSyncHyperchain(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated - protected IZkSyncStateTransition(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + protected IZkSyncHyperchain(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - protected IZkSyncStateTransition(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + protected IZkSyncHyperchain(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } public static List getBlockCommitEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(BLOCKCOMMIT_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(BLOCKCOMMIT_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { BlockCommitEventResponse typedResponse = new BlockCommitEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.batchNumber = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -296,7 +295,7 @@ public static List getBlockCommitEvents(TransactionRec } public static BlockCommitEventResponse getBlockCommitEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKCOMMIT_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKCOMMIT_EVENT, log); BlockCommitEventResponse typedResponse = new BlockCommitEventResponse(); typedResponse.log = log; typedResponse.batchNumber = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -316,9 +315,9 @@ public Flowable blockCommitEventFlowable(DefaultBlockP } public static List getBlockExecutionEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(BLOCKEXECUTION_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(BLOCKEXECUTION_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { BlockExecutionEventResponse typedResponse = new BlockExecutionEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.batchNumber = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -330,7 +329,7 @@ public static List getBlockExecutionEvents(Transact } public static BlockExecutionEventResponse getBlockExecutionEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKEXECUTION_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKEXECUTION_EVENT, log); BlockExecutionEventResponse typedResponse = new BlockExecutionEventResponse(); typedResponse.log = log; typedResponse.batchNumber = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -350,9 +349,9 @@ public Flowable blockExecutionEventFlowable(Default } public static List getBlocksRevertEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(BLOCKSREVERT_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(BLOCKSREVERT_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { BlocksRevertEventResponse typedResponse = new BlocksRevertEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.totalBatchesCommitted = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -364,7 +363,7 @@ public static List getBlocksRevertEvents(TransactionR } public static BlocksRevertEventResponse getBlocksRevertEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKSREVERT_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKSREVERT_EVENT, log); BlocksRevertEventResponse typedResponse = new BlocksRevertEventResponse(); typedResponse.log = log; typedResponse.totalBatchesCommitted = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -384,9 +383,9 @@ public Flowable blocksRevertEventFlowable(DefaultBloc } public static List getBlocksVerificationEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(BLOCKSVERIFICATION_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(BLOCKSVERIFICATION_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { BlocksVerificationEventResponse typedResponse = new BlocksVerificationEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.previousLastVerifiedBatch = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -397,7 +396,7 @@ public static List getBlocksVerificationEvents( } public static BlocksVerificationEventResponse getBlocksVerificationEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKSVERIFICATION_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BLOCKSVERIFICATION_EVENT, log); BlocksVerificationEventResponse typedResponse = new BlocksVerificationEventResponse(); typedResponse.log = log; typedResponse.previousLastVerifiedBatch = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -415,42 +414,10 @@ public Flowable blocksVerificationEventFlowable return blocksVerificationEventFlowable(filter); } - public static List getEthWithdrawalFinalizedEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ETHWITHDRAWALFINALIZED_EVENT, transactionReceipt); - ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { - EthWithdrawalFinalizedEventResponse typedResponse = new EthWithdrawalFinalizedEventResponse(); - typedResponse.log = eventValues.getLog(); - typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - responses.add(typedResponse); - } - return responses; - } - - public static EthWithdrawalFinalizedEventResponse getEthWithdrawalFinalizedEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ETHWITHDRAWALFINALIZED_EVENT, log); - EthWithdrawalFinalizedEventResponse typedResponse = new EthWithdrawalFinalizedEventResponse(); - typedResponse.log = log; - typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); - typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); - return typedResponse; - } - - public Flowable ethWithdrawalFinalizedEventFlowable(EthFilter filter) { - return web3j.ethLogFlowable(filter).map(log -> getEthWithdrawalFinalizedEventFromLog(log)); - } - - public Flowable ethWithdrawalFinalizedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { - EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); - filter.addSingleTopic(EventEncoder.encode(ETHWITHDRAWALFINALIZED_EVENT)); - return ethWithdrawalFinalizedEventFlowable(filter); - } - public static List getExecuteUpgradeEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(EXECUTEUPGRADE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(EXECUTEUPGRADE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ExecuteUpgradeEventResponse typedResponse = new ExecuteUpgradeEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.diamondCut = (DiamondCutData) eventValues.getNonIndexedValues().get(0); @@ -460,7 +427,7 @@ public static List getExecuteUpgradeEvents(Transact } public static ExecuteUpgradeEventResponse getExecuteUpgradeEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EXECUTEUPGRADE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EXECUTEUPGRADE_EVENT, log); ExecuteUpgradeEventResponse typedResponse = new ExecuteUpgradeEventResponse(); typedResponse.log = log; typedResponse.diamondCut = (DiamondCutData) eventValues.getNonIndexedValues().get(0); @@ -478,9 +445,9 @@ public Flowable executeUpgradeEventFlowable(Default } public static List getFreezeEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(FREEZE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(FREEZE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { FreezeEventResponse typedResponse = new FreezeEventResponse(); typedResponse.log = eventValues.getLog(); responses.add(typedResponse); @@ -489,7 +456,7 @@ public static List getFreezeEvents(TransactionReceipt trans } public static FreezeEventResponse getFreezeEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FREEZE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FREEZE_EVENT, log); FreezeEventResponse typedResponse = new FreezeEventResponse(); typedResponse.log = log; return typedResponse; @@ -506,9 +473,9 @@ public Flowable freezeEventFlowable(DefaultBlockParameter s } public static List getIsPorterAvailableStatusUpdateEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(ISPORTERAVAILABLESTATUSUPDATE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(ISPORTERAVAILABLESTATUSUPDATE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { IsPorterAvailableStatusUpdateEventResponse typedResponse = new IsPorterAvailableStatusUpdateEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.isPorterAvailable = (Boolean) eventValues.getNonIndexedValues().get(0).getValue(); @@ -518,7 +485,7 @@ public static List getIsPorterAvaila } public static IsPorterAvailableStatusUpdateEventResponse getIsPorterAvailableStatusUpdateEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ISPORTERAVAILABLESTATUSUPDATE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ISPORTERAVAILABLESTATUSUPDATE_EVENT, log); IsPorterAvailableStatusUpdateEventResponse typedResponse = new IsPorterAvailableStatusUpdateEventResponse(); typedResponse.log = log; typedResponse.isPorterAvailable = (Boolean) eventValues.getNonIndexedValues().get(0).getValue(); @@ -536,9 +503,9 @@ public Flowable isPorterAvailableSta } public static List getNewAdminEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWADMIN_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWADMIN_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewAdminEventResponse typedResponse = new NewAdminEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldAdmin = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -549,7 +516,7 @@ public static List getNewAdminEvents(TransactionReceipt t } public static NewAdminEventResponse getNewAdminEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWADMIN_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWADMIN_EVENT, log); NewAdminEventResponse typedResponse = new NewAdminEventResponse(); typedResponse.log = log; typedResponse.oldAdmin = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -568,9 +535,9 @@ public Flowable newAdminEventFlowable(DefaultBlockParamet } public static List getNewBaseTokenMultiplierEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWBASETOKENMULTIPLIER_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWBASETOKENMULTIPLIER_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewBaseTokenMultiplierEventResponse typedResponse = new NewBaseTokenMultiplierEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldNominator = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -583,7 +550,7 @@ public static List getNewBaseTokenMultiplie } public static NewBaseTokenMultiplierEventResponse getNewBaseTokenMultiplierEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWBASETOKENMULTIPLIER_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWBASETOKENMULTIPLIER_EVENT, log); NewBaseTokenMultiplierEventResponse typedResponse = new NewBaseTokenMultiplierEventResponse(); typedResponse.log = log; typedResponse.oldNominator = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -604,9 +571,9 @@ public Flowable newBaseTokenMultiplierEvent } public static List getNewFeeParamsEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWFEEPARAMS_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWFEEPARAMS_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewFeeParamsEventResponse typedResponse = new NewFeeParamsEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldFeeParams = (FeeParams) eventValues.getNonIndexedValues().get(0); @@ -617,7 +584,7 @@ public static List getNewFeeParamsEvents(TransactionR } public static NewFeeParamsEventResponse getNewFeeParamsEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWFEEPARAMS_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWFEEPARAMS_EVENT, log); NewFeeParamsEventResponse typedResponse = new NewFeeParamsEventResponse(); typedResponse.log = log; typedResponse.oldFeeParams = (FeeParams) eventValues.getNonIndexedValues().get(0); @@ -636,9 +603,9 @@ public Flowable newFeeParamsEventFlowable(DefaultBloc } public static List getNewPendingAdminEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWPENDINGADMIN_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWPENDINGADMIN_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewPendingAdminEventResponse typedResponse = new NewPendingAdminEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldPendingAdmin = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -649,7 +616,7 @@ public static List getNewPendingAdminEvents(Transa } public static NewPendingAdminEventResponse getNewPendingAdminEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPENDINGADMIN_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPENDINGADMIN_EVENT, log); NewPendingAdminEventResponse typedResponse = new NewPendingAdminEventResponse(); typedResponse.log = log; typedResponse.oldPendingAdmin = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -668,9 +635,9 @@ public Flowable newPendingAdminEventFlowable(Defau } public static List getNewPriorityRequestEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWPRIORITYREQUEST_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWPRIORITYREQUEST_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewPriorityRequestEventResponse typedResponse = new NewPriorityRequestEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.txId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -684,7 +651,7 @@ public static List getNewPriorityRequestEvents( } public static NewPriorityRequestEventResponse getNewPriorityRequestEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPRIORITYREQUEST_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPRIORITYREQUEST_EVENT, log); NewPriorityRequestEventResponse typedResponse = new NewPriorityRequestEventResponse(); typedResponse.log = log; typedResponse.txId = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -706,9 +673,9 @@ public Flowable newPriorityRequestEventFlowable } public static List getNewPriorityTxMaxGasLimitEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWPRIORITYTXMAXGASLIMIT_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWPRIORITYTXMAXGASLIMIT_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewPriorityTxMaxGasLimitEventResponse typedResponse = new NewPriorityTxMaxGasLimitEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldPriorityTxMaxGasLimit = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -719,7 +686,7 @@ public static List getNewPriorityTxMaxGas } public static NewPriorityTxMaxGasLimitEventResponse getNewPriorityTxMaxGasLimitEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPRIORITYTXMAXGASLIMIT_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWPRIORITYTXMAXGASLIMIT_EVENT, log); NewPriorityTxMaxGasLimitEventResponse typedResponse = new NewPriorityTxMaxGasLimitEventResponse(); typedResponse.log = log; typedResponse.oldPriorityTxMaxGasLimit = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -738,9 +705,9 @@ public Flowable newPriorityTxMaxGasLimitE } public static List getNewTransactionFiltererEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(NEWTRANSACTIONFILTERER_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(NEWTRANSACTIONFILTERER_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { NewTransactionFiltererEventResponse typedResponse = new NewTransactionFiltererEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.oldTransactionFilterer = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -751,7 +718,7 @@ public static List getNewTransactionFiltere } public static NewTransactionFiltererEventResponse getNewTransactionFiltererEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWTRANSACTIONFILTERER_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(NEWTRANSACTIONFILTERER_EVENT, log); NewTransactionFiltererEventResponse typedResponse = new NewTransactionFiltererEventResponse(); typedResponse.log = log; typedResponse.oldTransactionFilterer = (String) eventValues.getNonIndexedValues().get(0).getValue(); @@ -770,9 +737,9 @@ public Flowable newTransactionFiltererEvent } public static List getProposeTransparentUpgradeEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(PROPOSETRANSPARENTUPGRADE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(PROPOSETRANSPARENTUPGRADE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ProposeTransparentUpgradeEventResponse typedResponse = new ProposeTransparentUpgradeEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.proposalId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -784,7 +751,7 @@ public static List getProposeTransparent } public static ProposeTransparentUpgradeEventResponse getProposeTransparentUpgradeEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PROPOSETRANSPARENTUPGRADE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PROPOSETRANSPARENTUPGRADE_EVENT, log); ProposeTransparentUpgradeEventResponse typedResponse = new ProposeTransparentUpgradeEventResponse(); typedResponse.log = log; typedResponse.proposalId = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); @@ -804,9 +771,9 @@ public Flowable proposeTransparentUpgrad } public static List getUnfreezeEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(UNFREEZE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(UNFREEZE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { UnfreezeEventResponse typedResponse = new UnfreezeEventResponse(); typedResponse.log = eventValues.getLog(); responses.add(typedResponse); @@ -815,7 +782,7 @@ public static List getUnfreezeEvents(TransactionReceipt t } public static UnfreezeEventResponse getUnfreezeEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNFREEZE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNFREEZE_EVENT, log); UnfreezeEventResponse typedResponse = new UnfreezeEventResponse(); typedResponse.log = log; return typedResponse; @@ -832,9 +799,9 @@ public Flowable unfreezeEventFlowable(DefaultBlockParamet } public static List getValidatorStatusUpdateEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VALIDATORSTATUSUPDATE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(VALIDATORSTATUSUPDATE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ValidatorStatusUpdateEventResponse typedResponse = new ValidatorStatusUpdateEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.validatorAddress = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -845,7 +812,7 @@ public static List getValidatorStatusUpdateE } public static ValidatorStatusUpdateEventResponse getValidatorStatusUpdateEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VALIDATORSTATUSUPDATE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VALIDATORSTATUSUPDATE_EVENT, log); ValidatorStatusUpdateEventResponse typedResponse = new ValidatorStatusUpdateEventResponse(); typedResponse.log = log; typedResponse.validatorAddress = (String) eventValues.getIndexedValues().get(0).getValue(); @@ -864,9 +831,9 @@ public Flowable validatorStatusUpdateEventFl } public static List getValidiumModeStatusUpdateEvents(TransactionReceipt transactionReceipt) { - List valueList = staticExtractEventParametersWithLog(VALIDIUMMODESTATUSUPDATE_EVENT, transactionReceipt); + List valueList = staticExtractEventParametersWithLog(VALIDIUMMODESTATUSUPDATE_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); - for (EventValuesWithLog eventValues : valueList) { + for (Contract.EventValuesWithLog eventValues : valueList) { ValidiumModeStatusUpdateEventResponse typedResponse = new ValidiumModeStatusUpdateEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.validiumMode = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -876,7 +843,7 @@ public static List getValidiumModeStatusU } public static ValidiumModeStatusUpdateEventResponse getValidiumModeStatusUpdateEventFromLog(Log log) { - EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VALIDIUMMODESTATUSUPDATE_EVENT, log); + Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(VALIDIUMMODESTATUSUPDATE_EVENT, log); ValidiumModeStatusUpdateEventResponse typedResponse = new ValidiumModeStatusUpdateEventResponse(); typedResponse.log = log; typedResponse.validiumMode = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); @@ -915,12 +882,12 @@ public RemoteFunctionCall baseTokenGasPriceMultiplierNominator() { return executeRemoteCallSingleValueReturn(function, BigInteger.class); } - public RemoteFunctionCall bridgehubRequestL2Transaction(BridgehubL2TransactionRequest _request, BigInteger weiValue) { + public RemoteFunctionCall bridgehubRequestL2Transaction(BridgehubL2TransactionRequest _request) { final Function function = new Function( FUNC_BRIDGEHUBREQUESTL2TRANSACTION, Arrays.asList(_request), Collections.>emptyList()); - return executeRemoteCallTransaction(function, weiValue); + return executeRemoteCallTransaction(function); } public RemoteFunctionCall changeFeeParams(FeeParams _newFeeParams) { @@ -935,7 +902,7 @@ public RemoteFunctionCall commitBatches(StoredBatchInfo _las final Function function = new Function( FUNC_COMMITBATCHES, Arrays.asList(_lastCommittedBatchData, - new DynamicArray(CommitBatchInfo.class, _newBatchesData)), + new org.web3j.abi.datatypes.DynamicArray(CommitBatchInfo.class, _newBatchesData)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -943,9 +910,9 @@ public RemoteFunctionCall commitBatches(StoredBatchInfo _las public RemoteFunctionCall commitBatchesSharedBridge(BigInteger _chainId, StoredBatchInfo _lastCommittedBatchData, List _newBatchesData) { final Function function = new Function( FUNC_COMMITBATCHESSHAREDBRIDGE, - Arrays.asList(new Uint256(_chainId), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_chainId), _lastCommittedBatchData, - new DynamicArray(CommitBatchInfo.class, _newBatchesData)), + new org.web3j.abi.datatypes.DynamicArray(CommitBatchInfo.class, _newBatchesData)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -953,7 +920,7 @@ public RemoteFunctionCall commitBatchesSharedBridge(BigInteg public RemoteFunctionCall executeBatches(List _batchesData) { final Function function = new Function( FUNC_EXECUTEBATCHES, - Arrays.asList(new DynamicArray(StoredBatchInfo.class, _batchesData)), + Arrays.asList(new org.web3j.abi.datatypes.DynamicArray(StoredBatchInfo.class, _batchesData)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -961,8 +928,8 @@ public RemoteFunctionCall executeBatches(List executeBatchesSharedBridge(BigInteger _chainId, List _batchesData) { final Function function = new Function( FUNC_EXECUTEBATCHESSHAREDBRIDGE, - Arrays.asList(new Uint256(_chainId), - new DynamicArray(StoredBatchInfo.class, _batchesData)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_chainId), + new org.web3j.abi.datatypes.DynamicArray(StoredBatchInfo.class, _batchesData)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -977,7 +944,7 @@ public RemoteFunctionCall executeUpgrade(DiamondCutData _dia public RemoteFunctionCall facetAddress(byte[] _selector) { final Function function = new Function(FUNC_FACETADDRESS, - Arrays.asList(new Bytes4(_selector)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes4(_selector)), Arrays.>asList(new TypeReference
() {})); return executeRemoteCallSingleValueReturn(function, String.class); } @@ -999,7 +966,7 @@ public List call() throws Exception { public RemoteFunctionCall facetFunctionSelectors(String _facet) { final Function function = new Function(FUNC_FACETFUNCTIONSELECTORS, - Arrays.asList(new Address(160, _facet)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _facet)), Arrays.>asList(new TypeReference>() {})); return new RemoteFunctionCall(function, new Callable() { @@ -1030,13 +997,13 @@ public List call() throws Exception { public RemoteFunctionCall finalizeEthWithdrawal(BigInteger _l2BatchNumber, BigInteger _l2MessageIndex, BigInteger _l2TxNumberInBatch, byte[] _message, List _merkleProof) { final Function function = new Function( FUNC_FINALIZEETHWITHDRAWAL, - Arrays.asList(new Uint256(_l2BatchNumber), - new Uint256(_l2MessageIndex), - new Uint16(_l2TxNumberInBatch), - new DynamicBytes(_message), - new DynamicArray( - Bytes32.class, - org.web3j.abi.Utils.typeMap(_merkleProof, Bytes32.class))), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_l2BatchNumber), + new org.web3j.abi.datatypes.generated.Uint256(_l2MessageIndex), + new org.web3j.abi.datatypes.generated.Uint16(_l2TxNumberInBatch), + new org.web3j.abi.datatypes.DynamicBytes(_message), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes32.class, + org.web3j.abi.Utils.typeMap(_merkleProof, org.web3j.abi.datatypes.generated.Bytes32.class))), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1154,6 +1121,23 @@ public RemoteFunctionCall getPubdataPricingMode() { return executeRemoteCallSingleValueReturn(function, BigInteger.class); } + public RemoteFunctionCall> getSemverProtocolVersion() { + final Function function = new Function(FUNC_GETSEMVERPROTOCOLVERSION, + Arrays.asList(), + Arrays.>asList(new TypeReference() {}, new TypeReference() {}, new TypeReference() {})); + return new RemoteFunctionCall>(function, + new Callable>() { + @Override + public Tuple3 call() throws Exception { + List results = executeCallMultipleValueReturn(function); + return new Tuple3( + (BigInteger) results.get(0).getValue(), + (BigInteger) results.get(1).getValue(), + (BigInteger) results.get(2).getValue()); + } + }); + } + public RemoteFunctionCall getStateTransitionManager() { final Function function = new Function(FUNC_GETSTATETRANSITIONMANAGER, Arrays.asList(), @@ -1212,45 +1196,45 @@ public RemoteFunctionCall isDiamondStorageFrozen() { public RemoteFunctionCall isEthWithdrawalFinalized(BigInteger _l2BatchNumber, BigInteger _l2MessageIndex) { final Function function = new Function(FUNC_ISETHWITHDRAWALFINALIZED, - Arrays.asList(new Uint256(_l2BatchNumber), - new Uint256(_l2MessageIndex)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_l2BatchNumber), + new org.web3j.abi.datatypes.generated.Uint256(_l2MessageIndex)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall isFacetFreezable(String _facet) { final Function function = new Function(FUNC_ISFACETFREEZABLE, - Arrays.asList(new Address(160, _facet)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _facet)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall isFunctionFreezable(byte[] _selector) { final Function function = new Function(FUNC_ISFUNCTIONFREEZABLE, - Arrays.asList(new Bytes4(_selector)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes4(_selector)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall isValidator(String _address) { final Function function = new Function(FUNC_ISVALIDATOR, - Arrays.asList(new Address(160, _address)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _address)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall l2LogsRootHash(BigInteger _batchNumber) { final Function function = new Function(FUNC_L2LOGSROOTHASH, - Arrays.asList(new Uint256(_batchNumber)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_batchNumber)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } public RemoteFunctionCall l2TransactionBaseCost(BigInteger _gasPrice, BigInteger _l2GasLimit, BigInteger _l2GasPerPubdataByteLimit) { final Function function = new Function(FUNC_L2TRANSACTIONBASECOST, - Arrays.asList(new Uint256(_gasPrice), - new Uint256(_l2GasLimit), - new Uint256(_l2GasPerPubdataByteLimit)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_gasPrice), + new org.web3j.abi.datatypes.generated.Uint256(_l2GasLimit), + new org.web3j.abi.datatypes.generated.Uint256(_l2GasPerPubdataByteLimit)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, BigInteger.class); } @@ -1266,7 +1250,7 @@ public RemoteFunctionCall proveBatches(StoredBatchInfo _prev final Function function = new Function( FUNC_PROVEBATCHES, Arrays.asList(_prevBatch, - new DynamicArray(StoredBatchInfo.class, _committedBatches), + new org.web3j.abi.datatypes.DynamicArray(StoredBatchInfo.class, _committedBatches), _proof), Collections.>emptyList()); return executeRemoteCallTransaction(function); @@ -1275,9 +1259,9 @@ public RemoteFunctionCall proveBatches(StoredBatchInfo _prev public RemoteFunctionCall proveBatchesSharedBridge(BigInteger _chainId, StoredBatchInfo _prevBatch, List _committedBatches, ProofInput _proof) { final Function function = new Function( FUNC_PROVEBATCHESSHAREDBRIDGE, - Arrays.asList(new Uint256(_chainId), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_chainId), _prevBatch, - new DynamicArray(StoredBatchInfo.class, _committedBatches), + new org.web3j.abi.datatypes.DynamicArray(StoredBatchInfo.class, _committedBatches), _proof), Collections.>emptyList()); return executeRemoteCallTransaction(function); @@ -1285,38 +1269,38 @@ public RemoteFunctionCall proveBatchesSharedBridge(BigIntege public RemoteFunctionCall proveL1ToL2TransactionStatus(byte[] _l2TxHash, BigInteger _l2BatchNumber, BigInteger _l2MessageIndex, BigInteger _l2TxNumberInBatch, List _merkleProof, BigInteger _status) { final Function function = new Function(FUNC_PROVEL1TOL2TRANSACTIONSTATUS, - Arrays.asList(new Bytes32(_l2TxHash), - new Uint256(_l2BatchNumber), - new Uint256(_l2MessageIndex), - new Uint16(_l2TxNumberInBatch), - new DynamicArray( - Bytes32.class, - org.web3j.abi.Utils.typeMap(_merkleProof, Bytes32.class)), - new Uint8(_status)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Bytes32(_l2TxHash), + new org.web3j.abi.datatypes.generated.Uint256(_l2BatchNumber), + new org.web3j.abi.datatypes.generated.Uint256(_l2MessageIndex), + new org.web3j.abi.datatypes.generated.Uint16(_l2TxNumberInBatch), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes32.class, + org.web3j.abi.Utils.typeMap(_merkleProof, org.web3j.abi.datatypes.generated.Bytes32.class)), + new org.web3j.abi.datatypes.generated.Uint8(_status)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall proveL2LogInclusion(BigInteger _batchNumber, BigInteger _index, L2Log _log, List _proof) { final Function function = new Function(FUNC_PROVEL2LOGINCLUSION, - Arrays.asList(new Uint256(_batchNumber), - new Uint256(_index), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_batchNumber), + new org.web3j.abi.datatypes.generated.Uint256(_index), _log, - new DynamicArray( - Bytes32.class, - org.web3j.abi.Utils.typeMap(_proof, Bytes32.class))), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes32.class, + org.web3j.abi.Utils.typeMap(_proof, org.web3j.abi.datatypes.generated.Bytes32.class))), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } public RemoteFunctionCall proveL2MessageInclusion(BigInteger _batchNumber, BigInteger _index, L2Message _message, List _proof) { final Function function = new Function(FUNC_PROVEL2MESSAGEINCLUSION, - Arrays.asList(new Uint256(_batchNumber), - new Uint256(_index), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_batchNumber), + new org.web3j.abi.datatypes.generated.Uint256(_index), _message, - new DynamicArray( - Bytes32.class, - org.web3j.abi.Utils.typeMap(_proof, Bytes32.class))), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes32.class, + org.web3j.abi.Utils.typeMap(_proof, org.web3j.abi.datatypes.generated.Bytes32.class))), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, Boolean.class); } @@ -1324,15 +1308,15 @@ public RemoteFunctionCall proveL2MessageInclusion(BigInteger _batchNumb public RemoteFunctionCall requestL2Transaction(String _contractL2, BigInteger _l2Value, byte[] _calldata, BigInteger _l2GasLimit, BigInteger _l2GasPerPubdataByteLimit, List _factoryDeps, String _refundRecipient, BigInteger weiValue) { final Function function = new Function( FUNC_REQUESTL2TRANSACTION, - Arrays.asList(new Address(160, _contractL2), - new Uint256(_l2Value), - new DynamicBytes(_calldata), - new Uint256(_l2GasLimit), - new Uint256(_l2GasPerPubdataByteLimit), - new DynamicArray( - DynamicBytes.class, - org.web3j.abi.Utils.typeMap(_factoryDeps, DynamicBytes.class)), - new Address(160, _refundRecipient)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _contractL2), + new org.web3j.abi.datatypes.generated.Uint256(_l2Value), + new org.web3j.abi.datatypes.DynamicBytes(_calldata), + new org.web3j.abi.datatypes.generated.Uint256(_l2GasLimit), + new org.web3j.abi.datatypes.generated.Uint256(_l2GasPerPubdataByteLimit), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.DynamicBytes.class, + org.web3j.abi.Utils.typeMap(_factoryDeps, org.web3j.abi.datatypes.DynamicBytes.class)), + new org.web3j.abi.datatypes.Address(160, _refundRecipient)), Collections.>emptyList()); return executeRemoteCallTransaction(function, weiValue); } @@ -1340,7 +1324,7 @@ public RemoteFunctionCall requestL2Transaction(String _contr public RemoteFunctionCall revertBatches(BigInteger _newLastBatch) { final Function function = new Function( FUNC_REVERTBATCHES, - Arrays.asList(new Uint256(_newLastBatch)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_newLastBatch)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1348,8 +1332,8 @@ public RemoteFunctionCall revertBatches(BigInteger _newLastB public RemoteFunctionCall revertBatchesSharedBridge(BigInteger _chainId, BigInteger _newLastBatch) { final Function function = new Function( FUNC_REVERTBATCHESSHAREDBRIDGE, - Arrays.asList(new Uint256(_chainId), - new Uint256(_newLastBatch)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_chainId), + new org.web3j.abi.datatypes.generated.Uint256(_newLastBatch)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1357,7 +1341,7 @@ public RemoteFunctionCall revertBatchesSharedBridge(BigInteg public RemoteFunctionCall setPendingAdmin(String _newPendingAdmin) { final Function function = new Function( FUNC_SETPENDINGADMIN, - Arrays.asList(new Address(160, _newPendingAdmin)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _newPendingAdmin)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1365,7 +1349,7 @@ public RemoteFunctionCall setPendingAdmin(String _newPending public RemoteFunctionCall setPorterAvailability(Boolean _zkPorterIsAvailable) { final Function function = new Function( FUNC_SETPORTERAVAILABILITY, - Arrays.asList(new Bool(_zkPorterIsAvailable)), + Arrays.asList(new org.web3j.abi.datatypes.Bool(_zkPorterIsAvailable)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1373,7 +1357,15 @@ public RemoteFunctionCall setPorterAvailability(Boolean _zkP public RemoteFunctionCall setPriorityTxMaxGasLimit(BigInteger _newPriorityTxMaxGasLimit) { final Function function = new Function( FUNC_SETPRIORITYTXMAXGASLIMIT, - Arrays.asList(new Uint256(_newPriorityTxMaxGasLimit)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_newPriorityTxMaxGasLimit)), + Collections.>emptyList()); + return executeRemoteCallTransaction(function); + } + + public RemoteFunctionCall setPubdataPricingMode(BigInteger _pricingMode) { + final Function function = new Function( + FUNC_SETPUBDATAPRICINGMODE, + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint8(_pricingMode)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1381,8 +1373,8 @@ public RemoteFunctionCall setPriorityTxMaxGasLimit(BigIntege public RemoteFunctionCall setTokenMultiplier(BigInteger _nominator, BigInteger _denominator) { final Function function = new Function( FUNC_SETTOKENMULTIPLIER, - Arrays.asList(new Uint128(_nominator), - new Uint128(_denominator)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint128(_nominator), + new org.web3j.abi.datatypes.generated.Uint128(_denominator)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1390,7 +1382,7 @@ public RemoteFunctionCall setTokenMultiplier(BigInteger _nom public RemoteFunctionCall setTransactionFilterer(String _transactionFilterer) { final Function function = new Function( FUNC_SETTRANSACTIONFILTERER, - Arrays.asList(new Address(160, _transactionFilterer)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _transactionFilterer)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @@ -1398,23 +1390,15 @@ public RemoteFunctionCall setTransactionFilterer(String _tra public RemoteFunctionCall setValidator(String _validator, Boolean _active) { final Function function = new Function( FUNC_SETVALIDATOR, - Arrays.asList(new Address(160, _validator), - new Bool(_active)), - Collections.>emptyList()); - return executeRemoteCallTransaction(function); - } - - public RemoteFunctionCall setValidiumMode(BigInteger _validiumMode) { - final Function function = new Function( - FUNC_SETVALIDIUMMODE, - Arrays.asList(new Uint8(_validiumMode)), + Arrays.asList(new org.web3j.abi.datatypes.Address(160, _validator), + new org.web3j.abi.datatypes.Bool(_active)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall storedBatchHash(BigInteger _batchNumber) { final Function function = new Function(FUNC_STOREDBATCHHASH, - Arrays.asList(new Uint256(_batchNumber)), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_batchNumber)), Arrays.>asList(new TypeReference() {})); return executeRemoteCallSingleValueReturn(function, byte[].class); } @@ -1438,28 +1422,28 @@ public RemoteFunctionCall unfreezeDiamond() { public RemoteFunctionCall upgradeChainFromVersion(BigInteger _protocolVersion, DiamondCutData _cutData) { final Function function = new Function( FUNC_UPGRADECHAINFROMVERSION, - Arrays.asList(new Uint256(_protocolVersion), + Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(_protocolVersion), _cutData), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @Deprecated - public static IZkSyncStateTransition load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { - return new IZkSyncStateTransition(contractAddress, web3j, credentials, gasPrice, gasLimit); + public static IZkSyncHyperchain load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { + return new IZkSyncHyperchain(contractAddress, web3j, credentials, gasPrice, gasLimit); } @Deprecated - public static IZkSyncStateTransition load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { - return new IZkSyncStateTransition(contractAddress, web3j, transactionManager, gasPrice, gasLimit); + public static IZkSyncHyperchain load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { + return new IZkSyncHyperchain(contractAddress, web3j, transactionManager, gasPrice, gasLimit); } - public static IZkSyncStateTransition load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { - return new IZkSyncStateTransition(contractAddress, web3j, credentials, contractGasProvider); + public static IZkSyncHyperchain load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { + return new IZkSyncHyperchain(contractAddress, web3j, credentials, contractGasProvider); } - public static IZkSyncStateTransition load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { - return new IZkSyncStateTransition(contractAddress, web3j, transactionManager, contractGasProvider); + public static IZkSyncHyperchain load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { + return new IZkSyncHyperchain(contractAddress, web3j, transactionManager, contractGasProvider); } public static class FacetCut extends DynamicStruct { @@ -1472,12 +1456,12 @@ public static class FacetCut extends DynamicStruct { public List selectors; public FacetCut(String facet, BigInteger action, Boolean isFreezable, List selectors) { - super(new Address(160, facet), - new Uint8(action), - new Bool(isFreezable), - new DynamicArray( - Bytes4.class, - org.web3j.abi.Utils.typeMap(selectors, Bytes4.class))); + super(new org.web3j.abi.datatypes.Address(160, facet), + new org.web3j.abi.datatypes.generated.Uint8(action), + new org.web3j.abi.datatypes.Bool(isFreezable), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes4.class, + org.web3j.abi.Utils.typeMap(selectors, org.web3j.abi.datatypes.generated.Bytes4.class))); this.facet = facet; this.action = action; this.isFreezable = isFreezable; @@ -1507,12 +1491,12 @@ public static class FeeParams extends StaticStruct { public BigInteger minimalL2GasPrice; public FeeParams(BigInteger pubdataPricingMode, BigInteger batchOverheadL1Gas, BigInteger maxPubdataPerBatch, BigInteger maxL2GasPerBatch, BigInteger priorityTxMaxPubdata, BigInteger minimalL2GasPrice) { - super(new Uint8(pubdataPricingMode), - new Uint32(batchOverheadL1Gas), - new Uint32(maxPubdataPerBatch), - new Uint32(maxL2GasPerBatch), - new Uint32(priorityTxMaxPubdata), - new Uint64(minimalL2GasPrice)); + super(new org.web3j.abi.datatypes.generated.Uint8(pubdataPricingMode), + new org.web3j.abi.datatypes.generated.Uint32(batchOverheadL1Gas), + new org.web3j.abi.datatypes.generated.Uint32(maxPubdataPerBatch), + new org.web3j.abi.datatypes.generated.Uint32(maxL2GasPerBatch), + new org.web3j.abi.datatypes.generated.Uint32(priorityTxMaxPubdata), + new org.web3j.abi.datatypes.generated.Uint64(minimalL2GasPrice)); this.pubdataPricingMode = pubdataPricingMode; this.batchOverheadL1Gas = batchOverheadL1Gas; this.maxPubdataPerBatch = maxPubdataPerBatch; @@ -1566,26 +1550,26 @@ public static class L2CanonicalTransaction extends DynamicStruct { public byte[] reservedDynamic; public L2CanonicalTransaction(BigInteger txType, BigInteger from, BigInteger to, BigInteger gasLimit, BigInteger gasPerPubdataByteLimit, BigInteger maxFeePerGas, BigInteger maxPriorityFeePerGas, BigInteger paymaster, BigInteger nonce, BigInteger value, List reserved, byte[] data, byte[] signature, List factoryDeps, byte[] paymasterInput, byte[] reservedDynamic) { - super(new Uint256(txType), - new Uint256(from), - new Uint256(to), - new Uint256(gasLimit), - new Uint256(gasPerPubdataByteLimit), - new Uint256(maxFeePerGas), - new Uint256(maxPriorityFeePerGas), - new Uint256(paymaster), - new Uint256(nonce), - new Uint256(value), - new StaticArray4( - Uint256.class, - org.web3j.abi.Utils.typeMap(reserved, Uint256.class)), - new DynamicBytes(data), - new DynamicBytes(signature), - new DynamicArray( - Uint256.class, - org.web3j.abi.Utils.typeMap(factoryDeps, Uint256.class)), - new DynamicBytes(paymasterInput), - new DynamicBytes(reservedDynamic)); + super(new org.web3j.abi.datatypes.generated.Uint256(txType), + new org.web3j.abi.datatypes.generated.Uint256(from), + new org.web3j.abi.datatypes.generated.Uint256(to), + new org.web3j.abi.datatypes.generated.Uint256(gasLimit), + new org.web3j.abi.datatypes.generated.Uint256(gasPerPubdataByteLimit), + new org.web3j.abi.datatypes.generated.Uint256(maxFeePerGas), + new org.web3j.abi.datatypes.generated.Uint256(maxPriorityFeePerGas), + new org.web3j.abi.datatypes.generated.Uint256(paymaster), + new org.web3j.abi.datatypes.generated.Uint256(nonce), + new org.web3j.abi.datatypes.generated.Uint256(value), + new org.web3j.abi.datatypes.generated.StaticArray4( + org.web3j.abi.datatypes.generated.Uint256.class, + org.web3j.abi.Utils.typeMap(reserved, org.web3j.abi.datatypes.generated.Uint256.class)), + new org.web3j.abi.datatypes.DynamicBytes(data), + new org.web3j.abi.datatypes.DynamicBytes(signature), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Uint256.class, + org.web3j.abi.Utils.typeMap(factoryDeps, org.web3j.abi.datatypes.generated.Uint256.class)), + new org.web3j.abi.datatypes.DynamicBytes(paymasterInput), + new org.web3j.abi.datatypes.DynamicBytes(reservedDynamic)); this.txType = txType; this.from = from; this.to = to; @@ -1645,17 +1629,17 @@ public static class BridgehubL2TransactionRequest extends DynamicStruct { public String refundRecipient; public BridgehubL2TransactionRequest(String sender, String contractL2, BigInteger mintValue, BigInteger l2Value, byte[] l2Calldata, BigInteger l2GasLimit, BigInteger l2GasPerPubdataByteLimit, List factoryDeps, String refundRecipient) { - super(new Address(160, sender), - new Address(160, contractL2), - new Uint256(mintValue), - new Uint256(l2Value), - new DynamicBytes(l2Calldata), - new Uint256(l2GasLimit), - new Uint256(l2GasPerPubdataByteLimit), - new DynamicArray( - DynamicBytes.class, - org.web3j.abi.Utils.typeMap(factoryDeps, DynamicBytes.class)), - new Address(160, refundRecipient)); + super(new org.web3j.abi.datatypes.Address(160, sender), + new org.web3j.abi.datatypes.Address(160, contractL2), + new org.web3j.abi.datatypes.generated.Uint256(mintValue), + new org.web3j.abi.datatypes.generated.Uint256(l2Value), + new org.web3j.abi.datatypes.DynamicBytes(l2Calldata), + new org.web3j.abi.datatypes.generated.Uint256(l2GasLimit), + new org.web3j.abi.datatypes.generated.Uint256(l2GasPerPubdataByteLimit), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.DynamicBytes.class, + org.web3j.abi.Utils.typeMap(factoryDeps, org.web3j.abi.datatypes.DynamicBytes.class)), + new org.web3j.abi.datatypes.Address(160, refundRecipient)); this.sender = sender; this.contractL2 = contractL2; this.mintValue = mintValue; @@ -1699,14 +1683,14 @@ public static class StoredBatchInfo extends StaticStruct { public byte[] commitment; public StoredBatchInfo(BigInteger batchNumber, byte[] batchHash, BigInteger indexRepeatedStorageChanges, BigInteger numberOfLayer1Txs, byte[] priorityOperationsHash, byte[] l2LogsTreeRoot, BigInteger timestamp, byte[] commitment) { - super(new Uint64(batchNumber), - new Bytes32(batchHash), - new Uint64(indexRepeatedStorageChanges), - new Uint256(numberOfLayer1Txs), - new Bytes32(priorityOperationsHash), - new Bytes32(l2LogsTreeRoot), - new Uint256(timestamp), - new Bytes32(commitment)); + super(new org.web3j.abi.datatypes.generated.Uint64(batchNumber), + new org.web3j.abi.datatypes.generated.Bytes32(batchHash), + new org.web3j.abi.datatypes.generated.Uint64(indexRepeatedStorageChanges), + new org.web3j.abi.datatypes.generated.Uint256(numberOfLayer1Txs), + new org.web3j.abi.datatypes.generated.Bytes32(priorityOperationsHash), + new org.web3j.abi.datatypes.generated.Bytes32(l2LogsTreeRoot), + new org.web3j.abi.datatypes.generated.Uint256(timestamp), + new org.web3j.abi.datatypes.generated.Bytes32(commitment)); this.batchNumber = batchNumber; this.batchHash = batchHash; this.indexRepeatedStorageChanges = indexRepeatedStorageChanges; @@ -1752,16 +1736,16 @@ public static class CommitBatchInfo extends DynamicStruct { public byte[] pubdataCommitments; public CommitBatchInfo(BigInteger batchNumber, BigInteger timestamp, BigInteger indexRepeatedStorageChanges, byte[] newStateRoot, BigInteger numberOfLayer1Txs, byte[] priorityOperationsHash, byte[] bootloaderHeapInitialContentsHash, byte[] eventsQueueStateHash, byte[] systemLogs, byte[] pubdataCommitments) { - super(new Uint64(batchNumber), - new Uint64(timestamp), - new Uint64(indexRepeatedStorageChanges), - new Bytes32(newStateRoot), - new Uint256(numberOfLayer1Txs), - new Bytes32(priorityOperationsHash), - new Bytes32(bootloaderHeapInitialContentsHash), - new Bytes32(eventsQueueStateHash), - new DynamicBytes(systemLogs), - new DynamicBytes(pubdataCommitments)); + super(new org.web3j.abi.datatypes.generated.Uint64(batchNumber), + new org.web3j.abi.datatypes.generated.Uint64(timestamp), + new org.web3j.abi.datatypes.generated.Uint64(indexRepeatedStorageChanges), + new org.web3j.abi.datatypes.generated.Bytes32(newStateRoot), + new org.web3j.abi.datatypes.generated.Uint256(numberOfLayer1Txs), + new org.web3j.abi.datatypes.generated.Bytes32(priorityOperationsHash), + new org.web3j.abi.datatypes.generated.Bytes32(bootloaderHeapInitialContentsHash), + new org.web3j.abi.datatypes.generated.Bytes32(eventsQueueStateHash), + new org.web3j.abi.datatypes.DynamicBytes(systemLogs), + new org.web3j.abi.datatypes.DynamicBytes(pubdataCommitments)); this.batchNumber = batchNumber; this.timestamp = timestamp; this.indexRepeatedStorageChanges = indexRepeatedStorageChanges; @@ -1795,10 +1779,10 @@ public static class Facet extends DynamicStruct { public List selectors; public Facet(String addr, List selectors) { - super(new Address(160, addr), - new DynamicArray( - Bytes4.class, - org.web3j.abi.Utils.typeMap(selectors, Bytes4.class))); + super(new org.web3j.abi.datatypes.Address(160, addr), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Bytes4.class, + org.web3j.abi.Utils.typeMap(selectors, org.web3j.abi.datatypes.generated.Bytes4.class))); this.addr = addr; this.selectors = selectors; } @@ -1818,9 +1802,9 @@ public static class VerifierParams extends StaticStruct { public byte[] recursionCircuitsSetVksHash; public VerifierParams(byte[] recursionNodeLevelVkHash, byte[] recursionLeafLevelVkHash, byte[] recursionCircuitsSetVksHash) { - super(new Bytes32(recursionNodeLevelVkHash), - new Bytes32(recursionLeafLevelVkHash), - new Bytes32(recursionCircuitsSetVksHash)); + super(new org.web3j.abi.datatypes.generated.Bytes32(recursionNodeLevelVkHash), + new org.web3j.abi.datatypes.generated.Bytes32(recursionLeafLevelVkHash), + new org.web3j.abi.datatypes.generated.Bytes32(recursionCircuitsSetVksHash)); this.recursionNodeLevelVkHash = recursionNodeLevelVkHash; this.recursionLeafLevelVkHash = recursionLeafLevelVkHash; this.recursionCircuitsSetVksHash = recursionCircuitsSetVksHash; @@ -1842,9 +1826,9 @@ public static class PriorityOperation extends StaticStruct { public BigInteger layer2Tip; public PriorityOperation(byte[] canonicalTxHash, BigInteger expirationTimestamp, BigInteger layer2Tip) { - super(new Bytes32(canonicalTxHash), - new Uint64(expirationTimestamp), - new Uint192(layer2Tip)); + super(new org.web3j.abi.datatypes.generated.Bytes32(canonicalTxHash), + new org.web3j.abi.datatypes.generated.Uint64(expirationTimestamp), + new org.web3j.abi.datatypes.generated.Uint192(layer2Tip)); this.canonicalTxHash = canonicalTxHash; this.expirationTimestamp = expirationTimestamp; this.layer2Tip = layer2Tip; @@ -1864,12 +1848,12 @@ public static class ProofInput extends DynamicStruct { public List serializedProof; public ProofInput(List recursiveAggregationInput, List serializedProof) { - super(new DynamicArray( - Uint256.class, - org.web3j.abi.Utils.typeMap(recursiveAggregationInput, Uint256.class)), - new DynamicArray( - Uint256.class, - org.web3j.abi.Utils.typeMap(serializedProof, Uint256.class))); + super(new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Uint256.class, + org.web3j.abi.Utils.typeMap(recursiveAggregationInput, org.web3j.abi.datatypes.generated.Uint256.class)), + new org.web3j.abi.datatypes.DynamicArray( + org.web3j.abi.datatypes.generated.Uint256.class, + org.web3j.abi.Utils.typeMap(serializedProof, org.web3j.abi.datatypes.generated.Uint256.class))); this.recursiveAggregationInput = recursiveAggregationInput; this.serializedProof = serializedProof; } @@ -1895,12 +1879,12 @@ public static class L2Log extends StaticStruct { public byte[] value; public L2Log(BigInteger l2ShardId, Boolean isService, BigInteger txNumberInBatch, String sender, byte[] key, byte[] value) { - super(new Uint8(l2ShardId), - new Bool(isService), - new Uint16(txNumberInBatch), - new Address(160, sender), - new Bytes32(key), - new Bytes32(value)); + super(new org.web3j.abi.datatypes.generated.Uint8(l2ShardId), + new org.web3j.abi.datatypes.Bool(isService), + new org.web3j.abi.datatypes.generated.Uint16(txNumberInBatch), + new org.web3j.abi.datatypes.Address(160, sender), + new org.web3j.abi.datatypes.generated.Bytes32(key), + new org.web3j.abi.datatypes.generated.Bytes32(value)); this.l2ShardId = l2ShardId; this.isService = isService; this.txNumberInBatch = txNumberInBatch; @@ -1928,9 +1912,9 @@ public static class L2Message extends DynamicStruct { public byte[] data; public L2Message(BigInteger txNumberInBatch, String sender, byte[] data) { - super(new Uint16(txNumberInBatch), - new Address(160, sender), - new DynamicBytes(data)); + super(new org.web3j.abi.datatypes.generated.Uint16(txNumberInBatch), + new org.web3j.abi.datatypes.Address(160, sender), + new org.web3j.abi.datatypes.DynamicBytes(data)); this.txNumberInBatch = txNumberInBatch; this.sender = sender; this.data = data; @@ -1952,9 +1936,9 @@ public static class DiamondCutData extends DynamicStruct { public byte[] initCalldata; public DiamondCutData(List facetCuts, String initAddress, byte[] initCalldata) { - super(new DynamicArray(FacetCut.class, facetCuts), - new Address(160, initAddress), - new DynamicBytes(initCalldata)); + super(new org.web3j.abi.datatypes.DynamicArray(FacetCut.class, facetCuts), + new org.web3j.abi.datatypes.Address(160, initAddress), + new org.web3j.abi.datatypes.DynamicBytes(initCalldata)); this.facetCuts = facetCuts; this.initAddress = initAddress; this.initCalldata = initCalldata; @@ -1998,12 +1982,6 @@ public static class BlocksVerificationEventResponse extends BaseEventResponse { public BigInteger currentLastVerifiedBatch; } - public static class EthWithdrawalFinalizedEventResponse extends BaseEventResponse { - public String to; - - public BigInteger amount; - } - public static class ExecuteUpgradeEventResponse extends BaseEventResponse { public DiamondCutData diamondCut; }