Get the entire architecture of a smart contract system from any address in the architecture
Project description
EVM_Architect
There's a handful of optimizations still to be had. Speed has been increased by using a rpc provider rather than etherscan for getCode, and the multicheck function is now multithreaded so that all the checks occur simultaneaously. The following is an example of how to get a flat list of entities in an architecture, given a single address.
To use this, make sure you're using python 3.9.0. You can install using pip.
pip install evm-architect
Most of the time you'll probably just want to use getArch(), these are the arguments:
getArch(
address-string,
transaction_limit-int,
flatten-bool)
If flatten==True, then you will get a list of addresses (EOAs and contracts).
#Example:
['0xd1c24f50d05946b3fabefbae3cd0a7e9938c63f2', '0xc0a47dfe034b400b47bdad5fecda2621de6c4d95', '0xa087b7351c24082ac7ef7ca79b4f4c5d2e82be84', '0x2157a7894439191e520825fe9399ab8655e0f708', '0x2c4bd064b998838076fa341a83d007fc2fa50957', '0xddee242662323a3cff3f9aa139ffa496ac3c73b0',...]
If flatten==False, then you will get a dictionnary in the format below. Keep in mind that created1 may also be a creator somewhere else in the dictionnary.
{creator:[created1,created2,created3,...]}
#Example:
{'0xd1c24f50d05946b3fabefbae3cd0a7e9938c63f2': ['0xa087b7351c24082ac7ef7ca79b4f4c5d2e82be84', '0x2157a7894439191e520825fe9399ab8655e0f708', '0xc0a47dfe034b400b47bdad5fecda2621de6c4d95'],...}
Here are some code examples:
from evm_architect import architect
arch=architect.Arch()
architecture=arch.getArch("0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95",50,False)
architecture=arch.getArch("0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95",50,True)
uarch=arch.uniqueContracts(architecture,{})
#returns a dictionary of {address: hash of opcode stack} using every address in the creationdict (unflattened architecture)
highest=arch.getHighest(architecture)
#returns the highest position creator in the creationdict (unflattened architecture)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for evm_architect-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43352f3c37c489a11faaf9adacad79b62a7c4afbf200352f8d4860f62a19858a |
|
MD5 | 516a3cf90b21d24c223db4117bc0e32f |
|
BLAKE2b-256 | f5cbe370bd0873e58eb834113fd219abd7312ea082df1197bc4890e5f4c95975 |