Calling a view function
A view
function does not use gas
when called, but if we decide to call a view function inside of another function which is a transaction, it then uses gas
.
Even if you make a function a view
function, you still have to pay full gas costs if it's being called inside a transaction. Such view
functions are only free if called locally, not inside a transaction.
calling
getNumberAt
uses no gas
Last updated