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
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
-
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 givenmaxFeePerGas
andmaxPriorityFee
. So to create multiple transactions.– KacperFeb 8 at 13:58
Yes, you can write something like this:
contract.function{gas: gasToUse}(parameters);
-
But that only changes gas limit that transaction has, and I would like to specify
maxFeePerGas
andmaxPriorityFee
– 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