{"repo":"zju-abclab/LookAhead","free":true,"listed":false,"github":"https://github.com/zju-abclab/LookAhead","clone":"git clone https://github.com/zju-abclab/LookAhead.git","description":"An ML-based framework for DeFi attack detection (based on adversarial contracts)","language":"Python","stars":12,"topics":["blockchain","defi","ethereum","security","web3"],"license":null,"category":"blockchain-web3","readme_excerpt":"LookAhead: Preventing DeFi Attacks via Unveiling Adversarial Contracts This repository contains the source code for LookAhead , an effective and efficient ML-based framework for DeFi attack detection (based on adversarial contracts) . Code Structure decompiler This folder contains custom-designed plugins for Gigahorse, a binary lifter and analysis framework for Ethereum smart contracts. We introduce various extra functional modules to be integrated with the Gigahorse toolkit. The core functionality is to launch a web server ( gigahorse web server.py ), which is responsible for handling contract data uploads and running Gigahorse tools to perform contract data analysis. model eval This folder contains code for evaluating the classifier and transformer models employed by LookAhead. We evaluate the datasets, generate prediction results, measure execution time, and assess the performance of the models. online test This folder contains the logic implemented for conducting online testing to measure the real-world performance of the LookAhead system. - Before performing the detection, we first train local models (logic located under training ). - For detection, we use contract feature handler.py to extract contract features and classification evaluator.py to load the trained models and produce predictions. An example usage is demonstrated in evaluate.ipynb . (logic located under detection ) We provide a report file, listing all true positive adversarial contracts detected during bot","default_branch":null,"files":null,"tree":[],"storefront":"/r/zju-abclab","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zju-abclab/LookAhead/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}