"Missing revert data" as error message to wrong contract call #2958
Unanswered
grapevinegizmos
asked this question in
Q&A
Replies: 2 comments
-
"Missing revert data" means that the contract just plainly reverted without any data. It's difficult to tell with this whether the function existed or not as it is possible that the function exists but went over a revert statement in the code. But I hear this is a pain, I've myself been stuck being a newbie as well as seen past colleagues getting stuck with this particular issue. |
Beta Was this translation helpful? Give feedback.
0 replies
-
What it actually meant in this case is the contract at the given address did not contain the function specified in the abi which was called. The error message is particularly opaque in a case like this-- is it not possible to identify that the called function doesn't exist on the contract instead of returning the suggestion that it "reverted" for an u known reason?. i spent quite some time investigating how it is possible that the function coculd revert before i figured out that it must not exist in the first place. This was because i suppliedthe wrong address to the Contract constructor. Is there no way to determine if the abi conforms to the actual deployed contract and return a more informative error message? Maybe "something went wrong" would at least be less misleading.
…Sent from my iPhone
On May 3, 2022, at 8:46 PM, soham ***@***.***> wrote:
"Missing revert data" means that the contract just plainly reverted without any data. It's difficult to tell with this whether the function existed or not as it is possible that the function exists but went over a revert statement in the code.
But I hear this is a pain, I've myself been stuck being a newbie as well as seen past colleagues getting stuck with this particular issue.
—
Reply to this email directly, view it on GitHub<#2958 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACCIEBJHDLJ2HJRMUEBOXVLVIHXKDANCNFSM5U7FFS7A>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When you create a contract with `myContract = new ethers.Contract(address, abi, signer) and you supply the wrong address parameter to a contract which does in fact exist but doesn't conform to the provided abi, you get an error that looks like this:
In this case, the error was the result of calling a function that existed in the abi, but did not actually exist on the contract which was provided in the address parameter. I don't know how hard this would actually be, but it certainly would have saved me a lot of time if the error code was `something like function does not exist on contract' rather than 'missing revert data in call exception, Transaction reverted without a reason string'.
Is there some way to check and return an error if the abi doesn't match the contract deployed at the given address? Or failing that, if a function is called which doesn't actually exist on the deployed contract?
I think it might save a lot of debugging time for people encountering this problem.
Beta Was this translation helpful? Give feedback.
All reactions