0

I was thinking if there was a way in solidity to send a bunch of presigned transactions with gasPrice argument. Then this contract would call all of these functions with specified gasPrice for each of them and if any of them goes through then it reverts the rest. Contract would work somewhat like a proxy. I know there is a solution which includes flashbot bundles but I would like to use solidity for that.

2 Answers 2

0

You can create a smart contract function with multiple try-catch that uses something like this

address.call.gas(50000).value(1 ether)(data);

and in each catch you add the call you want + return after. Once one call does not revert the function will be finished. It would work like a cascade since solidity is not multithreaded.

Take a look at first response from here if you want to see how to implement the "data" parameter: data parameter

1
  • But that only allows me to call the contract with the given gasLimit parameter - I would like to call the contract that will call some other functions with a given maxFeePerGas and maxPriorityFee. So to create multiple transactions.
    – Kacper
    Feb 8 at 13:58
0

Yes, you can write something like this:

 contract.function{gas: gasToUse}(parameters);
2
  • But that only changes gas limit that transaction has, and I would like to specify maxFeePerGas and maxPriorityFee
    – Kacper
    Feb 8 at 19:53
  • You can only specify those on transaction level, since they re relevant for validators not the actual function.
    – Nal Luksic
    Feb 8 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.