From 148f4823ca90051c0d2b41fccd337f5f84d15cd9 Mon Sep 17 00:00:00 2001 From: dat Date: Wed, 18 Apr 2018 09:01:51 +0700 Subject: [PATCH 1/2] wrap all functions in back ticks #108 --- README.md | 2 +- mythril/support/truffle.py | 2 +- static/sample_report.md | 8 ++++---- tests/cmd_line_test.py | 2 +- tests/testdata/outputs_expected/ether_send.sol.json | 4 ++-- tests/testdata/outputs_expected/ether_send.sol.markdown | 2 +- tests/testdata/outputs_expected/metacoin.sol.json | 2 +- tests/testdata/outputs_expected/metacoin.sol.markdown | 2 +- tests/testdata/outputs_expected/metacoin.sol.text | 2 +- tests/testdata/outputs_expected/multi_contracts.sol.json | 2 +- .../outputs_expected/multi_contracts.sol.markdown | 2 +- tests/testdata/outputs_expected/multi_contracts.sol.text | 2 +- tests/testdata/outputs_expected/overflow.sol.json | 6 +++--- tests/testdata/outputs_expected/overflow.sol.markdown | 6 +++--- tests/testdata/outputs_expected/overflow.sol.text | 6 +++--- tests/testdata/outputs_expected/rubixi.sol.json | 8 ++++---- tests/testdata/outputs_expected/rubixi.sol.markdown | 8 ++++---- tests/testdata/outputs_expected/rubixi.sol.text | 8 ++++---- tests/testdata/outputs_expected/underflow.sol.json | 6 +++--- tests/testdata/outputs_expected/underflow.sol.markdown | 6 +++--- tests/testdata/outputs_expected/underflow.sol.text | 6 +++--- tests/testdata/outputs_expected/weak_random.sol.json | 8 ++++---- tests/testdata/outputs_expected/weak_random.sol.markdown | 8 ++++---- tests/testdata/outputs_expected/weak_random.sol.text | 8 ++++---- 24 files changed, 58 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index b27f4b1d..ea4f0351 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Type: Warning Contract: Crowdfunding Function name: withdrawfunds() PC address: 816 -In the function 'withdrawfunds()' a non-zero amount of Ether is sent to msg.sender. +In the function `withdrawfunds()` a non-zero amount of Ether is sent to msg.sender. There is a check on storage index 7. This storage slot can be written to by calling the function 'crowdfunding()'. -------------------- diff --git a/mythril/support/truffle.py b/mythril/support/truffle.py index 992aff43..f869c2d4 100644 --- a/mythril/support/truffle.py +++ b/mythril/support/truffle.py @@ -103,6 +103,6 @@ def analyze_truffle_project(args): else: if (args.outform == 'text'): - print("Analysis result for " + name + ":\n" + report.as_text()) + print("\n\n# Analysis result for " + name + ":\n\n" + report.as_text()) elif (args.outform == 'markdown'): print("\n\n# Analysis result for " + name + "\n\n" + report.as_markdown()) diff --git a/static/sample_report.md b/static/sample_report.md index d58329e2..fa637edd 100644 --- a/static/sample_report.md +++ b/static/sample_report.md @@ -6,7 +6,7 @@ - PC address: 816 ### Description -In the function 'withdrawfunds()' a non-zero amount of Ether is sent to msg.sender. +In the function `withdrawfunds()` a non-zero amount of Ether is sent to msg.sender. Call value is balance_at_1461501637330902918203684832716283019655932542975 & address. There is a check on storage index 7. This storage slot can be written to by calling the function 'crowdfunding()'. @@ -67,7 +67,7 @@ msg.sender.call.value(_amount)() - PC address: 649 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The SUB instruction at address 649 may result in a value < 0. In *underflow.sol:* @@ -82,7 +82,7 @@ balances[msg.sender] -= _value - PC address: 567 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The SUB instruction at address 567 may result in a value < 0. In *underflow.sol:* @@ -97,7 +97,7 @@ balances[msg.sender] - _value - PC address: 1285 ### Description -In the function '_function_0xe9874106' the following predictable state variables are used to determine Ether recipient: +In the function `'_function_0xe9874106'` the following predictable state variables are used to determine Ether recipient: - block.coinbase diff --git a/tests/cmd_line_test.py b/tests/cmd_line_test.py index 6ad10783..c548709e 100644 --- a/tests/cmd_line_test.py +++ b/tests/cmd_line_test.py @@ -26,7 +26,7 @@ class TruffleTestCase(BaseTestCase): def test_analysis_truffle_project(self): truffle_project_root = str(TESTS_DIR / "truffle_project") command = "cd {}; truffle compile; python3 {} --truffle".format(truffle_project_root, MYTH) - self.assertIn("In the function 'withdrawfunds()' a non-zero amount of Ether is sent to msg.sender.", output_of(command)) + self.assertIn("In the function `'withdrawfunds()'` a non-zero amount of Ether is sent to msg.sender.", output_of(command)) class InfuraTestCase(BaseTestCase): diff --git a/tests/testdata/outputs_expected/ether_send.sol.json b/tests/testdata/outputs_expected/ether_send.sol.json index a04d31b1..01f8aa1f 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.json +++ b/tests/testdata/outputs_expected/ether_send.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Ether send", - "description": "In the function 'withdrawfunds()' a non-zero amount of Ether is sent to msg.sender.\n\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'crowdfunding()'.", + "description": "In the function `'withdrawfunds()'` a non-zero amount of Ether is sent to msg.sender.\n\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'crowdfunding()'.", "function": "withdrawfunds()", "type": "Warning", "address": 816, @@ -15,7 +15,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function invest().\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `invest()`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "invest()", "type": "Warning", "address": 483, diff --git a/tests/testdata/outputs_expected/ether_send.sol.markdown b/tests/testdata/outputs_expected/ether_send.sol.markdown index 6117553b..01c7e26f 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.markdown +++ b/tests/testdata/outputs_expected/ether_send.sol.markdown @@ -22,7 +22,7 @@ msg.sender.transfer(this.balance) - PC address: 483 ### Description -A possible integer overflow exists in the function invest(). +A possible integer overflow exists in the function `invest()`. The addition may result in a value higher than the maximum representable integer. In */inputs/ether_send.sol:24* diff --git a/tests/testdata/outputs_expected/metacoin.sol.json b/tests/testdata/outputs_expected/metacoin.sol.json index ad8dcb23..6b5844a9 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.json +++ b/tests/testdata/outputs_expected/metacoin.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function sendToken(address,uint256).\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `sendToken(address,uint256)`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "sendToken(address,uint256)", "type": "Warning", "address": 498, diff --git a/tests/testdata/outputs_expected/metacoin.sol.markdown b/tests/testdata/outputs_expected/metacoin.sol.markdown index de472f59..04be36d5 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.markdown +++ b/tests/testdata/outputs_expected/metacoin.sol.markdown @@ -6,7 +6,7 @@ - PC address: 498 ### Description -A possible integer overflow exists in the function sendToken(address,uint256). +A possible integer overflow exists in the function `sendToken(address,uint256)`. The addition may result in a value higher than the maximum representable integer. In */inputs/metacoin.sol:12* diff --git a/tests/testdata/outputs_expected/metacoin.sol.text b/tests/testdata/outputs_expected/metacoin.sol.text index 2df0696c..3c972022 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.text +++ b/tests/testdata/outputs_expected/metacoin.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: metaCoin Function name: sendToken(address,uint256) PC address: 498 -A possible integer overflow exists in the function sendToken(address,uint256). +A possible integer overflow exists in the function `sendToken(address,uint256)`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/metacoin.sol:12 diff --git a/tests/testdata/outputs_expected/multi_contracts.sol.json b/tests/testdata/outputs_expected/multi_contracts.sol.json index 6e623daa..501b2b5f 100644 --- a/tests/testdata/outputs_expected/multi_contracts.sol.json +++ b/tests/testdata/outputs_expected/multi_contracts.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Ether send", - "description": "In the function '_function_0x8a4068dd' a non-zero amount of Ether is sent to msg.sender.\nIt seems that this function can be called without restrictions.", + "description": "In the function `'_function_0x8a4068dd'` a non-zero amount of Ether is sent to msg.sender.\nIt seems that this function can be called without restrictions.", "function": "_function_0x8a4068dd", "type": "Warning", "address": 142, diff --git a/tests/testdata/outputs_expected/multi_contracts.sol.markdown b/tests/testdata/outputs_expected/multi_contracts.sol.markdown index 25b6f401..de4a3771 100644 --- a/tests/testdata/outputs_expected/multi_contracts.sol.markdown +++ b/tests/testdata/outputs_expected/multi_contracts.sol.markdown @@ -6,7 +6,7 @@ - PC address: 142 ### Description -In the function '_function_0x8a4068dd' a non-zero amount of Ether is sent to msg.sender. +In the function `'_function_0x8a4068dd'` a non-zero amount of Ether is sent to msg.sender. It seems that this function can be called without restrictions. In */inputs/multi_contracts.sol:14* diff --git a/tests/testdata/outputs_expected/multi_contracts.sol.text b/tests/testdata/outputs_expected/multi_contracts.sol.text index 89168baa..cf1d4a80 100644 --- a/tests/testdata/outputs_expected/multi_contracts.sol.text +++ b/tests/testdata/outputs_expected/multi_contracts.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: Transfer2 Function name: _function_0x8a4068dd PC address: 142 -In the function '_function_0x8a4068dd' a non-zero amount of Ether is sent to msg.sender. +In the function `'_function_0x8a4068dd'` a non-zero amount of Ether is sent to msg.sender. It seems that this function can be called without restrictions. -------------------- In file: /inputs/multi_contracts.sol:14 diff --git a/tests/testdata/outputs_expected/overflow.sol.json b/tests/testdata/outputs_expected/overflow.sol.json index 55db12e3..83ccd3d5 100644 --- a/tests/testdata/outputs_expected/overflow.sol.json +++ b/tests/testdata/outputs_expected/overflow.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Integer Underflow", - "description": "A possible integer underflow exists in the function sendeth(address,uint256).\nThe subtraction may result in a value < 0.", + "description": "A possible integer underflow exists in the function `sendeth(address,uint256)`.\nThe subtraction may result in a value < 0.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 649, @@ -15,7 +15,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function sendeth(address,uint256).\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 725, @@ -26,7 +26,7 @@ }, { "title": "Integer Underflow", - "description": "A possible integer underflow exists in the function sendeth(address,uint256).\nThe subtraction may result in a value < 0.", + "description": "A possible integer underflow exists in the function `sendeth(address,uint256)`.\nThe subtraction may result in a value < 0.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 567, diff --git a/tests/testdata/outputs_expected/overflow.sol.markdown b/tests/testdata/outputs_expected/overflow.sol.markdown index 11ec4695..77cb5626 100644 --- a/tests/testdata/outputs_expected/overflow.sol.markdown +++ b/tests/testdata/outputs_expected/overflow.sol.markdown @@ -6,7 +6,7 @@ - PC address: 649 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. In */inputs/overflow.sol:12* @@ -21,7 +21,7 @@ balances[msg.sender] -= _value - PC address: 725 ### Description -A possible integer overflow exists in the function sendeth(address,uint256). +A possible integer overflow exists in the function `sendeth(address,uint256)`. The addition may result in a value higher than the maximum representable integer. In */inputs/overflow.sol:13* @@ -36,7 +36,7 @@ balances[_to] += _value - PC address: 567 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. In */inputs/overflow.sol:11* diff --git a/tests/testdata/outputs_expected/overflow.sol.text b/tests/testdata/outputs_expected/overflow.sol.text index 1a6ad3a5..ddf1919e 100644 --- a/tests/testdata/outputs_expected/overflow.sol.text +++ b/tests/testdata/outputs_expected/overflow.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: Over Function name: sendeth(address,uint256) PC address: 649 -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- In file: /inputs/overflow.sol:12 @@ -17,7 +17,7 @@ Type: Warning Contract: Over Function name: sendeth(address,uint256) PC address: 725 -A possible integer overflow exists in the function sendeth(address,uint256). +A possible integer overflow exists in the function `sendeth(address,uint256)`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/overflow.sol:13 @@ -31,7 +31,7 @@ Type: Warning Contract: Over Function name: sendeth(address,uint256) PC address: 567 -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- In file: /inputs/overflow.sol:11 diff --git a/tests/testdata/outputs_expected/rubixi.sol.json b/tests/testdata/outputs_expected/rubixi.sol.json index 5e4b07ce..e41a9d06 100644 --- a/tests/testdata/outputs_expected/rubixi.sol.json +++ b/tests/testdata/outputs_expected/rubixi.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Ether send", - "description": "In the function '_function_0x4229616d' a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", + "description": "In the function `'_function_0x4229616d'` a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", "function": "_function_0x4229616d", "type": "Warning", "address": 1599, @@ -15,7 +15,7 @@ }, { "title": "Ether send", - "description": "In the function '_function_0x686f2c90' a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", + "description": "In the function `'_function_0x686f2c90'` a non-zero amount of Ether is sent to an address taken from storage slot 5.\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\n\nThere is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", "function": "_function_0x686f2c90", "type": "Warning", "address": 1940, @@ -48,7 +48,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function _function_0xfae14192.\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `_function_0xfae14192`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "_function_0xfae14192", "type": "Warning", "address": 1223, @@ -59,7 +59,7 @@ }, { "title": "Integer Underflow", - "description": "A possible integer underflow exists in the function _function_0xd11f13df.\nThe subtraction may result in a value < 0.", + "description": "A possible integer underflow exists in the function `_function_0xd11f13df`.\nThe subtraction may result in a value < 0.", "function": "_function_0xd11f13df", "type": "Warning", "address": 2743, diff --git a/tests/testdata/outputs_expected/rubixi.sol.markdown b/tests/testdata/outputs_expected/rubixi.sol.markdown index 7e1d23fc..9d688bc2 100644 --- a/tests/testdata/outputs_expected/rubixi.sol.markdown +++ b/tests/testdata/outputs_expected/rubixi.sol.markdown @@ -6,7 +6,7 @@ - PC address: 1599 ### Description -In the function '_function_0x4229616d' a non-zero amount of Ether is sent to an address taken from storage slot 5. +In the function `'_function_0x4229616d'` a non-zero amount of Ether is sent to an address taken from storage slot 5. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. @@ -24,7 +24,7 @@ creator.send(feesToCollect) - PC address: 1940 ### Description -In the function '_function_0x686f2c90' a non-zero amount of Ether is sent to an address taken from storage slot 5. +In the function `'_function_0x686f2c90'` a non-zero amount of Ether is sent to an address taken from storage slot 5. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. @@ -70,7 +70,7 @@ participants[orderInPyramid] - PC address: 1223 ### Description -A possible integer overflow exists in the function _function_0xfae14192. +A possible integer overflow exists in the function `_function_0xfae14192`. The addition may result in a value higher than the maximum representable integer. In */inputs/rubixi.sol:37* @@ -85,7 +85,7 @@ collectedFees += msg.value - PC address: 2743 ### Description -A possible integer underflow exists in the function _function_0xd11f13df. +A possible integer underflow exists in the function `_function_0xd11f13df`. The subtraction may result in a value < 0. In */inputs/rubixi.sol:143* diff --git a/tests/testdata/outputs_expected/rubixi.sol.text b/tests/testdata/outputs_expected/rubixi.sol.text index 8fb0fc84..7f8500bb 100644 --- a/tests/testdata/outputs_expected/rubixi.sol.text +++ b/tests/testdata/outputs_expected/rubixi.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: Rubixi Function name: _function_0x4229616d PC address: 1599 -In the function '_function_0x4229616d' a non-zero amount of Ether is sent to an address taken from storage slot 5. +In the function `'_function_0x4229616d'` a non-zero amount of Ether is sent to an address taken from storage slot 5. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. @@ -20,7 +20,7 @@ Type: Warning Contract: Rubixi Function name: _function_0x686f2c90 PC address: 1940 -In the function '_function_0x686f2c90' a non-zero amount of Ether is sent to an address taken from storage slot 5. +In the function `'_function_0x686f2c90'` a non-zero amount of Ether is sent to an address taken from storage slot 5. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. There is a check on storage index 5. This storage slot can be written to by calling the function '_function_0x67f809e9'. @@ -63,7 +63,7 @@ Type: Warning Contract: Rubixi Function name: _function_0xfae14192 PC address: 1223 -A possible integer overflow exists in the function _function_0xfae14192. +A possible integer overflow exists in the function `_function_0xfae14192`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/rubixi.sol:37 @@ -77,7 +77,7 @@ Type: Warning Contract: Rubixi Function name: _function_0xd11f13df PC address: 2743 -A possible integer underflow exists in the function _function_0xd11f13df. +A possible integer underflow exists in the function `_function_0xd11f13df`. The subtraction may result in a value < 0. -------------------- In file: /inputs/rubixi.sol:143 diff --git a/tests/testdata/outputs_expected/underflow.sol.json b/tests/testdata/outputs_expected/underflow.sol.json index 72a13295..c7b9eece 100644 --- a/tests/testdata/outputs_expected/underflow.sol.json +++ b/tests/testdata/outputs_expected/underflow.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Integer Underflow", - "description": "A possible integer underflow exists in the function sendeth(address,uint256).\nThe subtraction may result in a value < 0.", + "description": "A possible integer underflow exists in the function `sendeth(address,uint256)`.\nThe subtraction may result in a value < 0.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 649, @@ -15,7 +15,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function sendeth(address,uint256).\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 725, @@ -26,7 +26,7 @@ }, { "title": "Integer Underflow", - "description": "A possible integer underflow exists in the function sendeth(address,uint256).\nThe subtraction may result in a value < 0.", + "description": "A possible integer underflow exists in the function `sendeth(address,uint256)`.\nThe subtraction may result in a value < 0.", "function": "sendeth(address,uint256)", "type": "Warning", "address": 567, diff --git a/tests/testdata/outputs_expected/underflow.sol.markdown b/tests/testdata/outputs_expected/underflow.sol.markdown index 9c3961e7..6d5e82c6 100644 --- a/tests/testdata/outputs_expected/underflow.sol.markdown +++ b/tests/testdata/outputs_expected/underflow.sol.markdown @@ -6,7 +6,7 @@ - PC address: 649 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. In */inputs/underflow.sol:12* @@ -21,7 +21,7 @@ balances[msg.sender] -= _value - PC address: 725 ### Description -A possible integer overflow exists in the function sendeth(address,uint256). +A possible integer overflow exists in the function `sendeth(address,uint256)`. The addition may result in a value higher than the maximum representable integer. In */inputs/underflow.sol:13* @@ -36,7 +36,7 @@ balances[_to] += _value - PC address: 567 ### Description -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. In */inputs/underflow.sol:11* diff --git a/tests/testdata/outputs_expected/underflow.sol.text b/tests/testdata/outputs_expected/underflow.sol.text index 3b0b2074..86d8a8ba 100644 --- a/tests/testdata/outputs_expected/underflow.sol.text +++ b/tests/testdata/outputs_expected/underflow.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: Under Function name: sendeth(address,uint256) PC address: 649 -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- In file: /inputs/underflow.sol:12 @@ -17,7 +17,7 @@ Type: Warning Contract: Under Function name: sendeth(address,uint256) PC address: 725 -A possible integer overflow exists in the function sendeth(address,uint256). +A possible integer overflow exists in the function `sendeth(address,uint256)`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/underflow.sol:13 @@ -31,7 +31,7 @@ Type: Warning Contract: Under Function name: sendeth(address,uint256) PC address: 567 -A possible integer underflow exists in the function sendeth(address,uint256). +A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- In file: /inputs/underflow.sol:11 diff --git a/tests/testdata/outputs_expected/weak_random.sol.json b/tests/testdata/outputs_expected/weak_random.sol.json index 77cab159..61a8041b 100644 --- a/tests/testdata/outputs_expected/weak_random.sol.json +++ b/tests/testdata/outputs_expected/weak_random.sol.json @@ -4,7 +4,7 @@ "issues": [ { "title": "Dependence on predictable environment variable", - "description": "In the function '_function_0xe9874106' the following predictable state variables are used to determine Ether recipient:\n- block.coinbase\n", + "description": "In the function `'_function_0xe9874106'` the following predictable state variables are used to determine Ether recipient:\n- block.coinbase\n", "function": "_function_0xe9874106", "type": "Warning", "address": 1285, @@ -15,7 +15,7 @@ }, { "title": "Ether send", - "description": "In the function '_function_0xe9874106' a non-zero amount of Ether is sent to an address taken from storage slot 0.\nThere is a check on storage index 0. This storage slot can be written to by calling the function 'fallback'.\n\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", + "description": "In the function `'_function_0xe9874106'` a non-zero amount of Ether is sent to an address taken from storage slot 0.\nThere is a check on storage index 0. This storage slot can be written to by calling the function 'fallback'.\n\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.\nThere is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'.", "function": "_function_0xe9874106", "type": "Warning", "address": 1285, @@ -48,7 +48,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function _function_0xe9874106.\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `_function_0xe9874106`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "_function_0xe9874106", "type": "Warning", "address": 1216, @@ -59,7 +59,7 @@ }, { "title": "Integer Overflow ", - "description": "A possible integer overflow exists in the function _function_0xe9874106.\nThe addition may result in a value higher than the maximum representable integer.", + "description": "A possible integer overflow exists in the function `_function_0xe9874106`.\nThe addition may result in a value higher than the maximum representable integer.", "function": "_function_0xe9874106", "type": "Warning", "address": 262, diff --git a/tests/testdata/outputs_expected/weak_random.sol.markdown b/tests/testdata/outputs_expected/weak_random.sol.markdown index 4cc93eef..fa89a30e 100644 --- a/tests/testdata/outputs_expected/weak_random.sol.markdown +++ b/tests/testdata/outputs_expected/weak_random.sol.markdown @@ -6,7 +6,7 @@ - PC address: 1285 ### Description -In the function '_function_0xe9874106' the following predictable state variables are used to determine Ether recipient: +In the function `'_function_0xe9874106'` the following predictable state variables are used to determine Ether recipient: - block.coinbase @@ -22,7 +22,7 @@ winningAddress.transfer(prize) - PC address: 1285 ### Description -In the function '_function_0xe9874106' a non-zero amount of Ether is sent to an address taken from storage slot 0. +In the function `'_function_0xe9874106'` a non-zero amount of Ether is sent to an address taken from storage slot 0. There is a check on storage index 0. This storage slot can be written to by calling the function 'fallback'. There is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'. @@ -68,7 +68,7 @@ prize / totalTickets - PC address: 1216 ### Description -A possible integer overflow exists in the function _function_0xe9874106. +A possible integer overflow exists in the function `_function_0xe9874106`. The addition may result in a value higher than the maximum representable integer. In */inputs/weak_random.sol:45* @@ -83,7 +83,7 @@ gameId++ - PC address: 262 ### Description -A possible integer overflow exists in the function _function_0xe9874106. +A possible integer overflow exists in the function `_function_0xe9874106`. The addition may result in a value higher than the maximum representable integer. In */inputs/weak_random.sol:22* diff --git a/tests/testdata/outputs_expected/weak_random.sol.text b/tests/testdata/outputs_expected/weak_random.sol.text index e0c1879b..d53c23b4 100644 --- a/tests/testdata/outputs_expected/weak_random.sol.text +++ b/tests/testdata/outputs_expected/weak_random.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: WeakRandom Function name: _function_0xe9874106 PC address: 1285 -In the function '_function_0xe9874106' the following predictable state variables are used to determine Ether recipient: +In the function `'_function_0xe9874106'` the following predictable state variables are used to determine Ether recipient: - block.coinbase -------------------- @@ -18,7 +18,7 @@ Type: Warning Contract: WeakRandom Function name: _function_0xe9874106 PC address: 1285 -In the function '_function_0xe9874106' a non-zero amount of Ether is sent to an address taken from storage slot 0. +In the function `'_function_0xe9874106'` a non-zero amount of Ether is sent to an address taken from storage slot 0. There is a check on storage index 0. This storage slot can be written to by calling the function 'fallback'. There is a check on storage index 1. This storage slot can be written to by calling the function 'fallback'. @@ -61,7 +61,7 @@ Type: Warning Contract: WeakRandom Function name: _function_0xe9874106 PC address: 1216 -A possible integer overflow exists in the function _function_0xe9874106. +A possible integer overflow exists in the function `_function_0xe9874106`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/weak_random.sol:45 @@ -75,7 +75,7 @@ Type: Warning Contract: WeakRandom Function name: _function_0xe9874106 PC address: 262 -A possible integer overflow exists in the function _function_0xe9874106. +A possible integer overflow exists in the function `_function_0xe9874106`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/weak_random.sol:22 From b1d3c2d913f1a8b481e2d4661288e1892db641f6 Mon Sep 17 00:00:00 2001 From: dat Date: Wed, 18 Apr 2018 09:03:28 +0700 Subject: [PATCH 2/2] #108 add back tips #108 add back tips --- tests/testdata/outputs_expected/ether_send.sol.text | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testdata/outputs_expected/ether_send.sol.text b/tests/testdata/outputs_expected/ether_send.sol.text index 685f0a2a..1578a52d 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.text +++ b/tests/testdata/outputs_expected/ether_send.sol.text @@ -3,7 +3,7 @@ Type: Warning Contract: Crowdfunding Function name: withdrawfunds() PC address: 816 -In the function 'withdrawfunds()' a non-zero amount of Ether is sent to msg.sender. +In the function `'withdrawfunds()'` a non-zero amount of Ether is sent to msg.sender. There is a check on storage index 1. This storage slot can be written to by calling the function 'crowdfunding()'. -------------------- @@ -18,7 +18,7 @@ Type: Warning Contract: Crowdfunding Function name: invest() PC address: 483 -A possible integer overflow exists in the function invest(). +A possible integer overflow exists in the function `invest()`. The addition may result in a value higher than the maximum representable integer. -------------------- In file: /inputs/ether_send.sol:24