Skip to content

mpeyfuss/evm-sc-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

evm-sc-utils

Utilities for helping develop EVM compatible smart contracts. All utilities are written in Python. The repository uses Poetry for packaging and dependency management.

Classes

signers.EIP191Signer

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.

merkle_tree.MerkleTreeKeccak

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.

Running Tests

To run tests, run poetry run pytest.

License

This repository is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages