The script analyzes a csv file with attack data and creates a new csv file with alert hashes of the attack detector that matched.
- Create a
.env
file with the Forta api key.FORTA_KEY = <API_KEY>
- To run the script, the csv file is passed as a command line arg to the run command
python3 index.py <path to csv file>
. - If the name of the csv file is
attack.csv
and it's in the project directory, therun
command is -python3 index.py attack.csv
- The output is a new csv file(
Final_data.csv
) in the project directory. - The input csv file must contain 4 major columns -
Attack Name
,Network
,ProtocolContracts
andAttacker
. The script supports the 7 networks supported by Forta Network.
Attack_Detector.csv
contains attacks and the smart contract addresses of protocols involved.Final_data.csv
contains the output of the script when applied toAttack_Detector.csv
- To adjust the date on which the analysis should be performed, the
START_DATE
andEND_DATE
variables can be modified inconstants.py
file