Skip to content

Instantly share code, notes, and snippets.

@dukedaily
Created December 7, 2022 03:27
Show Gist options
  • Save dukedaily/ad605df57251bc0e908581112a2d2924 to your computer and use it in GitHub Desktop.
Save dukedaily/ad605df57251bc0e908581112a2d2924 to your computer and use it in GitHub Desktop.
➜ contracts git:(main) ✗ docker run -v $(pwd):/tmp mythril/myth analyze /tmp/test.sol
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
==== Integer Arithmetic Bugs ====
SWC ID: 101
Severity: High
Contract: Exceptions
Function name: assert3(uint256)
PC address: 381
Estimated Gas Usage: 474 - 569
The arithmetic operator can underflow.
It is possible to cause an integer overflow or underflow in the arithmetic operation.
--------------------
In file: /tmp/test.sol:22
input != 23
--------------------
Initial State:
Account: [CREATOR], balance: 0x1, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [ATTACKER], function: assert3(uint256), txdata: 0x546455b50000000000000000000000000000000000000000000000000000000000000000, decoded_data: (0,), value: 0x0
==== Integer Arithmetic Bugs ====
SWC ID: 101
Severity: High
Contract: Exceptions
Function name: require_is_fine(uint256)
PC address: 440
Estimated Gas Usage: 429 - 524
The arithmetic operator can underflow.
It is possible to cause an integer overflow or underflow in the arithmetic operation.
--------------------
In file: /tmp/test.sol:26
input != 23
--------------------
Initial State:
Account: [CREATOR], balance: 0x1, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [SOMEGUY], function: require_is_fine(uint256), txdata: 0x96b33e2b0000000000000000000000000000000000000000000000000000000000000000, decoded_data: (0,), value: 0x0
==== Exception State ====
SWC ID: 110
Severity: Medium
Contract: Exceptions
Function name: assert1()
PC address: 682
Estimated Gas Usage: 229 - 514
An assertion violation was triggered.
It is possible to trigger an assertion violation. Note that Solidity assert() statements should only be used to check invariants. Review the transaction trace generated for this issue and either make sure your program logic is correct, or use require() instead of assert() if your goal is to constrain user inputs or enforce preconditions. Remember to validate inputs from both callers (for instance, via passed arguments) and callees (for instance, via return values).
--------------------
In file: /tmp/test.sol:7
assert(i == 0)
--------------------
Initial State:
Account: [CREATOR], balance: 0x4800000e08cb, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [SOMEGUY], function: assert1(), txdata: 0xb34c3610, value: 0x0
==== Exception State ====
SWC ID: 110
Severity: Medium
Contract: Exceptions
Function name: assert3(uint256)
PC address: 682
Estimated Gas Usage: 501 - 786
An assertion violation was triggered.
It is possible to trigger an assertion violation. Note that Solidity assert() statements should only be used to check invariants. Review the transaction trace generated for this issue and either make sure your program logic is correct, or use require() instead of assert() if your goal is to constrain user inputs or enforce preconditions. Remember to validate inputs from both callers (for instance, via passed arguments) and callees (for instance, via return values).
--------------------
In file: /tmp/test.sol:22
assert(input != 23)
--------------------
Initial State:
Account: [CREATOR], balance: 0x4, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [SOMEGUY], function: assert3(uint256), txdata: 0x546455b50000000000000000000000000000000000000000000000000000000000000017, decoded_data: (23,), value: 0x0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment