Merge pull request #1016 from crytic/fix-check-erc-output

Fix slither-check-erc output
pull/1042/head
Feist Josselin 3 years ago committed by GitHub
commit de0d526cfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      .github/workflows/pip-audit.yml
  2. 4
      slither/tools/erc_conformance/erc/ercs.py
  3. 2
      tests/check-erc/test_1.txt

@ -0,0 +1,27 @@
name: pip-audit
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
schedule: [ cron: "0 7 * * 2" ]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install pip-audit
run: |
python -m pip install --upgrade pip
python -m pip install pip-audit
- name: Run pip-audit
run: |
python -m pip install .
pip-audit --desc -v

@ -65,10 +65,10 @@ def _check_signature(erc_function, contract, ret):
if function_return_type: if function_return_type:
function_return_type = ",".join([str(x) for x in function_return_type]) function_return_type = ",".join([str(x) for x in function_return_type])
if function_return_type == 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) logger.info(txt)
else: else:
txt = f"\t[ ] {sig} -> () should return {return_type}" txt = f"\t[ ] {sig} -> ({function_return_type}) should return {return_type}"
logger.info(txt) logger.info(txt)
incorrect_return = output.Output( incorrect_return = output.Output(

@ -2,7 +2,7 @@
## Check functions ## Check functions
[✓] totalSupply() is present [✓] totalSupply() is present
[✓] totalSupply() -> () (correct return value) [✓] totalSupply() -> (uint256) (correct return type)
[✓] totalSupply() is view [✓] totalSupply() is view
[ ] balanceOf(address) is missing [ ] balanceOf(address) is missing
[ ] transfer(address,uint256) is missing [ ] transfer(address,uint256) is missing

Loading…
Cancel
Save