github.com/hxy-daniel/soda-study@v0.0.0-20210825114314-29b7dcb300f1/readme.md (about) 1 # SODA study 2 ## block collector 3 ```SODA_code/go-ethereum/core/state_processor.go Process()``` 4 ## trans collector 5 external trans ```SODA_code/go-ethereum/core/state_processor.go ApplyTransaction()``` 6 internal trans ```SODA_code/go-ethereum/core/vm/interpreter.go Run()```and```SODA_code/go-ethereum/core/vm/instructions.go opCreate() opCreate2() opCall() opCallCode() opDelegateCall() opStaticCall()``` 7 8 ## ins collector 9 10 ## update location of go-ethereum 11 1. ```SODA_code/go-ethereum/cmd/pluginManage/* new file``` 12 2. ```SODA_code/go-ethereum/core/state_processor.go Process()``` 13 3. ```SODA_code/go-ethereum/core/vm/evm.go``` 14 4. ```SODA_code/go-ethereum/core/vm/instructions.go``` 15 5. ```SODA_code/go-ethereum/core/vm/interpreter.go Run()``` 16 6. ```SODA_code/go-ethereum/core/vm/stack.go``` 17 7. ```SODA_code/go-ethereum/eth/api.go``` 18 8. ```SODA_code/go-ethereum/log/pluginlog.go new file``` 19 9. ```SODA_code/go-ethereum/miner/worker.go``` 20 10. ```SODA_code/go-ethereum/params/config.go``` 21 11. ```SODA_code/go-ethereum/tingrong/transOpcodeStructure.go new file``` 22 23 24 # SODA_code 25 SODA is a novel generic online detection framework for smart contracts on blockchains that support Ethereum virtual machine (EVM). We released the 8 detection apps and the source code of the framework here. 26 27 We developed the framework SODA based on go-ethereum v1.9.0 (https://github.com/ethereum/go-ethereum/tree/v1.9.0) in Ubuntu 16.06. 28 29 The source code of 8 detection apps is under the path ```SODA_code/plugin/plugin```. 30 31 ## How to use this framework and the 8 detection apps 32 1. Use ```go env``` to check your paths of ```GOPATH``` and ```GOROOT``` in your Ubuntu. 33 2. Copy the file ```collector.go``` in the path ```SODA_code/collector``` to the path ```GOROOT/src/github.com/ethereum/collector``` (if a directory does not exist, create it). 34 3. Copy the folder ```json-iterator``` and ```modern-go``` in the path ```SODA_code/go-ethereum/vendor/github.com``` to the path ```GOPATH/src/github.com``` (if a directory does not exist, create it). 35 4. Enter the folder ```SODA_code/go-ethereum```, set```GO111MODULE=auto```, use ```make geth``` to compile the framework, and then you can get ```geth``` from the path ```SODA_code/go-ethereum/build/bin```. 36 5. Enter the path ```SODA_code/plugin/plugin/P1```, and then use ```go build –buildmode=plugin P1.go``` to get ```P1.so```. 37 6. Make two new directories ```plugin``` where to put the ```P1.so``` and ```public``` where to store sync data in the same directory as ```geth```. 38 7. In the directory where ```geth``` is, use ```./geth -syncmode full -datadir public``` or ```nohup ./geth -syncmode full -datadir public > gethlog.txt 2>&1 &``` to start syncing. 39 8. Finally, you will find the result of each app in the folder ```plugin_log```. 40 41 # Result 42 P1 is an app for detecting a malicious re-entrancy aiming at stealing ETH. The result of P1 is listed in the table ```P1_result.xlsx```. 43 We have listed all 8 apps' results at https://drive.google.com/drive/folders/1gHAlmivO1zntSaAoZjoSymG0sQS8lv32?usp=sharing. 44 45 # Paper 46 You can find our paper about the design, implementation, and experimental results of SODA at https://www.ndss-symposium.org/wp-content/uploads/2020/02/24449.pdf. 47 48 # Citing in Academic Work 49 Welcome to cite our paper: 50 Ting Chen, Rong Cao, Ting Li, Xiapu Luo, Guofei Gu, Yufei Zhang, Zhou Liao, Hang Zhu, Gang Chen, Zheyuan He, Yuxing Tang, Xiaodong Lin, Xiaosong Zhang. SODA: A Generic Online Detection Framework for Smart Contracts. In NDSS 2020. 51 52 # Contact us 53 If you have any problems in using our tool, please send emails to chenting19870201@163.com and 1797258848@qq.com.