Git Product home page Git Product logo

state-machine-builder's People

Contributors

adklempner avatar cgewecke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

state-machine-builder's Issues

Authorize state transitions with signed messages and ecrecover

Huge barrier to user on-boarding of decentralized applications is paying for gas.

Let's add another version of the performStateChange method that accepts two additional parameters: bytes32 hash, bytes sig and uses Zeppelin's ECRecovery library to allow anyone to submit a TX on the signer's behalf.

If this pattern can work in StateMachineBuilder it'll be worth releasing a generic version, probably as a new addition to the OpenZeppelin library.

Refactor transition requirements out of State library

The data specifying the requirements for performing a state transition is stored in the Transition struct in the State library, violating the single responsibility principle.

In order to keep the core contracts as simple, modular and extensible as possible, it's best to think of the transitionGraph as a labeled directed graph.

        nodeA              nodeB      label
mapping(bytes32 => mapping(bytes32 => bytes32)) transitionGraph;

Here's how the graph below would be stored in the transitionGraph mapping (assume strings are converted to bytes32)
pvqnb

transitionGraph["a"]["b"] = "1"
transitionGraph["b"]["c"] = "2"
transitionGraph["c"]["d"] = "3"
transitionGraph["d"]["a"] = "4"
transitionGraph["a"]["c"] = "5"
transitionGraph["c"]["a"] = "6"

In the same way the meaning of each node is interpreted by the implementing contract (and perhaps even further above, by the application at large), so should the meaning of each label.

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.