We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used Mythril to detect bugs in a smart contract, but received an incorrect analysis result. This detection module is based on the taint analysis.
Filename: EnvCase.sol
pragma solidity ^0.8.21; contract EnvCase { uint public pastBlockTime; constructor() {} receive() external payable {} fallback() external payable { require(msg.value == 1 ether); pastBlockTime = block.timestamp + 5; if(pastBlockTime % 15 == 0) { // winner payable(msg.sender).transfer(address(this).balance); } } }
Directly use the command myth analyze EnvCase.sol and you will get the analysis report.
myth analyze EnvCase.sol
$ myth analyze EnvCase.sol ==== Dependence on predictable environment variable ==== SWC ID: 116 Severity: Low Contract: EnvCase Function name: fallback Estimated Gas Usage: 235 - 330 A control flow decision is made based on The block.timestamp environment variable...... -------------------- In file: #utility.yul:9 if gt(x, sum) { panic_error_0x11() } -------------------- Initial State: Account: [CREATOR], balance: 0x0, nonce:0, storage:{} Account: [ATTACKER], balance: 0x0, nonce:0, storage:{} Transaction Sequence: Caller: [CREATOR], calldata: , decoded_data: , value: 0x0 Caller: [SOMEGUY], function: unknown, txdata: 0x00, decoded_data: , value: 0xde0b6b3a7640000
Mythril should provide the correct file and location information of the detected bug, like:
In file: EnvCase.sol:9 if(pastBlockTime % 15 == 0) { // winner
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
I used Mythril to detect bugs in a smart contract, but received an incorrect analysis result. This detection module is based on the taint analysis.
Input File
Filename: EnvCase.sol
How to Reproduce
Directly use the command
myth analyze EnvCase.sol
and you will get the analysis report.Expected behavior
Mythril should provide the correct file and location information of the detected bug, like:
Environment
The text was updated successfully, but these errors were encountered: