Giter Club home page Giter Club logo

fsm2sol's Introduction

fsm2sol - smart contracts as FSMs!

Slide link: here

Demo link (~4 mins): here

Note: Please go through slides. README not updated!

Rethink your contract logic as a FSM. Modelling contracts as FSMs help identify logical bugs during development and provides a formally sound assurance of the correctness of the contract logic.

Why to write contract as FSMs?

Market cap of ETH and BTC

For example: TheDAO attack

Migration of core financial applications into web3 space.

Auditing contracts not enough! We need mathematical guarantee!

Field of Formal Verification

Why not start thinking of contracts as FSMs before writing a single line of code?

Enter fsm2sol

Formal definition of the FSM

Transformation specification

FSM inputs

Roadmap

  1. Define grammar for input YAML
  2. Check if input FSM specification is well-formed. If not, give corrective error messages.
  3. Implement a graphical interface which generates the input YAML. This allows users to never touch text editor and start deploying smart contracts.
  4. Run the generated .sol through a formatter

Reference

  1. Designing Secure Ethereum Smart Contracts: A FSM based approach.

Future work (Theoretical)

Prove the equivalence of Solidity language and set of FSMs - is the FSM specification expressive enough to represent all possible Solidity contracts?

Scope for improvements (Technical)

  1. Extend the transformer to express modifiers/other access specifiers (Section 5 of the paper: Plugins)
  2. Make the GUI implement a "one button tap deploy" paradigm for onboarding next gen of web3 developers and accelerate development for experienced developers.

Contributing

Open to PRs!

License

MIT

fsm2sol's People

Contributors

basil08 avatar

Stargazers

 avatar

Watchers

 avatar

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.