ethers-provider-flashbots-bundle icon indicating copy to clipboard operation
ethers-provider-flashbots-bundle copied to clipboard

Always prompt Error: Request failed with status 400 (URL: https://relay.flashbots.net): {"error": "unable to decode txs"}

Open wozailashi94 opened this issue 10 months ago • 2 comments

Oh, my God, no matter how much I debug, it shows this.

Here is the part of my code

const flashbotsProvider = await FlashbotsBundleProvider.create(provider, sendWallet);

const bnbTx = { chainId: 56, type: 2, to: Wallet2.address, value: ethers.parseEther('0.001'), maxFeePerGas: ethers.parseUnits("3", "gwei"), maxPriorityFeePerGas: ethers.parseUnits("2", "gwei"), gasLimit: 21000, data: "0x", }; const usdtTx = { chainId: 56, type: 2, to: "Contract address", data: '0xa9059cbb000000000000000000000000' + receivingWallet.address.substring(2) + ethers.toBeHex(ethers.parseUnits('1', 18), 32).substr(2), maxFeePerGas: ethers.parseUnits("3", "gwei"), maxPriorityFeePerGas: ethers.parseUnits("2", "gwei"), gasLimit: 21000, value:ethers.parseUnits("0", 18), };

var signedBundle = await flashbotsProvider.signBundle([
    {
        signer: receivingWallet,
        transaction: bnbTx,
    },
    {
        signer:sendingWallet2,
        transaction: usdtTx,
    }
]);

const minTimestamp = (await provider.getBlock(blockNumber)).timestamp
const maxTimestamp = minTimestamp + 120

const res = await flashbotsProvider.sendRawBundle(signedBundle, blockNumber,{
    minTimestamp,
    maxTimestamp
  });

Package two transactions and submit them to the same block, but in the transaction are two different wallets

May God bless you. You can help me. God will bless you. I swear.

wozailashi94 avatar Apr 22 '24 09:04 wozailashi94

Yeah, i also got this error. Here my code.

const transaction = {
        from: signer.address,
        to: "0x4429B1e0BE0Af0dFFB3CAb40285CBBb631EE5656",
        data: "0x",
        value: ethers.parseEther("0.01"),
        maxFeePerGas: ethers.parseUnits("3", "gwei"),
        maxPriorityFeePerGas: ethers.parseUnits("2", "gwei"),
        gasLimit: 21000,
        chainId: 97
    }
    const transactionBundle = [
        {
            signer: signer, // ethers signer
            transaction: transaction // ethers populated transaction object
        }
    ]
    const simulation = await flashbotsProvider.simulate(signedTransactions, targetBlockNumber)

0xted97 avatar May 04 '24 14:05 0xted97

Error sending bundle with Flashbots: Error: Request failed with status 400 (URL: https://relay.flashbots.net): {"error":"unable to decode txs"} getting this error and so far i don't think anything i'm doing differently

aneebiqbal avatar Aug 03 '24 20:08 aneebiqbal