Review and audit smart contracts with AI. soliditea is a tool designed to assist
in the smart contract development process. It leverages AI for reviewing and
auditing Solidity contracts. This tool integrates with existing development
workflows, offering insights into potential vulnerabilities and suggesting
code improvements.
🚀👩💻 This software was initially created as a contribution to the tea x pkgx hackathon 🚀👩💻
- AI-driven review and vulnerability check of smart contract code.
- Integration with Slither for static code analysis.
- Option to remove comments for testing.
- Customizable settings.
python
and pip
are required to be installed and working.
The following script will use pkgx to install all required dependencies
./setup.sh
python main.py analyze contracts/BadAuth.sol
To remove comments from the code you can use
python main.py analyze contracts/BadAuth.sol --without-comments
docker build -t soliditea-setup . --platform linux/amd64
docker run --rm -it --platform linux/amd64 --name soliditea-container -v $(pwd):/soliditea soliditea-setup /bin/sh
./setup.sh
python main.py analyze contracts/BadAuth.sol --without-comments
Special thanks to all contributors and supporters of the project.
Peter Robinson (https://github.com/drinkcoffee) was a great inspiration in
https://www.youtube.com/watch?v=J7dUOSPG0WY&t=1531s and published useful code
on https://github.com/drinkcoffee/EthEngGroupSolidityExamples/blob/master/ai/scripts/reviewsol.py
If you used the recommended pkgx setup you can ignore this part.
- Solidity: Check with
solc --version
. - Python 3.7+.
- Node.js and npm for
truffle-flattener
.
Check solc --version
to make sure solidity is installed.
https://docs.soliditylang.org/en/latest/installing-solidity.html
brew update && brew upgrade && brew tap ethereum/ethereum && brew install solidity
solc-select install 0.8.16
solc-select use 0.8.16
solc --version
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
npm install -g truffle
npm install -g truffle-flattener
Create a .env
file:
cp .env.example .env
and replace YOUR_API_KEY
with a valid OpenAI API key.
solc-select use 0.8.16
slither contracts/BadAuth.sol --json slither_output.json