Utilities for helping develop EVM compatible smart contracts. All utilities are written in Python. The repository uses Poetry for packaging and dependency management.
This class represents a signer that signs data per EIP-191 version E. This is useful for testing smart contracts that utilize ecrecover from a signature. Either a known private key can be given as the signer or a randomly generated signer can be used if no private key is sent to the constructor.
This class builds a merkle tree using the Solidity Keccak function from web3py. The leaves to build the tree must be HexByte values that are 32 bytes long. Ideally these are computed from data using the same Solidity Keccak function, but it is not required.
The merkle tree is built with each layer having the nodes sorted in ascending order.
To run tests, run poetry run pytest
.
This repository is licensed under the MIT license.