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.