Skip to content

Error: Execution reverted #2

@binora

Description

@binora

Hi, Thanks for the tutorial on flashbots. I'm able to send bundle to flasbots goerli relayer but I'm getting error: execution reverted

Code:

async function main() {
    const flashbotsProvider = await FlashbotsBundleProvider.create(provider, Wallet.createRandom(), FLASHBOTS_RELAY_GOERLI)
    const block = await provider.getBlock("latest");
    const maxBaseFeeInFutureBlock = FlashbotsBundleProvider.getMaxBaseFeeInFutureBlock(block.baseFeePerGas, 1);
    const priorityFee = GWEI.mul(50);

    const transactions = [
            {
                transaction: {
                    chainId: CHAIN_ID,
                    type: 2,
                    value: ETHER.div(100).mul(3),
                    gasLimit: 50000,
                    data: "0x1249c58b",
                    maxFeePerGas: priorityFee.add(maxBaseFeeInFutureBlock),
                    maxPriorityFeePerGas: priorityFee,
                    to: "0x20EE855E43A7af19E407E39E5110c2C1Ee41F64D",
                },
                signer: wallet,
            }
        ]

    provider.on('block', async (blockNumber) => {
        console.log(blockNumber);

        const response = await flashbotsProvider.sendBundle(transactions, blockNumber + 1)
        console.log(await response.simulate())

        if ('error' in response) {
            console.log(response.error)
            return
        }

    })


}

console.log(await response.simulate()) outputs:

{
  bundleHash: '0x73b428ceb04de261de0357640938810694ec1789a29fdddeaac22e517c394f77',
  coinbaseDiff: BigNumber { _hex: '0x08d280b2237400', _isBigNumber: true },
  results: [
    {
      coinbaseDiff: '2483250000000000',
      error: 'execution reverted',
      ethSentToCoinbase: '0',
      fromAddress: '0x59aE28410f867f779Fd60059c7224f94a14eCA49',
      gasFees: '2483250000000000',
      gasPrice: '50000000000',
      gasUsed: 49665,
      toAddress: '0x20EE855E43A7af19E407E39E5110c2C1Ee41F64D',
      txHash: '0xda34f1f4eb61495540dd83f872d65fcadc03b2f3dedad83d708d9eda6276ac57'
    }
  ],
  totalGasUsed: 49665,
  firstRevert: undefined
}

What could be the reason for such error ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions