Giter Site home page Giter Site logo

sui-blockbuster's Introduction

This repo features the blockbuster video renting shop where users can rent videos.

Shops: 
    A Shop is a global shared object that is managed by the shop owner. The shop object holds 
    items and the balance of SUI coins in the shop. 

Shop ownership: 
    Ownership of the Shop object is represented by holding the shop owner capability object. 
    The shop owner has the ability to add items to the shop, unlist items, and withdraw from 
    the shop. 

Adding items to a shop: 
    The shop owner can add items to their shop with the add_item function.

Renting an item: 
    Anyone has the ability to rent an item that is listed. When an item is rented, the 
    user will receive item and has to pay a fee + deposit. The deposit will be returned if item is 
    returned within the time limit. 

Unlisting an item: 
    The shop owner can unlist an item from their shop with the unlist_item function. When an 
    item is unlisted, it will no longer be available for renting.

Returning an item: 
    Renter has the ability to rent an item that they have rented, provided that it hasn't expired. 
    The item will be burned.
    The deposit will be returned if return success. 

Declaring an item has expired: 
    Anyone has the ability to call this function as long as they have the item object id. 
    The deposit will be transfered to the shop balance.

Withdrawing from a shop: 
    The shop owner can withdraw SUI from their shop with the withdraw_from_shop function. The shop 
    owner can withdraw any amount from their shop that is equal to or below the total amount in 
    the shop. The amount withdrawn will be sent to the recipient address specified.

sui-blockbuster's People

Contributors

coolestnick avatar huisq 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.