ethers-rs/ethers-core
dependabot[bot] 2f85e73049
chore(deps): bump num_enum from 0.5.9 to 0.5.10 (#2168)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.9 to 0.5.10.
- [Release notes](https://github.com/illicitonion/num_enum/releases)
- [Commits](https://github.com/illicitonion/num_enum/compare/0.5.9...0.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-20 16:17:32 -08:00
..
ethers-derive-eip712 chore: update all rust editions to 2021 (#1979) 2022-12-30 14:48:29 +02:00
src chore: added canto network (#2171) 2023-02-20 13:51:06 -08:00
testdata feat: support parsing bytecode from evm object (#2024) 2023-01-07 16:22:07 +02:00
Cargo.toml chore(deps): bump num_enum from 0.5.9 to 0.5.10 (#2168) 2023-02-20 16:17:32 -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.