diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b776828ff..4ccc09dc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,5 +38,6 @@ jobs: - name: Run Tests env: TEST_TYPE: ${{ matrix.type }} + GITHUB_ETHERSCAN: ${{ secrets.GITHUB_ETHERSCAN }} run: | bash scripts/travis_test_${TEST_TYPE}.sh diff --git a/scripts/travis_test_embark.sh b/scripts/travis_test_embark.sh index eeba9f108..118046260 100755 --- a/scripts/travis_test_embark.sh +++ b/scripts/travis_test_embark.sh @@ -9,9 +9,8 @@ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | b source ~/.nvm/nvm.sh nvm install 10.17.0 nvm use 10.17.0 -npm --version -npm install -g embark +npm install -g embark@4.2.0 embark demo cd embark_demo npm install diff --git a/scripts/travis_test_etherscan.sh b/scripts/travis_test_etherscan.sh index 57b026cc5..528d8e72e 100755 --- a/scripts/travis_test_etherscan.sh +++ b/scripts/travis_test_etherscan.sh @@ -8,7 +8,7 @@ cd etherscan wget -O solc-0.4.25 https://github.com/ethereum/solidity/releases/download/v0.4.25/solc-static-linux chmod +x solc-0.4.25 -slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --solc "./solc-0.4.25" +slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --solc "./solc-0.4.25" --etherscan-apikey $GITHUB_ETHERSCAN if [ $? -ne 5 ] then @@ -16,7 +16,7 @@ then exit -1 fi -slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --solc "./solc-0.4.25" +slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --solc "./solc-0.4.25" --etherscan-apikey $GITHUB_ETHERSCAN if [ $? -ne 70 ] then diff --git a/scripts/travis_test_truffle.sh b/scripts/travis_test_truffle.sh index 05ea1de7e..0e6bb8131 100755 --- a/scripts/travis_test_truffle.sh +++ b/scripts/travis_test_truffle.sh @@ -14,7 +14,7 @@ npm install -g truffle truffle unbox metacoin slither . -if [ $? -eq 7 ] +if [ $? -eq 5 ] then exit 0 fi diff --git a/setup.py b/setup.py index 7737ebb86..6c7874c19 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,9 @@ setup( python_requires='>=3.6', install_requires=['prettytable>=0.7.2', 'pysha3>=1.0.2', - 'crytic-compile>=0.1.6'], -# 'crytic-compile'], -# dependency_links=['git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile'], +# 'crytic-compile>=0.1.6'], + 'crytic-compile'], + dependency_links=['git+https://github.com/crytic/crytic-compile.git@dev#egg=crytic-compile'], license='AGPL-3.0', long_description=open('README.md').read(), entry_points={ diff --git a/slither/core/declarations/contract.py b/slither/core/declarations/contract.py index 1d8b0fd47..a7a8bbfcf 100644 --- a/slither/core/declarations/contract.py +++ b/slither/core/declarations/contract.py @@ -42,6 +42,7 @@ class Contract(ChildSlither, SourceMapping): self._kind = None self._signatures = None + self._signatures_declared = None self._is_upgradeable = None self._is_upgradeable_proxy = None @@ -292,7 +293,7 @@ class Contract(ChildSlither, SourceMapping): Return the signatures of all the public/eterxnal functions/state variables :return: list(string) the signatures of all the functions that can be called """ - if self._signatures == None: + if self._signatures is None: sigs = [v.full_name for v in self.state_variables if v.visibility in ['public', 'external']] @@ -300,6 +301,20 @@ class Contract(ChildSlither, SourceMapping): self._signatures = list(set(sigs)) return self._signatures + @property + def functions_signatures_declared(self): + """ + Return the signatures of the public/eterxnal functions/state variables that are declared by this contract + :return: list(string) the signatures of all the functions that can be called and are declared by this contract + """ + if self._signatures_declared is None: + sigs = [v.full_name for v in self.state_variables_declared if v.visibility in ['public', + 'external']] + + sigs += set([f.full_name for f in self.functions_declared if f.visibility in ['public', 'external']]) + self._signatures_declared = list(set(sigs)) + return self._signatures_declared + @property def functions(self): '''