Socket
Socket
Sign inDemoInstall

web3-eth-abi

Package Overview
Dependencies
Maintainers
4
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-eth-abi - npm Package Compare versions

Comparing version 4.2.4-dev.9b32205.0 to 4.2.4-dev.b3cb1b7.0

2

lib/commonjs/coders/base/numbersLimits.js

@@ -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.b3cb1b7.0+b3cb1b7",
"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.b3cb1b7.0+b3cb1b7",
"web3-types": "1.7.1-dev.b3cb1b7.0+b3cb1b7",
"web3-utils": "4.3.2-dev.b3cb1b7.0+b3cb1b7",
"web3-validator": "2.0.7-dev.b3cb1b7.0+b3cb1b7"
},

@@ -69,3 +69,3 @@ "devDependencies": {

},
"gitHead": "9b322052ef266cc57b29080b20053991e0c9a0a9"
"gitHead": "b3cb1b782cc2c62bd87909c7cdc426ed43a49c1c"
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc