Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evm_architect-1.0.0.tar.gz (16.6 kB view hashes)

Uploaded Source

Built Distribution

evm_architect-1.0.0-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page