From 8555663adf426d03934646880485a01cd1c8b848 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 17 Oct 2018 17:20:57 +0530 Subject: [PATCH 1/4] Remove %s in formatting previously %s was used to display variable for string formatting which won't work. --- mythril/analysis/modules/deprecated_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index 84f39b6e..2b187e2d 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -24,7 +24,7 @@ def execute(statespace): instruction = state.get_current_instruction() if instruction['opcode'] == "ORIGIN": - description = "Function %s retrieves the transaction origin (tx.origin) using the ORIGIN opcode. " \ + description = "The function `{}` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. " \ "Use msg.sender instead.\nSee also: " \ "https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin".format(node.function_name) From a939a3255a7a5aa211649b0fd2c1843b23d601b2 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 17 Oct 2018 17:32:10 +0530 Subject: [PATCH 2/4] Update origin.sol.o.json --- tests/testdata/outputs_expected/origin.sol.o.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testdata/outputs_expected/origin.sol.o.json b/tests/testdata/outputs_expected/origin.sol.o.json index 640bce9c..04d6ee81 100644 --- a/tests/testdata/outputs_expected/origin.sol.o.json +++ b/tests/testdata/outputs_expected/origin.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 317, "contract": "Unknown", "debug": "", "description": "Function %s retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead.\nSee also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin", "function": "transferOwnership(address)", "swc_id": "115", "title": "Use of tx.origin", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 317, "contract": "Unknown", "debug": "", "description": "The function `transferOwnership(address)` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead.\nSee also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin", "function": "transferOwnership(address)", "swc_id": "115", "title": "Use of tx.origin", "type": "Warning"}], "success": true} From 5e48355d497e2c1ac8a28fbfed88d1b591216d86 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 17 Oct 2018 17:33:18 +0530 Subject: [PATCH 3/4] Remove the %s in markdown test --- tests/testdata/outputs_expected/origin.sol.o.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testdata/outputs_expected/origin.sol.o.markdown b/tests/testdata/outputs_expected/origin.sol.o.markdown index 772ef122..1e9d6d8b 100644 --- a/tests/testdata/outputs_expected/origin.sol.o.markdown +++ b/tests/testdata/outputs_expected/origin.sol.o.markdown @@ -9,5 +9,5 @@ ### Description -Function %s retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead. +The function `transferOwnership(address)` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead. See also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin From c105b17211dd26964629552f10cd666b2f9697b6 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 17 Oct 2018 17:34:03 +0530 Subject: [PATCH 4/4] Remove %s in the text test --- tests/testdata/outputs_expected/origin.sol.o.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testdata/outputs_expected/origin.sol.o.text b/tests/testdata/outputs_expected/origin.sol.o.text index f159a8eb..b71422be 100644 --- a/tests/testdata/outputs_expected/origin.sol.o.text +++ b/tests/testdata/outputs_expected/origin.sol.o.text @@ -4,7 +4,7 @@ Type: Warning Contract: Unknown Function name: transferOwnership(address) PC address: 317 -Function %s retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead. +The function `transferOwnership(address)` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead. See also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin --------------------