ethers-rs/ethers-core
dependabot[bot] 37f3df5234
chore(deps): bump once_cell from 1.11.0 to 1.12.0 (#1306)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 00:31:40 -07:00
..
ethers-derive-eip712 Release process and CI (#1240) 2022-05-13 13:10:05 -07:00
src feat: add paginated logs (#1285) 2022-05-23 14:23:35 -07:00
testdata fix(core): correctly deserialize eip1186 proof responses 2022-02-12 18:58:58 +02:00
Cargo.toml chore(deps): bump once_cell from 1.11.0 to 1.12.0 (#1306) 2022-05-24 00:31:40 -07:00
README.md release: 0.6.0 (#611) 2021-11-23 21:23:12 +02:00

README.md

Ethereum types, cryptography and utilities.

It is recommended to use the utils, types and abi re-exports instead of the core module to simplify your imports._

This library provides type definitions for Ethereum's main datatypes along with other utilities for interacting with the Ethereum ecosystem

Signing an ethereum-prefixed message

Signing in Ethereum is done by first prefixing the message with "\x19Ethereum Signed Message:\n" + message.length, and then signing the hash of the result.

# async fn foo() -> Result<(), Box<dyn std::error::Error>> {
use ethers::signers::{Signer, LocalWallet};

let message = "Some data";
let wallet = LocalWallet::new(&mut rand::thread_rng());

// Sign the message
let signature = wallet.sign_message(message).await?;

// Recover the signer from the message
let recovered = signature.recover(message)?;

assert_eq!(recovered, wallet.address());
# Ok(())
# }

Utilities

The crate provides utilities for launching local Ethereum testnets by using ganache-cli via the GanacheBuilder struct.

Features

    • ["eip712"] | Provides Eip712 trait for EIP-712 encoding of typed data for derived structs

ABI Encoding and Decoding

This crate re-exports the ethabi crate's functions under the abi module, as well as the secp256k1 and rand crates for convenience.