I am trying to estimateGas for an Ethereum transaction with ethers signer.estimateGas(). This transaction should execute several trades on arbitrary DEXs.
To execute the transaction approvals of ERC-20 tokens are required. However I would like to estimate the gas without executing the approvals first. Is it somehow possible to "simulate" the execution of approvals first and then be able to estimate the gas units for the transaction that requires the approvals?
GetState()
github.com/ethereum/go-ethereum/blob/… and you would need to dobytes.Compare()
withs.address
(to make sure the contract is right) and thekey
must be the address of the allowance value of that user you are trying to fake the transaction of