#ethereum #keccak #blockchain #compile-time

macro ethp

Macros for evaluating common Ethereum and blockchain functions at compile time

1 unstable release

0.1.0 Mar 5, 2024

#40 in #keccak

Download history 18/week @ 2024-07-27 13/week @ 2024-09-14 47/week @ 2024-09-21 69/week @ 2024-09-28 106/week @ 2024-10-05 185/week @ 2024-10-12 85/week @ 2024-10-19 130/week @ 2024-10-26 230/week @ 2024-11-02

671 downloads per month

MIT license

5KB

ethp

A collection of Rust procedural macros for evaluating common Ethereum and blockchain related functions at compile time.

Example

use hex_literal::hex;
use ethp::{keccak256, selector};

assert_eq!(
    keccak256!("Transfer(address,address,uint256)"),
    hex!("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"),
);
assert_eq!(selector!("transfer(address,uint256)"), hex!("a9059cbb"));

Dependencies

~330–790KB
~19K SLoC