web3-eth-abi
Advanced tools
Comparing version 4.2.4-dev.9b32205.0 to 4.2.4-dev.b86d8ca.0
@@ -22,3 +22,3 @@ "use strict"; | ||
* this variable contains the precalculated limits for all the numbers for uint and int types | ||
*/ | ||
*/ | ||
exports.numberLimits = new Map(); | ||
@@ -25,0 +25,0 @@ let base = BigInt(256); // 2 ^ 8 = 256 |
@@ -37,2 +37,28 @@ "use strict"; | ||
} | ||
else if (error.data.startsWith('0x08c379a0')) { | ||
// If ABI was not provided, check for the 2 famous errors: 'Error(string)' or 'Panic(uint256)' | ||
errorName = 'Error'; | ||
errorSignature = 'Error(string)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = (0, parameters_api_js_1.decodeParameters)([ | ||
{ | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], error.data.substring(10)); | ||
} | ||
else if (error.data.startsWith('0x4e487b71')) { | ||
errorName = 'Panic'; | ||
errorSignature = 'Panic(uint256)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = (0, parameters_api_js_1.decodeParameters)([ | ||
{ | ||
name: 'code', | ||
type: 'uint256', | ||
}, | ||
], error.data.substring(10)); | ||
} | ||
else { | ||
console.error('No matching error abi found for error data', error.data); | ||
} | ||
} | ||
@@ -39,0 +65,0 @@ catch (err) { |
@@ -19,3 +19,3 @@ /* | ||
* this variable contains the precalculated limits for all the numbers for uint and int types | ||
*/ | ||
*/ | ||
export const numberLimits = new Map(); | ||
@@ -22,0 +22,0 @@ let base = BigInt(256); // 2 ^ 8 = 256 |
@@ -34,2 +34,28 @@ /* | ||
} | ||
else if (error.data.startsWith('0x08c379a0')) { | ||
// If ABI was not provided, check for the 2 famous errors: 'Error(string)' or 'Panic(uint256)' | ||
errorName = 'Error'; | ||
errorSignature = 'Error(string)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = decodeParameters([ | ||
{ | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], error.data.substring(10)); | ||
} | ||
else if (error.data.startsWith('0x4e487b71')) { | ||
errorName = 'Panic'; | ||
errorSignature = 'Panic(uint256)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = decodeParameters([ | ||
{ | ||
name: 'code', | ||
type: 'uint256', | ||
}, | ||
], error.data.substring(10)); | ||
} | ||
else { | ||
console.error('No matching error abi found for error data', error.data); | ||
} | ||
} | ||
@@ -36,0 +62,0 @@ catch (err) { |
{ | ||
"name": "web3-eth-abi", | ||
"version": "4.2.4-dev.9b32205.0+9b32205", | ||
"version": "4.2.4-dev.b86d8ca.0+b86d8ca", | ||
"description": "Web3 module encode and decode EVM in/output.", | ||
@@ -46,6 +46,6 @@ "main": "./lib/commonjs/index.js", | ||
"abitype": "0.7.1", | ||
"web3-errors": "1.3.1-dev.9b32205.0+9b32205", | ||
"web3-types": "1.7.1-dev.9b32205.0+9b32205", | ||
"web3-utils": "4.3.2-dev.9b32205.0+9b32205", | ||
"web3-validator": "2.0.7-dev.9b32205.0+9b32205" | ||
"web3-errors": "1.3.1-dev.b86d8ca.0+b86d8ca", | ||
"web3-types": "1.7.1-dev.b86d8ca.0+b86d8ca", | ||
"web3-utils": "4.3.2-dev.b86d8ca.0+b86d8ca", | ||
"web3-validator": "2.0.7-dev.b86d8ca.0+b86d8ca" | ||
}, | ||
@@ -69,3 +69,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "9b322052ef266cc57b29080b20053991e0c9a0a9" | ||
"gitHead": "b86d8cae50d60e56e96bde9d1b836ca01ecd0fbc" | ||
} |
@@ -19,3 +19,3 @@ /* | ||
/** | ||
* | ||
* | ||
* @module ABI | ||
@@ -22,0 +22,0 @@ */ |
@@ -19,3 +19,3 @@ /* | ||
/** | ||
* | ||
* | ||
* @module ABI | ||
@@ -22,0 +22,0 @@ */ |
@@ -19,3 +19,3 @@ /* | ||
/** | ||
* | ||
* | ||
* @module ABI | ||
@@ -22,0 +22,0 @@ */ |
@@ -19,3 +19,3 @@ /* | ||
/** | ||
* | ||
* | ||
* @module ABI | ||
@@ -22,0 +22,0 @@ */ |
@@ -19,3 +19,3 @@ /* | ||
/** | ||
* | ||
* | ||
* @module ABI | ||
@@ -31,3 +31,2 @@ */ | ||
/** | ||
@@ -34,0 +33,0 @@ * Encodes a parameter based on its type to its ABI representation. |
@@ -18,5 +18,5 @@ /* | ||
/* | ||
/* | ||
* this variable contains the precalculated limits for all the numbers for uint and int types | ||
*/ | ||
*/ | ||
export const numberLimits = new Map<string, { min: bigint; max: bigint }>(); | ||
@@ -23,0 +23,0 @@ |
@@ -42,2 +42,32 @@ /* | ||
errorArgs = decodeParameters([...errorAbi.inputs], error.data.substring(10)); | ||
} else if (error.data.startsWith('0x08c379a0')) { | ||
// If ABI was not provided, check for the 2 famous errors: 'Error(string)' or 'Panic(uint256)' | ||
errorName = 'Error'; | ||
errorSignature = 'Error(string)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = decodeParameters( | ||
[ | ||
{ | ||
name: 'message', | ||
type: 'string', | ||
}, | ||
], | ||
error.data.substring(10), | ||
); | ||
} else if (error.data.startsWith('0x4e487b71')) { | ||
errorName = 'Panic'; | ||
errorSignature = 'Panic(uint256)'; | ||
// decode abi.inputs according to EIP-838 | ||
errorArgs = decodeParameters( | ||
[ | ||
{ | ||
name: 'code', | ||
type: 'uint256', | ||
}, | ||
], | ||
error.data.substring(10), | ||
); | ||
} else { | ||
console.error('No matching error abi found for error data', error.data); | ||
} | ||
@@ -44,0 +74,0 @@ } catch (err) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
402522
7723
46
5
238