flashbots / flashbots/ethers-provider-flashbots-bundle

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

Open
#123 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
566
Forks
211
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file or test is named. Start by tracing FlashbotsBundleProvider.create, signBundle, and sendRawBundle, then verify the two constructed transactions and the signed bundle against the relay request; done means the bundle is accepted without the 400 unable-to-decode error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.