Skip to content

0.7.0

Choose a tag to compare

@alisinabh alisinabh released this 20 Jul 15:10

What's Changed

Enhancements

  • Add combined event filters: fetch multiple events (OR semantics) in a single eth_getLogs
    request with Ethers.EventFilter.combine/1, or all events of a contract by passing its
    EventFilters module (e.g. Ethers.get_logs(MyContract.EventFilters, address: "0x...")) —
    the resulting Ethers.CombinedEventFilter works with Ethers.get_logs/2 and
    Ethers.batch/2 and decodes each fetched log with its matching event selector
  • Add EIP-191 personal message support: hash, recover
    and verify messages with Ethers.PersonalMessage, and sign them via Ethers.personal_sign/2
    with the Ethers.Signer.Local and Ethers.Signer.JsonRPC signers through the new optional
    personal_sign/2 signer callback (named after the RPC method it mirrors)
  • Add universal signature verification with Ethers.Signature: verify any signature —
    EOA (ecrecover), smart-contract wallets (ERC-1271)
    and counterfactual, not-yet-deployed wallets (ERC-6492)
    against a digest, an EIP-191 personal message or EIP-712 typed data with
    Ethers.Signature.verify_hash/4, verify_message/4 and verify_typed_data/4
  • Add Sign-In with Ethereum (EIP-4361) support with
    Ethers.Siwe: build (new/1), render (to_message/1), parse (parse/1) and validate
    (validate/2) SIWE messages, generate session nonces (generate_nonce/0), and verify a
    message and its signature end-to-end with Ethers.Siwe.verify/3 — smart-contract wallets
    included via the universal signature verification above
  • Add EIP-712 typed data support: construct typed
    structured data with Ethers.TypedData, hash it (encode_type, type_hash, hash_struct,
    domain_separator, hash), sign it via Ethers.sign_typed_data/2 with the Ethers.Signer.Local
    and Ethers.Signer.JsonRPC (eth_signTypedData_v4) signers, and recover/verify the signer with
    Ethers.TypedData.recover_signer/2 and Ethers.TypedData.valid_signature?/3
  • Add a struct DSL for EIP-712 typed data: declare typed-data struct types as Elixir modules with
    use Ethers.TypedData.Schema and the typed_schema/field macros, then build an
    Ethers.TypedData directly from struct instances via Ethers.TypedData.new/2 (and new!/2)

Pull Requests in Release

  • Add EIP-712 Typed Data Support by @alisinabh in #264
  • Add EIP-191 personal message (personal_sign) support by @alisinabh in #265
  • Add universal signature verification (ERC-1271 + ERC-6492) by @alisinabh in #266
  • Add Sign-In with Ethereum (EIP-4361) support by @alisinabh in #267
  • Recommend Ethers.Signature over the EOA-only verification helpers by @alisinabh in #268
  • Add a way to fetch all contract events by @ddallaire in #222

Full Changelog: v0.6.13...v0.7.0