The call method

The call method has resulted in a lot of confusion among developers. There is a call method available via the web3.eth object, and there is also the <<address>>.call function. These are two different functions that have different purposes.

The web3.eth call method can only make calls to a node it is connected to and is a read- only operation. It is not allowed to change the state of Ethereum. It does not generate a transaction nor does it consume any gas. It is used to call the pure, constant, and view functions.

On the other hand, call function provided by address data type can call any function available within a contract. There are times when the interface of contract, more commonly known as ABI, is not available, and so ...

Get Solidity Programming Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.