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"
pull/1016/head
disconnect3d 3 years ago
parent 168492ad89
commit 7aa7cd4576
  1. 4
      slither/tools/erc_conformance/erc/ercs.py
  2. 2
      tests/check-erc/test_1.txt

@ -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(

@ -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

Loading…
Cancel
Save