Giter Site home page Giter Site logo

name_bidding_app's Introduction

Name Bidding App

This repository contains code for a Name Bidding DAPP. It contains a simple React UI which interacts with an ethereum solidity contract, which in turn handles several scenarios which might occur in a Name Bidding App like reserving a name, releasing it, placing bids on names, accepting bids and transferring funds using name.

Installation

  1. npm and node is required.

  2. Install Truffle globally.

    npm install -g truffle
    
  3. Install node modules.

    npm install
    
  4. Start local test blockchain

    npm install -g ganache-cli
    ganache-cli --gasLimit 300000000
    

    NOTE: Need to convert NameContract into smaller contracts in order to fit under mainNet gasLimit

  5. Go inside contracts folder and deploy the contracts to a local ethereum network

    truffle compile
    truffle migrate
    
  6. Run tests for JS and solidity.

    truffle test
    
  7. Start the application. Should be available at http://localhost:3000

    npm run start
    

Features And Assumptions

1. Reserve Name

  • A name can be reserved by anyone for some amount of ether, the amount is sent to the contract Owner.
  • Name can be reserved only if available.
  • Event NameReserved logged

2. Release Name

  • It releases the name and makes it available to everyone.
  • NOTE: Does not send back the ether to owner
  • Event NameReleased logged

3. Place Bid

  • Places bid for an already reserved name.
  • The bid amount has to be greater than the amount that owner has purchased the name at.
  • Event BidPlaced logged
  • NOTE: A user who has already placed a bid, can only place a new bid, cannot update existing bid.

4. Accept the highest bid

  • Accepts the highest bid present in the system, transfers name to highest bidder and returns ether to all low bidders.
  • Event HighestBidAccepted logged
  • NOTE: Can only be called by the owner of the name.

5. Transfer funds to an owner of name

  • Can transfer funds to anyone in the system using name.
  • Event ReturnEtherToLowBidOwner logged

6. Name Available

  • Checks if name is available.

5. Get Name Details

  • Gets name owner and name bid of a reserved name.

5. Retrieve Bids

  • Gets all the bids placed against a name for a particular index.

Testing

  • Deployed and tested by using the truffle framework
  • Run truffle test
  • NameContract.js and TestNameContract.sol contains in total 12 tests which test all of the above scenarios

Author

name_bidding_app's People

Contributors

kohlisuraj avatar

Forkers

lordmen99

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.