How to preverify calling a function of a contract

Hi everyone,

I’m learning about “Merkle state transition proof” or something similar. This mechanism allows the application to know in advance if there will be an error when calling a contract function. But I could not find a complete guide. I would like to make same function in nodejs. Anyone help me?

Thanks all.

How about this document: https://docs.openzeppelin.com/contracts/3.x/api/cryptography

2 Likes

Thanks for your suggestion. But it seems that this api is used when creating contracts. I mean, there is a mechanism that checks the condition before calling a contract. If it has an error then no transaction will be made. Hence unnecessary transaction fees can be saved.

1 Like

I found solution here
Thanks all.

1 Like

Hi @karmataktsang,

Nice. I hadn’t come across that before. Thanks for sharing. I marked your reply as the solution.