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.
Is there a way to call a contract that then sends multiple transactions each with different gas price
You can create a smart contract function with multiple try-catch that uses something like this
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
But that only allows me to call the contract with the given
gasLimitparameter - I would like to call the contract that will call some other functions with a given
maxPriorityFee. So to create multiple transactions.– KacperFeb 8 at 13:58
Yes, you can write something like this:
But that only changes gas limit that transaction has, and I would like to specify
maxPriorityFee– KacperFeb 8 at 19:53
You can only specify those on transaction level, since they re relevant for validators not the actual function. Feb 8 at 20:03