Giter VIP home page Giter VIP logo

remittance's Introduction

Project

  1. There are three people: Alice, Bob & Carol.

  2. Alice wants to send funds to Bob, but she only has ether & Bob does not care about Ethereum and wants to be paid in local currency.

  3. Luckily, Carol runs an exchange shop that converts ether to local currency.

  4. Therefore, to get the funds to Bob, Alice will allow the funds to be transferred through Carol's exchange shop. Carol will collect the ether from Alice and give the local currency to Bob.

  5. The steps involved in the operation are as follows:

  6. Alice creates a Remittance contract with Ether in it and a puzzle.

  7. Alice sends a one-time-password to Bob; over SMS, say.

  8. Alice sends another one-time-password to Carol; over email, say.

  9. Bob treks to Carol's shop.

  10. Bob gives Carol his one-time-password.

  11. Carol submits both passwords to Alice's remittance contract.

  12. Only when both passwords are correct does the contract yield the Ether to Carol.

  13. Carol gives the local currency to Bob.

  14. Bob leaves.

  15. Alice is notified that the transaction went through.

Setting up your environment

  • Check if Node.js and truffle are installed by typing in your terminal:

    • node -v
    • and then truffle version
  • Install Ganache

  • Initialize truffle truffle init to build a basic Truffle project

  • Create package.json file by typing npm init

  • Install OpenZeeplin library npm install openzeppelin-solidity

  • Write contracts in the contracts folder.

  • Modify truffle-config.js file (truffle.js for Mac).

  • Run truffle compile to compile the contract

    • Please check the required version of the Solidity compiler (for all .sol files including imported libraries)
    • by running truffle version.
    • If needed, run npm uninstall -g truffle
    • and the npm install -g truffle
  • Create 2_splitter_migration.js in the migrations folder.

  • Run Ganache on your machine (select Quickstart)

  • Run truffle migrate --reset to migrate the contract.

remittance's People

Contributors

monkrus avatar ebazhanov avatar

Watchers

James Cloos avatar  avatar  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.