0

I did the zksync-era contract access by accessing other evm-based public chains with the following code example:

org.web3j.protocol.core.methods.request.Transaction transaction = org.web3j.protocol.core.methods.request.Transaction.createFunctionCallTransaction(
                airdropWallet.getAddress(),
                nonce,
                BigInteger.ZERO,
                BigInteger.ZERO,
                router,
                amount,
                swapEthEncode);
        EthEstimateGas ethEstimateGas = web3j
                .ethEstimateGas(transaction).send();
        BigInteger gasPrice = web3j.ethGasPrice().send().getGasPrice();
        BigInteger gasLimit = ethEstimateGas.getAmountUsed();
        RawTransaction rawTransaction = RawTransaction.createTransaction(nonce, gasPrice, gasLimit, router, amount, swapEthEncode);
        return sendTxForEvm(airdropWallet, web3j, rawTransaction);

But the final result of the visit showed that my balance was 0, which was not possible and I was sure that my balance could support this transaction

insufficient funds for gas + value. balance: 0, fee: 534544000000000, value: 500000000000000

TylerH
  • 20,799
  • 66
  • 75
  • 101
Wren Jiao
  • 1
  • 1

0 Answers0