Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tutorial

Feist Josselin edited this page Feb 15, 2019 · 1 revision

Slither API

from slither import Slither  
  
slither = Slither('example.sol')  

For a Slither object, you can access:

  • slither.pragma_directives: list of the Pragma directives
  • slither.import_directives: list of the Import directives
  • slither.source_code: a dictionary that maps a filename to its source code
  • slither.solc_version: the solc version that was detected

The solc version is detected either by running solc --version or by looking at the version provided by Truffle.

The contracts are acceded through:

  • slither.contracts: list of all the contracts
  • slither.contracts_derived: list of all the contracts that are not inherited
  • slither.get_contract_from_name(name): get a contract from a given name (return None if it is not found)

Contract information

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.