Giter VIP home page Giter VIP logo

producerjson's Introduction

producerjson

Producer JSON smart contract for EOS.

Usage

View the table

cleos get table producerjson producerjson producerjson

Add to the table

cleos push action producerjson set '{"owner":"your_account", "json": "your_json"}' -p your_account@active

Example:

cleos push action producerjson set '{"owner":"teamgreymass", "json": "'`printf %q $(cat bp.json | tr -d "\r")`'"}' -p teamgreymass@active

Remove from the table

cleos push action producerjson del '{"owner":"your_account"}' -p your_account@active

How to build

./build.sh

or

eosiocpp -g producerjson.abi producerjson.cpp && eosiocpp -o producerjson.wast producerjson.cpp

How to deploy

cleos set contract producerjson producerjson -p producerjson@active

producerjson's People

Contributors

aaroncox avatar scottsallinen 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

producerjson's Issues

Add full JSON validation instead of sanity check

I think these two lines may become common source of errors if white space included in beginning or end of the JSON string:
eosio_assert(json[0] == '{', "payload must be json");
eosio_assert(json[json.size()-1] == '}', "payload must be json");

Since you are not doing true JSON validation - you may as well remove those lines.
It would be good to include full JSON validation - however that will require adding a new dependency to your contract file:
There are many JSON validation libraries available. We need to check if EOSIO code is already using one and reuse the same one.

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.