Analyzing the smart contract supply chain.
- Python 3.7 or higher
- An Ethereum node (e.g., Geth, Parity) running and accessible via HTTP
First, clone the repository to your local machine:
git clone https://github.com/chains-project/scsc.git
cd scsc
It's recommended to use a virtual environment to manage dependencies:
python -m venv venv
source venv/bin/activate
Install the required Python packages using pip:
pip install -r requirements.txt
Edit the config.py file to set your Ethereum node URL:
# config.py
ETHEREUM_NODE_URL = 'http://localhost:8545'
Computes the supply chain of a smart-contract at a given block (or over a block period TODO)
python scsc.py [--block <block_number>] [--offset <blocks_offset>] --address <contract_address> [--calls]
<block_number>
: Block number that is analyzed. When not provided, assumes the latest
block number of Ethereum Mainnet.
<blocks_offset>
: The number of blocks before <block_number>
that are also analyzed. When not provided, assume the value 0
.
--calls
: flag that outputs the call trees of each transaction that was analyzed
./scsc --json --block 1234 --address 0xabcdef012345678 (TODO)
./scsc --graph --from-block 1234 --to-block 2234 --output graph.dot
TODO: explain the medadata available on the graph (supplier, mutable, vulnerable, ...)