From 7aa7cd457661b6191184283d5f6691f139461424 Mon Sep 17 00:00:00 2001 From: disconnect3d Date: Fri, 14 Jan 2022 13:07:41 +0100 Subject: [PATCH] Fix slither-check-erc output This commit makes the `slither-check-erc` more relevant: - when we confirm function interface's return type, we will now show it properly - we had a mistake that we logged that the "value" is incorrect while we meant "type" --- slither/tools/erc_conformance/erc/ercs.py | 4 ++-- tests/check-erc/test_1.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slither/tools/erc_conformance/erc/ercs.py b/slither/tools/erc_conformance/erc/ercs.py index da16558b5..1c64dc4a7 100644 --- a/slither/tools/erc_conformance/erc/ercs.py +++ b/slither/tools/erc_conformance/erc/ercs.py @@ -65,10 +65,10 @@ def _check_signature(erc_function, contract, ret): if function_return_type: function_return_type = ",".join([str(x) for x in function_return_type]) if function_return_type == return_type: - txt = f"\t[✓] {sig} -> () (correct return value)" + txt = f"\t[✓] {sig} -> ({function_return_type}) (correct return type)" logger.info(txt) else: - txt = f"\t[ ] {sig} -> () should return {return_type}" + txt = f"\t[ ] {sig} -> ({function_return_type}) should return {return_type}" logger.info(txt) incorrect_return = output.Output( diff --git a/tests/check-erc/test_1.txt b/tests/check-erc/test_1.txt index 1e088017f..014653f1f 100644 --- a/tests/check-erc/test_1.txt +++ b/tests/check-erc/test_1.txt @@ -2,7 +2,7 @@ ## Check functions [✓] totalSupply() is present - [✓] totalSupply() -> () (correct return value) + [✓] totalSupply() -> (uint256) (correct return type) [✓] totalSupply() is view [ ] balanceOf(address) is missing [ ] transfer(address,uint256) is missing