Code Monkey home page Code Monkey logo

tezos-food-dapp's Introduction

Smart contract to buy food

This Smart Contract Is Used For Testing Purposes

Smart contract featues

  • Made using cameLIGO
  • A Smart contract use to order food
  • Some food can't be bought if not_sale = true
  • Add discount percent on food based on sale_off variable

View contract using Better Call Dev!
https://better-call.dev/granadanet/KT1MTR7FX8mtav5moQXiR5aNQmFj8FJ6BnDf

The address of your contract is:

KT1MTR7FX8mtav5moQXiR5aNQmFj8FJ6BnDf

The initial storage of contract is:

[ { "prim": "Elt", "args": [ { "int": "0" }, { "prim": "Pair", "args": [ { "prim": "Pair", "args": [ { "prim": "Pair", "args": [ { "string": "KT19hXKZjvg7KqQw78qfsbTQzZ5FMbNvkt7v" }, { "int": "5" } ] }, { "string": "Desert" }, { "string": "Dark sweet fresh chocolate" } ] }, { "prim": "Pair", "args": [ { "string": "Chocolate" }, { "int": "2" } ] }, { "prim": "True" }, { "int": "10" } ] } ] }, { "prim": "Elt", "args": [ { "int": "1" }, { "prim": "Pair", "args": [ { "prim": "Pair", "args": [ { "prim": "Pair", "args": [ { "string": "KT1QhzsrJkRmvEVEie45EPhMp5KY2nbGwKG2" }, { "int": "15" } ] }, { "string": "Sea food" }, { "string": "Vinegared rice seafood and vegetables" } ] }, { "prim": "Pair", "args": [ { "string": "Sushi Plate" }, { "int": "1" } ] }, { "prim": "False" }, { "int": "20" } ] } ] } ]

Storage

Example:

Map.literal [ 
  (0n, { 
    food_available = 5n ; 
    food_address = ("KT19hXKZjvg7KqQw78qfsbTQzZ5FMbNvkt7v" : address); 
    food_price = 2mutez ; 
    not_sale = true ; 
    food_name = "Chocolate" ;
    food_category = "Desert" ;
    food_description = "Dark sweet fresh chocolate" ;
    sale_off = 10n ;

  }); 
  (1n, { 
    food_available = 15n; 
    food_address = ("KT1QhzsrJkRmvEVEie45EPhMp5KY2nbGwKG2" : address); 
    food_price = 1mutez ;
    not_sale = false ; 
    food_name = "Sushi Plate" ;
    food_category = "Sea food" ;
    food_description = "Vinegared rice seafood and vegetables" ;
    sale_off = 20n ;
  })
]

tezos-food-dapp's People

Contributors

anhfactor 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.