erc20-transfer-authorization

Simple approval escrow for ERC20 spending
Log | Files | Refs

commit 719a0ce0b6be6143e21edae6dc8fbac56776dda9
parent d2cf56acc10eb2a9aefcd4d780eae5e40695189c
Author: Idaapayo <idaapayo@gmail.com>
Date:   Sun, 20 Feb 2022 19:46:38 +0000

adding coverage and slither analysis

Diffstat:
M.gitignore | 2++
A.gitlab-ci.yml | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apython/.coverage | 0
Apython/.coveragerc | 7+++++++
4 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -4,3 +4,5 @@ __pycache__ build/ dist/ gmon.out +.idea +venv diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -0,0 +1,58 @@ +stages: + - test + - run-coverage + - slither-analyzer + + +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +cache: + paths: + - .cache/pip + - .venv/ + +before_script: + - python -V # Print out python version for debugging + - pip install virtualenv + - virtualenv venv + - source venv/bin/activate + +test: + image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest + script: + # install test dependencies + - cd python + - export PYTHONPATH=. + - pip install --extra-index-url https://pip.grassrootseconomics.net + --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple + -r requirements.txt -r test_requirements.txt + # run tests + - bash run_tests.sh + +run-coverage: + stage: test + image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest + script: + - cd python + - export PYTHONPATH=. + - pip install --extra-index-url https://pip.grassrootseconomics.net + --extra-index-url https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple + -r requirements.txt -r test_requirements.txt + - pip install pytest pytest-cov + - coverage run -m pytest + - coverage html + - coverage report --fail-under=90 + + coverage: '/^TOTAL.+?(\d+\%)$/' + artifacts: + reports: + cobertura: python/htmlcov/index.html + +slither-analyzer: + image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-solc-python:latest + allow_failure: true + script: + - cd solidity + - slither ERC20TransferAuthorization.sol + - slither ERC20TransferAuthorization.sol --print human-summary diff --git a/python/.coverage b/python/.coverage Binary files differ. diff --git a/python/.coveragerc b/python/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +[report] +omit = .venv/* + **/runnable/*.py +[html] +