@jhubbardsf/ethers-decode-error
Version:
Decode ethers.js smart contract errors into human-readable messages
3 lines (2 loc) • 918 B
JavaScript
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((e||self).ethersDecodeError={})}(this,function(e){e.panicErrorCodeToReason=function(e){switch(e.toNumber()){case 1:return"Assertion error";case 17:return"Arithmetic operation underflowed or overflowed outside of an unchecked block";case 18:return"Division or modulo division by zero";case 33:return"Tried to convert a value into an enum, but the value was too big or negative";case 34:return"Incorrectly encoded storage byte array";case 49:return".pop() was called on an empty array";case 50:return"Array accessed at an out-of-bounds or negative index";case 65:return"Too much memory was allocated, or an array was created that is too large";case 81:return"Called a zero-initialized variable of internal function type";default:return}}});
//# sourceMappingURL=panic.umd.js.map