Timeline for unexpected revert behaviour using custom errors in pure function
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 31, 2022 at 23:46 | answer | added | Giuseppe Bertone | timeline score: 2 | |
May 31, 2022 at 11:26 | comment | added | sola24 | thanks for the info. After reading your comments I've tried some other tests and re-worded the question. I couldn't recreate the issue on remix. I can recreate the problem without chai, so it looks like I'm having a local hardhat issue. I upgraded all the packages but same result with [email protected]. Any other ideas? | |
May 31, 2022 at 11:19 | history | edited | sola24 |
add hardhat tag
|
|
May 31, 2022 at 11:18 | history | edited | sola24 | CC BY-SA 4.0 |
reworded as have narrowed it down to a local hardhat issue
|
May 30, 2022 at 21:01 | history | edited | sola24 | CC BY-SA 4.0 |
added something else I discovered
|
May 30, 2022 at 20:16 | comment | added | hroussille |
@MajdTL is right, custom error codes collapse to function identifier allowing to identify the error type, there is no state access here. The whole function can be evaluated knowing only the source code, so pure is allowed and advised. What version of hardhat do you use ? Your test works fine on my side (hardhat 2.9.1 and 2.9.7).
|
|
May 30, 2022 at 20:13 | comment | added | Majd TL | why do you think that the errors are in the "state". Those are constants and probably stored in the contract code .not sure though | |
S May 30, 2022 at 20:00 | review | First questions | |||
May 30, 2022 at 21:38 | |||||
S May 30, 2022 at 20:00 | history | asked | sola24 | CC BY-SA 4.0 |