Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-eth-abi

Package Overview
Dependencies
Maintainers
1
Versions
481
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 1.0.0-beta.20 to 1.0.0-beta.21

7

package.json
{
"name": "web3-eth-abi",
"version": "1.0.0-beta.20",
"namespace": "ethereum",
"version": "1.0.0-beta.21",
"description": "Web3 module encode and decode EVM in/output.",

@@ -11,5 +12,5 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-eth-abi",

"underscore": "1.8.3",
"web3-core-helpers": "^1.0.0-beta.20",
"web3-utils": "^1.0.0-beta.20"
"web3-core-helpers": "^1.0.0-beta.21",
"web3-utils": "^1.0.0-beta.21"
}
}

@@ -69,3 +69,12 @@ /*

var formatInputBytes = function (value) {
if(!utils.isHex(value)) {
throw new Error('Given parameter is not bytes: "'+ value + '"');
}
var result = value.replace(/^0x/i,'');
if(result.length % 2 !== 0) {
throw new Error('Given parameter bytes has an invalid length: "'+ value + '"');
}
var l = Math.floor((result.length + 63) / 64);

@@ -84,3 +93,12 @@ result = utils.padRight(result, l * 64);

var formatInputDynamicBytes = function (value) {
if(!utils.isHex(value)) {
throw new Error('Given parameter is not bytes: "'+ value + '"');
}
var result = value.replace(/^0x/i,'');
if(result.length % 2 !== 0) {
throw new Error('Given parameter bytes has an invalid length: "'+ value + '"');
}
var length = result.length / 2;

@@ -227,5 +245,5 @@ var l = Math.floor((result.length + 63) / 64);

var length = (new BN(hex, 16)).toNumber() * 2;
return utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, ''));
return length ? utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, '')) : '';
} else {
return "ERROR: Strings are not yet supported as return values";
throw new Error('ERROR: The returned value is not a convertible string:'+ hex);
}

@@ -232,0 +250,0 @@ };

@@ -376,2 +376,4 @@ /*

inputs.forEach(function (res, i) {
returnValue[i] = (res.type === 'string') ? '' : null;
if (notIndexedParams[i]) {

@@ -378,0 +380,0 @@ returnValue[i] = notIndexedParams[i];

@@ -18,3 +18,3 @@ var f = require('../formatters');

var args = Array.prototype.slice.call(arguments);
args[0] = formatters.inputAddressFormatter(args[0]);
args[0] = (!args[0] || args[0] === '0x0') ? '' : formatters.inputAddressFormatter(args[0]);
return f.formatInputInt.apply(this, args);

@@ -21,0 +21,0 @@ };

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