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.2ef694c.0 to 4.2.4-dev.2f24244.0

26

lib/commonjs/decode_contract_error_data.js

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

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

12

package.json
{
"name": "web3-eth-abi",
"version": "4.2.4-dev.2ef694c.0+2ef694c",
"version": "4.2.4-dev.2f24244.0+2f24244",
"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.2.2-dev.2ef694c.0+2ef694c",
"web3-types": "1.7.1-dev.2ef694c.0+2ef694c",
"web3-utils": "4.3.2-dev.2ef694c.0+2ef694c",
"web3-validator": "2.0.7-dev.2ef694c.0+2ef694c"
"web3-errors": "1.3.1-dev.2f24244.0+2f24244",
"web3-types": "1.7.1-dev.2f24244.0+2f24244",
"web3-utils": "4.3.2-dev.2f24244.0+2f24244",
"web3-validator": "2.0.7-dev.2f24244.0+2f24244"
},

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

},
"gitHead": "2ef694cc5b40cf44f4ec46c60e183970d2f5c18e"
"gitHead": "2f2424487a6ba2865b5a381f22f83500a3133cda"
}

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

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