mojtaba-eshghie / HighGuard

The runtime monitoring tool for smart contracts high-level properties.
https://arxiv.org/abs/2305.08254
MIT License
5 stars 2 forks source link

Detector/reporter does not work as intended #96

Closed mojtaba-eshghie closed 2 weeks ago

mojtaba-eshghie commented 2 weeks ago

Current running of the full pipeline either does not properly run the monitor or report the detections correctly.

Command:

node CI/run.js -v

Result:

2024-05-01 20:56:03 [debug]: Working on contract: [object Object]
2024-05-01 20:56:03 [debug]: Successfully read test: ProductOrderExploit for [object Object] from config.
2024-05-01 20:56:03 [info]: Setting up environment: [anvil]
2024-05-01 20:56:04 [debug]: The retrieved parameters are: [1]
2024-05-01 20:56:07 [debug]: Model id: 1701030
2024-05-01 20:56:07 [debug]: The contract: ProductOrder
2024-05-01 20:56:07 [debug]: modelFunctionParams from configurations: 
2024-05-01 20:56:09 [debug]: Working on contract: [object Object]
2024-05-01 20:56:09 [debug]: Successfully read test: MultiStageAuctionExploit for [object Object] from config.
2024-05-01 20:56:09 [info]: Setting up environment: [anvil]
2024-05-01 20:56:09 [debug]: The retrieved parameters are: []
2024-05-01 20:56:09 [debug]: Response: [object Object]
2024-05-01 20:56:09 [debug]: Monitor is initialized...
2024-05-01 20:56:09 [info]: Monitor is now running for the contract 0x5FbDB2315678afecb367f032d93F642f64180aa3.
2024-05-01 20:56:09 [info]: Running exploits for environment: [anvil] 

2024-05-01 20:56:09 [debug]: The simulation id for the monitor: 2007485
2024-05-01 20:56:12 [debug]: Model id: 1701049
2024-05-01 20:56:12 [debug]: The contract: MultiStageAuction
2024-05-01 20:56:12 [debug]: modelFunctionParams from configurations: 
2024-05-01 20:56:13 [debug]: Step 1 transaction was successful!
2024-05-01 20:56:13 [debug]: Waiting for 7 seconds to bypass the deadline for product discount...
2024-05-01 20:56:13 [debug]: The retrieved activity using the translator is: null
2024-05-01 20:56:15 [debug]: Working on contract: [object Object]
2024-05-01 20:56:15 [debug]: Successfully read test: EscrowExploit for [object Object] from config.
2024-05-01 20:56:15 [info]: Setting up environment: [anvil]
2024-05-01 20:56:15 [debug]: The retrieved parameters are: ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","0x70997970C51812dc3A010C7d01b50e0d17dc79C8",0]
2024-05-01 20:56:15 [debug]: Response: [object Object]
2024-05-01 20:56:15 [debug]: Monitor is initialized...
2024-05-01 20:56:15 [info]: Monitor is now running for the contract 0x5FbDB2315678afecb367f032d93F642f64180aa3.
2024-05-01 20:56:15 [info]: Running exploits for environment: [anvil] 

2024-05-01 20:56:15 [debug]: The simulation id for the monitor: 2007486
2024-05-01 20:56:20 [debug]: Model id: 1624258
2024-05-01 20:56:20 [debug]: The contract: Escrow
2024-05-01 20:56:20 [debug]: modelFunctionParams from configurations: 
2024-05-01 20:56:20 [debug]: Step 2 transaction was successful!
2024-05-01 20:56:20 [debug]: The retrieved activity using the translator is: null
2024-05-01 20:56:20 [debug]: Step 3 transaction was successful!
2024-05-01 20:56:20 [info]: Exploit successful!
2024-05-01 20:56:20 [debug]: The retrieved activity using the translator is: null
Terminated process with PID 46910
(node:46862) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
2024-05-01 20:56:23 [debug]: Working on contract: [object Object]
2024-05-01 20:56:23 [debug]: Successfully read test: PrizeDistributionExploit for [object Object] from config.
2024-05-01 20:56:23 [info]: Setting up environment: [anvil]
2024-05-01 20:56:23 [debug]: The retrieved activity using the translator is: null
2024-05-01 20:56:23 [debug]: The retrieved activity using the translator is: [object Object]
2024-05-01 20:56:23 [debug]: Trying to execute the following DCR activity
2024-05-01 20:56:23 [debug]: requestBody: {}
2024-05-01 20:56:23 [debug]: nextEventAddress: https://repository.dcrgraphs.net/api/graphs/1701049/sims/2007486/events/revealBid
2024-05-01 20:56:23 [debug]: Exploit was successful!
2024-05-01 20:56:23 [info]: Exploit successful!
Terminated process with PID 47003
2024-05-01 20:56:23 [debug]: The retrieved parameters are: ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"]
2024-05-01 20:56:23 [debug]: Response: [object Object]
2024-05-01 20:56:23 [debug]: DCR Activity sent for execution: [object Object]
2024-05-01 20:56:23 [debug]: Monitor is initialized...
2024-05-01 20:56:23 [info]: Monitor is now running for the contract 0x5FbDB2315678afecb367f032d93F642f64180aa3.
2024-05-01 20:56:23 [info]: Running exploits for environment: [anvil] 

2024-05-01 20:56:23 [debug]: The simulation id for the monitor: 2007487
2024-05-01 20:56:27 [debug]: The retrieved activity using the translator is: [object Object]
2024-05-01 20:56:27 [debug]: Trying to execute the following DCR activity
2024-05-01 20:56:27 [debug]: requestBody: {}
2024-05-01 20:56:27 [debug]: nextEventAddress: https://repository.dcrgraphs.net/api/graphs/1624258/sims/2007487/events/placeInEscrow
2024-05-01 20:56:27 [debug]: The retrieved activity using the translator is: [object Object]
2024-05-01 20:56:27 [debug]: Trying to execute the following DCR activity
2024-05-01 20:56:27 [debug]: requestBody: {}
2024-05-01 20:56:27 [debug]: nextEventAddress: https://repository.dcrgraphs.net/api/graphs/1624258/sims/2007487/events/releaseByReceiver
2024-05-01 20:56:27 [info]: Exploit successful! Funds withdrawn without sender's approval.
2024-05-01 20:56:27 [info]: Exploit successful!
2024-05-01 20:56:27 [debug]: The retrieved activity using the translator is: [object Object]
2024-05-01 20:56:27 [debug]: Trying to execute the following DCR activity
2024-05-01 20:56:27 [debug]: requestBody: {}
2024-05-01 20:56:27 [debug]: nextEventAddress: https://repository.dcrgraphs.net/api/graphs/1624258/sims/2007487/events/withdrawFromEscrow
Terminated process with PID 47142
2024-05-01 20:56:27 [debug]: DCR Activity sent for execution: [object Object]
2024-05-01 20:56:27 [debug]: DCR Activity sent for execution: [object Object]
2024-05-01 20:56:27 [debug]: DCR Activity sent for execution: [object Object]
2024-05-01 20:56:28 [debug]: Model id: 1701044
2024-05-01 20:56:28 [debug]: The contract: PrizeDistribution
2024-05-01 20:56:28 [debug]: modelFunctionParams from configurations: 
2024-05-01 20:56:30 [debug]: Response: [object Object]
2024-05-01 20:56:30 [debug]: Monitor is initialized...
2024-05-01 20:56:30 [info]: Monitor is now running for the contract 0x5FbDB2315678afecb367f032d93F642f64180aa3.
2024-05-01 20:56:30 [info]: Running exploits for environment: [anvil] 

2024-05-01 20:56:30 [debug]: The simulation id for the monitor: 2007488
Step 1 transaction was successful!
2024-05-01 20:56:34 [debug]: The retrieved activity using the translator is: null
Updated unlock time: 1714589798
Current time based on system: 1714589794
Current time based on blockchain: 1714589794
Waiting for 6 seconds until unlock time...
2024-05-01 20:56:40 [debug]: The retrieved activity using the translator is: null
Current time based on blockchain:: 1714589800
Current time based on system: 1714589800
Step 2 transaction was successful!
2024-05-01 20:56:40 [info]: Exploit successful!
2024-05-01 20:56:40 [info]: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 

2024-05-01 20:56:40 [info]: Finished executing all exploits.

2024-05-01 20:56:40 [info]: Total successful exploits: 4
2024-05-01 20:56:40 [info]: Total failed exploits: 0

2024-05-01 20:56:40 [info]: Failed ones are: []
2024-05-01 20:56:40 [info]: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
2024-05-01 20:56:40 [info]: Finished all operations. Successful: 4, Failed: 0