Git Product home page Git Product logo

soliris's Introduction

soliris

Solidity code scanner and optimizer protoype.

Cover by DALL-E.

Motivations

We want to help Solidity developers write better smart contracts. Various tools have been developed with this goal in mind: Foundry, Slither, Heimdall and so many more.

The release of the alloy-rs core libraries gave us the opportunity to experiment with the Solidity AST in Rust, and we immediately knew that we could build something upon it.

We opted for a project able to evolve and scale. A software able to perform various scans on Solidity code - using the AST - and report valuable information to the developer.

Soliris does not aim to be specialized in one single topic and should preferably hold scanners with different purposes: improving code syntax, giving more context about the contract's state, propose memory improvements and more. But we also acknowledge the limitations of the solution: it will never replace a compiler, nor a dedicated security tool such as Slither. It's more of a serious test demonstrating the possibilities of syn-solidity.

Development Status

Today, soliris is not production-ready and might report false information.

Specifically, we have a few optimisation scans in mind which might help you refactor pieces of your code. Don't use them in production. They might break a lot of things in your smart contracts.

Below is a list of the scanners implementation statuses:

Name Goal Status
Missing Comments Reports missing comments in your code.
Mutable Functions Reports functions able to mutate your contract's state.
Mutable Variables Reports variables likely to mutate.
Unused Imports Reports unused import declarations in your contracts.
Mutation Grapher Creates a graph showing the variables likely to mutate connected to the places where they undergo mutations.
Struct Repacker Suggests an alternative way to define a struct such that it takes less storage slots.

Getting Started

Local Build

There is one prerequisite to build soliris locally:

We also recommend to install Task.

Then, run the following command to build the project:

task build-release

Run Soliris

You can scan a test contract available in this repository:

./target/release/soliris scan -f tests/contracts/SimpleContract.sol

Contributing

If you would like to contribute to this project, please refer to the instructions in the dedicated document here.

Authors

This project is a pure open-source contribution to the Solidity ecosystem. It is currently maintained by the 🤖 at Quartz Technology.

soliris's People

Stargazers

 avatar

soliris's Issues

✨ Implement mutable functions scanner

🎯 Target

This feature has an impact on the user.

📝 Description

This feature consists of developing a scanner that detects functions able to mutate the contracts' state.

🧪 Consequence

This feature will improve the project by providing a new scanner and help for the development of the future Mutation Grapher scanner.

⚠️ DoD

Below are the steps required to complete this feature:

  • A new implementation of the Scanner trait to detect functions that mutate contracts' state.

✨ Implement mutable variables scanner

🎯 Target

This feature has an impact on the user.

📝 Description

This feature consists of developing a scanner that detects variables likely to mutate in contracts.

🧪 Consequence

This feature will improve the project by providing a new scanner and help for the development of the future Mutation Grapher scanner.

⚠️ DoD

Below are the steps required to complete this feature:

  • A new implementation of the Scanner trait to detect variables likely to mutate.

✨ Implement a struct repacker scanner

🎯 Target

This feature will have an impact on the user.

📝 Description

This feature consists of adding a new scanner, the struct repacker, able to compute the slots consumption for a structure and find a more efficient way to define it.

🧪 Consequence

This feature will improve the project as this is a very powerful way to potentially save gas in smart contracts.

⚠️ DoD

Below are the steps required to complete this feature.

  • Add a new StructRepacker scanner.
  • Implement the First Fit Decreasing strategy.
  • Implement the K-Permutations strategy.
  • Print the suggestion to the user.
  • Support remote reference (if a struct contains a struct / enum / UDT).

✨ Implement missing comments scanner

🎯 Target

This feature has an impact on the user.

📝 Description

This feature consists of developing a scanner that detects missing comments on variables, UDTs, functions and contracts.

🧪 Consequence

This feature will improve the project by providing a new scanner and giving an example of what a scanner looks like.

⚠️ DoD

Below are the steps required to complete this feature:

  • A new implementation of the Scanner trait to detect missing comments.
  • According tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.