ethers-rs/ethers-core
dependabot[bot] 7fac88a649
chore(deps): bump cargo_metadata from 0.15.0 to 0.15.1 (#1806)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/v0.15.0...v0.15.1)

---
updated-dependencies:
- dependency-name: cargo_metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 16:10:00 -08:00
..
ethers-derive-eip712 Revert "chore: disable dev deps for release" 2022-10-25 11:12:50 -07:00
src fix: transaction type in TxpoolContent (#1844) 2022-11-08 15:06:58 -08:00
testdata fix(core): correctly deserialize eip1186 proof responses 2022-02-12 18:58:58 +02:00
Cargo.toml chore(deps): bump cargo_metadata from 0.15.0 to 0.15.1 (#1806) 2022-11-08 16:10:00 -08:00
README.md fmt: all (#1751) 2022-09-28 11:58:26 -07: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.