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

ethereumjs-abi

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereumjs-abi - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

13

CHANGELOG.md

@@ -8,2 +8,15 @@ # Changelog

## [0.6.6] - 2019-01-16
- Include size of fixed-size array in offset for dynamic type,
PR [#60](https://github.com/ethereumjs/ethereumjs-abi/pull/60)
- Replaced problematic for..in loops with C-style loops,
PR [#68](https://github.com/ethereumjs/ethereumjs-abi/pull/68)
- Updated `ethereumjs-util` dependency to `v5.0.0`,
PR [#59](https://github.com/ethereumjs/ethereumjs-abi/pull/59)
- Run CI tests on currently supported Node versions,
PR [#61](https://github.com/ethereumjs/ethereumjs-abi/pull/61)
[0.6.6]: https://github.com/ethereumjs/ethereumjs-abi/compare/v0.6.5...v0.6.6
## [0.6.5] - 2017-12-07

@@ -10,0 +23,0 @@ - Fix tight packing for ``ABI.soliditySHA3``

20

lib/index.js

@@ -340,5 +340,19 @@ const utils = require('ethereumjs-util')

var headLength = 32 * types.length
var headLength = 0
for (var i in types) {
types.forEach(function (type) {
if (isArray(type)) {
var size = parseTypeArray(type)
if (size !== 'dynamic') {
headLength += 32 * size
} else {
headLength += 32
}
} else {
headLength += 32
}
})
for (var i = 0; i < types.length; i++) {
var type = elementaryName(types[i])

@@ -365,3 +379,3 @@ var value = values[i]

var offset = 0
for (var i in types) {
for (var i = 0; i < types.length; i++) {
var type = elementaryName(types[i])

@@ -368,0 +382,0 @@ var parsed = parseType(type, data, offset)

4

package.json
{
"name": "ethereumjs-abi",
"version": "0.6.5",
"version": "0.6.6",
"description": "Decoder and encoder for the Ethereum ABI",

@@ -8,3 +8,3 @@ "main": "index.js",

"bn.js": "^4.10.0",
"ethereumjs-util": "^4.3.0"
"ethereumjs-util": "^5.0.0"
},

@@ -11,0 +11,0 @@ "devDependencies": {

@@ -121,5 +121,5 @@ # ethereumjs-abi

```js
var encoded = abi.rawEncode("balanceOf", abi.fromSerpent("i"), [ "0x0000000000000000000000000000000000000000" ])
var encoded = abi.rawEncode(abi.fromSerpent("i"), [ "0x0000000000000000000000000000000000000000" ])
var decoded = abi.rawDecode("balanceOf", abi.fromSerpent("i"), abi.fromSerpent("i"), data)
var decoded = abi.rawDecode([...abi.fromSerpent("i"), ...abi.fromSerpent("i")], data)
```

@@ -126,0 +126,0 @@

@@ -129,2 +129,7 @@ var assert = require('assert')

})
it('should work for string and uint256[2]', function () {
var a = abi.rawEncode([ 'string', 'uint256[2]' ], [ 'foo', [5, 6] ]).toString('hex')
var b = '0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000003666f6f0000000000000000000000000000000000000000000000000000000000'
assert.equal(a, b)
})
})

@@ -131,0 +136,0 @@

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