Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Execution reverted #2

Open
binora opened this issue Sep 12, 2021 · 3 comments
Open

Error: Execution reverted #2

binora opened this issue Sep 12, 2021 · 3 comments

Comments

@binora
Copy link

binora commented Sep 12, 2021

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 ?

@ngdekhai
Copy link

ngdekhai commented Oct 1, 2021

@binora are you able to solve the problem? I also have the same issue.

@binora
Copy link
Author

binora commented Oct 1, 2021

@ngdekhai Nope. Couldn't solve it.

@theharryszn
Copy link

I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants