Wren il y a 1 an
Parent
commit
031131bdcd

+ 1 - 0
src/main/java/com/ichaoj/ams/script/IScript.java

@@ -44,6 +44,7 @@ public abstract class IScript {
     @SneakyThrows
     protected SResult sendTxForEvm(AirdropWallet airdropWallet, Web3j web3j, RawTransaction etherTransaction) {
         Credentials credentials = Web3Util.getCredentials(airdropWallet);
+
         byte[] signMessage = TransactionEncoder.signMessage(etherTransaction, credentials);
         String hexValue = Numeric.toHexString(signMessage);
         EthSendTransaction ethSendTransaction = web3j.ethSendRawTransaction(hexValue).send();

+ 3 - 2
src/main/java/com/ichaoj/ams/script/zksync2/cross/ZkSyncCrossScript.java

@@ -84,18 +84,19 @@ public class ZkSyncCrossScript extends IScript {
                 ListUtil.of(new TypeReference<Bytes32>() {
                 }));
         BigInteger nonce = Web3Util.getNonce(web3j, airdropWallet.getAddress());
-        BigInteger gasPrice = web3j.ethGasPrice().send().getGasPrice();
+
         String l2Encoder = FunctionEncoder.encode(requestL2Transaction);
 
         BigDecimal value = Convert.toWei(amount.add(new BigDecimal(l2Gas.getValue())), Convert.Unit.ETHER);
         Transaction callTransaction = Transaction.createFunctionCallTransaction(
                 airdropWallet.getAddress(),
                 nonce,
-                gasPrice,
+                BigInteger.ZERO,
                 BigInteger.valueOf(0),
                 mailBox,
                 value.toBigInteger(),
                 l2Encoder);
+        BigInteger gasPrice = web3j.ethGasPrice().send().getGasPrice();
         BigInteger gasLimit = Web3Util.getTransactionGasLimit(web3j, callTransaction);
         gasLimit = BigDecimal.valueOf(1.3).multiply(new BigDecimal(gasLimit)).toBigInteger();
         RawTransaction rawTransaction = RawTransaction.createTransaction(nonce,