Search code examples
reactjsethereumweb3jsmetamask

How to get ethereum contract public variables?


I want to get bool paused; in my react application without transaction. It is implemented in myetherwallet.com contract gui. How can i do this? If possible i want to do this with mappings too.


Solution

  • You need to use the call method; it is evaluated directly on local node without sending transaction to the blockchain.

    https://ethereum.stackexchange.com/questions/765/what-is-the-difference-between-a-transaction-and-a-call/770#770