0

Is it possible to make a view function (that doesn't modify the state of the chain) that as a result of running would invoke another function, which modifies the state of the chain?

For example, make a function A view, which will return function B()?

My goal is to verify something inside the view function, and only if it's true, initiate the transaction (to save gas).

Thank you,

1 Answer 1

1

You can create a modifier with a condition in it and add it to the function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.