Skip to content

Providers do not support static calls using signed transactions #2745

Answered by zemse
m1cm1c asked this question in Q&A
Discussion options

You must be logged in to vote

I do not really see a reason why it should not be supported as passing a signed transaction to a provider would let you control msg.sender

Simulating a transaction using eth_estimateGas or eth_call, that allows you to control the msg.sender is very supported by the ethereum node (you can see rpc spec which allows specifying from as an address). Ethers.js also allows you to specify a plain from address, or also look for a signature as in your example.

await provider.estimateGas({
  to: '0xContractAddr',
  data: '0xData',
  from: '0xFriendsAddress'
})

There can be a number of use-cases, for example, if you want to see if a particular address can perform a transaction or not, and how much…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@m1cm1c
Comment options

@zemse
Comment options

zemse Mar 1, 2022
Collaborator

Answer selected by m1cm1c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2742 on March 01, 2022 05:00.