flashbots / flashbots/ethers-provider-flashbots-bundle

signBundle bundle used too little gas

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

Description

Hi, well I don't know if this provider is only for transfers transactions, if so, my question doesn't have a point. But, if this module was built to support contract interactions so I want to know if I am doing something wrong. I have the following code:

```
const GWEI = 10n ** 9n
const CHAIN_ID = 5
const FLASHBOTS_ENDPOINT = 'https://relay-goerli.flashbots.net'
const provider = new providers.InfuraProvider('goerli', process.env.INFURA_API_KEY)
const signer = Wallet.createRandom()
const flashbot = await FlashbotsBundleProvider.create(provider, signer, FLASHBOTS_ENDPOINT)
const valueToSendParsed = utils.parseEther('0.01')
const encodedData = '0x7ff36ab500000000000000000000000000000000000000000000000016498f36d4b30300000000000000000000000000000000000000000000000000000000000000008000000000000000000000000054a1c450e8cf7dcde904aa9340375ced46d1cc8c00000000000000000000000000000000000000000000000000000180b94bcbd00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d60000000000000000000000009fffb5a9f5c6a55fa802318ff49936e672399b56'

const signedTx = await flashbot.signBundle([
{
signer: wallet,
transaction: {
chainId: CHAIN_ID,
// EIP 1559 transaction
type: 2,
value: valueToSendParsed,
data: encodedData,
maxFeePerGas: GWEI * 3n,
maxPriorityFeePerGas: GWEI * 2n,
gasLimit: 300000,
to: process.env.ROUTER_CONTRACT_ADDRESS
}
}
])
```

The method `signBundle` always return `body="{\"error\":{\"message\":\"bundle used too little gas, must use at least 42000\"}}"`, no matter if I increase the gas limit of the transaction. The data of the transaction is a swap of a DEX router. What am I doing wron? In advance thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.