Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into greenkeeper/keccak-2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 authored Nov 4, 2019
2 parents 56919a7 + 0ddaed8 commit 1014a03
Show file tree
Hide file tree
Showing 25 changed files with 2,118 additions and 1,470 deletions.
9 changes: 9 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

Great that you want to contribute to the `EthereumJS` [ecosystem](https://ethereumjs.readthedocs.io/en/latest/introduction.html). `EthereumJS` is managed by the Ethereum Foundation and largely driven by the wider community. Everyone is welcome to join the effort and help to improve on the libraries (see our [Code of Conduct](https://ethereumjs.readthedocs.io/en/latest/code_of_conduct.html) 🌷).

We have written up some [Contribution Guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html#how-to-start) to help you getting started.

These include information on how we work with **Git** and how our **general workflow** and **technical setup** looks like (stuff like language, tooling, code quality and style).

Happy Coding! 👾 😀 💻
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/

### App ###

.cachedb
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.vscode
package.json
dist
.nyc_output
test/testdata
docs
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
language: node_js
node_js:
- "6"
- "8"
- "10"
env:
- CXX=g++-4.8
- "11"
- "12"
addons:
firefox: "latest"
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
before_install:
- sh -e /etc/init.d/xvfb start
env:
global:
- DISPLAY=:99.0
Expand Down
124 changes: 80 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,142 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.1.0] - 2019-02-12

First **TypeScript** based release of the library, now also including a
**type declaration file** distributed along with the package published,
see PR [#170](https://github.com/ethereumjs/ethereumjs-util/pull/170).

**Bug Fixes**

- Fixed a bug in `isValidSignature()` not correctly returning `false`
if passed an `s`-value greater than `secp256k1n/2` on `homestead` or later.
If you use the method signature with more than three arguments (so not just
passing in `v`, `r`, `s` and use it like `isValidSignature(v, r, s)` and omit
the optional args) please read the thread from
PR [#171](https://github.com/ethereumjs/ethereumjs-util/pull/171) carefully
and check your code.

**Development**

- Updated `@types/node` to Node `11` types,
PR [#175](https://github.com/ethereumjs/ethereumjs-util/pull/175)
- Changed browser from Chrome to ChromeHeadless,
PR [#156](https://github.com/ethereumjs/ethereumjs-util/pull/156)

[6.1.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v6.0.0...v6.1.0

## [6.0.0] - 2018-10-08
- Support for ``EIP-155`` replay protection by adding an optional ``chainId`` parameter
to ``ecsign()``, ``ecrecover()``, ``toRpcSig()`` and ``isValidSignature()``, if present the
new signature format relying on the ``chainId`` is used, see PR [#143](https://github.com/ethereumjs/ethereumjs-util/pull/143)
- New ``generateAddress2()`` for ``CREATE2`` opcode (``EIP-1014``) address creation

- Support for `EIP-155` replay protection by adding an optional `chainId` parameter
to `ecsign()`, `ecrecover()`, `toRpcSig()` and `isValidSignature()`, if present the
new signature format relying on the `chainId` is used, see PR [#143](https://github.com/ethereumjs/ethereumjs-util/pull/143)
- New `generateAddress2()` for `CREATE2` opcode (`EIP-1014`) address creation
(Constantinople HF), see PR [#146](https://github.com/ethereumjs/ethereumjs-util/pull/146)
- [BREAKING] Fixed signature to comply with Geth and Parity in ``toRpcSig()`` changing
``v`` from 0/1 to 27/28, this changes the resulting signature buffer, see PR [#139](https://github.com/ethereumjs/ethereumjs-util/pull/139)
- [BREAKING] Remove deprecated ``sha3``-named constants and methods (see ``v5.2.0`` release),
- [BREAKING] Fixed signature to comply with Geth and Parity in `toRpcSig()` changing
`v` from 0/1 to 27/28, this changes the resulting signature buffer, see PR [#139](https://github.com/ethereumjs/ethereumjs-util/pull/139)
- [BREAKING] Remove deprecated `sha3`-named constants and methods (see `v5.2.0` release),
see PR [#154](https://github.com/ethereumjs/ethereumjs-util/pull/154)

[6.0.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.2.0...v6.0.0

## [5.2.0] - 2018-04-27
- Rename all ``sha3`` hash related constants and functions to ``keccak``, see

- Rename all `sha3` hash related constants and functions to `keccak`, see
[this](https://github.com/ethereum/EIPs/issues/59) EIP discussion for context
(tl;dr: Ethereum uses a slightly different hash algorithm then in the official
``SHA-3`` standard)
`SHA-3` standard)
- Renamed constants:
- ``SHA3_NULL_S`` -> ``KECCAK256_NULL_S``
- ``SHA3_NULL`` -> ``KECCAK256_NULL``
- ``SHA3_RLP_ARRAY_S`` -> ``KECCAK256_RLP_ARRAY_S``
- ``SHA3_RLP_ARRAY`` -> ``KECCAK256_RLP_ARRAY``
- ``SHA3_RLP_S`` -> ``KECCAK256_RLP_S``
- ``SHA3_RLP`` -> ``KECCAK256_RLP``
- `SHA3_NULL_S` -> `KECCAK256_NULL_S`
- `SHA3_NULL` -> `KECCAK256_NULL`
- `SHA3_RLP_ARRAY_S` -> `KECCAK256_RLP_ARRAY_S`
- `SHA3_RLP_ARRAY` -> `KECCAK256_RLP_ARRAY`
- `SHA3_RLP_S` -> `KECCAK256_RLP_S`
- `SHA3_RLP` -> `KECCAK256_RLP`
- Renamed functions:
- ``sha3()`` -> ``keccak()`` (number of bits determined in arguments)
- New ``keccak256()`` alias function for ``keccak(a, 256)``
- The usage of the ``sha``-named versions is now ``DEPRECATED`` and the related
constants and functions will be removed on the next major release ``v6.0.0``
- `sha3()` -> `keccak()` (number of bits determined in arguments)
- New `keccak256()` alias function for `keccak(a, 256)`
- The usage of the `sha`-named versions is now `DEPRECATED` and the related
constants and functions will be removed on the next major release `v6.0.0`

[5.2.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.5...v5.2.0

## [5.1.5] - 2018-02-28
- Fix ``browserify`` issue leading to 3rd-party build problems, PR [#119](https://github.com/ethereumjs/ethereumjs-util/pull/119)

- Fix `browserify` issue leading to 3rd-party build problems, PR [#119](https://github.com/ethereumjs/ethereumjs-util/pull/119)

[5.1.5]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.4...v5.1.5

## [5.1.4] - 2018-02-03
- Moved to ``ES5`` Node distribution version for easier toolchain integration, PR [#114](https://github.com/ethereumjs/ethereumjs-util/pull/114)
- Updated ``isPrecompile()`` with Byzantium precompile address range, PR [#115](https://github.com/ethereumjs/ethereumjs-util/pull/115)

- Moved to `ES5` Node distribution version for easier toolchain integration, PR [#114](https://github.com/ethereumjs/ethereumjs-util/pull/114)
- Updated `isPrecompile()` with Byzantium precompile address range, PR [#115](https://github.com/ethereumjs/ethereumjs-util/pull/115)

[5.1.4]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.3...v5.1.4

## [5.1.3] - 2018-01-03
- ``ES6`` syntax updates
- Dropped Node ``5`` support
- Moved babel to dev dependencies, switched to ``env`` preset
- Usage of ``safe-buffer`` instead of Node ``Buffer``
- Do not allow capital ``0X`` as valid address in ``isValidAddress()``
- New methods ``zeroAddress()`` and ``isZeroAddress()``

- `ES6` syntax updates
- Dropped Node `5` support
- Moved babel to dev dependencies, switched to `env` preset
- Usage of `safe-buffer` instead of Node `Buffer`
- Do not allow capital `0X` as valid address in `isValidAddress()`
- New methods `zeroAddress()` and `isZeroAddress()`
- Updated dependencies

[5.1.3]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.2...v5.1.3

## [5.1.2] - 2017-05-31
- Add browserify for ``ES2015`` compatibility

- Add browserify for `ES2015` compatibility
- Fix hex validation

[5.1.2]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.1...v5.1.2

## [5.1.1] - 2017-02-10
- Use hex utils from ``ethjs-util``

- Use hex utils from `ethjs-util`
- Move secp vars into functions
- Dependency updates

[5.1.1]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.1.0...v5.1.1

## [5.1.0] - 2017-02-04
- Fix ``toRpcSig()`` function
- Updated Buffer creation (``Buffer.from``)

- Fix `toRpcSig()` function
- Updated Buffer creation (`Buffer.from`)
- Dependency updates
- Fix npm error
- Use ``keccak`` package instead of ``keccakjs``
- Helpers for ``eth_sign`` RPC call
- Use `keccak` package instead of `keccakjs`
- Helpers for `eth_sign` RPC call

[5.1.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.0.1...v5.1.0

## [5.0.1] - 2016-11-08
- Fix ``bufferToHex()``

- Fix `bufferToHex()`

[5.0.1]: https://github.com/ethereumjs/ethereumjs-util/compare/v5.0.0...v5.0.1

## [5.0.0] - 2016-11-08
- Added ``isValidSignature()`` (ECDSA signature validation)
- Change ``v`` param in ``ecrecover()`` from ``Buffer`` to ``int`` (breaking change!)

- Added `isValidSignature()` (ECDSA signature validation)
- Change `v` param in `ecrecover()` from `Buffer` to `int` (breaking change!)
- Fix property alias for setting with initial parameters
- Reject invalid signature lengths for ``fromRpcSig()``
- Fix ``sha3()`` ``width`` param (byte -> bit)
- Fix overflow bug in ``bufferToInt()``
- Reject invalid signature lengths for `fromRpcSig()`
- Fix `sha3()` `width` param (byte -> bit)
- Fix overflow bug in `bufferToInt()`

[5.0.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v4.5.0...v5.0.0

## [4.5.0] - 2016-17-12
- Introduced ``toMessageSig()`` and ``fromMessageSig()``

- Introduced `toMessageSig()` and `fromMessageSig()`

[4.5.0]: https://github.com/ethereumjs/ethereumjs-util/compare/v4.4.1...v4.5.0

Expand All @@ -113,4 +149,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
- [4.2.0](https://github.com/ethereumjs/ethereumjs-util/compare/v4.1.0...v4.2.0) - 2016-03-18
- [4.1.0](https://github.com/ethereumjs/ethereumjs-util/compare/v4.0.0...v4.1.0) - 2016-03-08
- [4.0.0](https://github.com/ethereumjs/ethereumjs-util/compare/v3.0.0...v4.0.0) - 2016-02-02
- [3.0.0](https://github.com/ethereumjs/ethereumjs-util/compare/v2.0.0...v3.0.0) - 2016-01-20
- [3.0.0](https://github.com/ethereumjs/ethereumjs-util/compare/v2.0.0...v3.0.0) - 2016-01-20
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
# SYNOPSIS

[![NPM Package](https://img.shields.io/npm/v/ethereumjs-util.svg?style=flat-square)](https://www.npmjs.org/package/ethereumjs-util)
[![Build Status](https://img.shields.io/travis/ethereumjs/ethereumjs-util.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereumjs/ethereumjs-util)
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-util.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-util)
[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)


[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode

A collection of utility functions for ethereum. It can be used in node.js or can be in the browser with browserify.

# API
[./docs/](./docs/index.md)

[./docs/](./docs/README.md)

Most of the string manipulation methods are provided by [ethjs-util](https://github.com/ethjs/ethjs-util)

---

Additionally ethereumjs-util re-exports a few commonly-used libraries. These include:

- `BN` ([bn.js](https://github.com/indutny/bn.js))
- `rlp` ([rlp](https://github.com/ethereumjs/rlp))
- `secp256k1` ([secp256k1](https://github.com/cryptocoinjs/secp256k1-node/))

# EthereumJS

See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.

If you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).

# LICENSE

MPL-2.0
Loading

0 comments on commit 1014a03

Please sign in to comment.