Code Monkey home page Code Monkey logo

ethereumtoken's Introduction

Ethereum Token


N|Solid

Build Status


Ethereum tokens is a representation of any good that is tradable from a physical object to a native currency used . In the future, tokens may even be used to represent financial instruments like stocks and bonds. In this sprint you will be able to build your own currency token and transfer it

Key Words


  • Web3
  • Solidity
  • Smart Contracts
  • Ganache
  • Infura

High Level Goals of this Sprint


  • Learn Solidity and how to write ethereal smart contracts.
  • Learn how to compile a contract with solidity compiler
  • Learn how to test your smart contracts using Ganache
  • Learn how to deploy your code on Rinkeby Test Network

Getting Started and Project Set Up


npm

This sprint uses npm to manage its dependencies. npm comes bundled with Node, and is another JavaScript package manager that makes it easy for developers to share and reuse code. Even though npm started in the Node ecosystem, it is quickly becoming the default choice for sharing all types of JavaScript code. what you need to do here is:

  1. Install Node.js if you haven't yet.
  2. Run npm install

Solc

JavaScript bindings for the Solidity compiler, the compiler can produce a range of choices, from simple binaries To use the latest stable version of the Solidity compiler via Node.js you can install it via npm:

Run npm install solc -save

npm scripts

npm comes with a handy scripting feature that lets you define shell commands inside of package.json, here in this project we set two scripts that you are going to use a lot. you can also define your own scripts if you feel the need to do so.

The Curriculum


Useful Links


The Project


Part One: EthToken

contracts/BCCoin.sol is the smart contract the when compiled and deployed; will represent your currency, to build this contract you need to achieve the following:

  • First, get familiar with the contracts/Interface.sol file and try to understand its functions with their parameters and answer the following question, what does this interface represent? and why do we use it? *Don’t add/delete comments in this file or you will get errors because they are considered part of the code

  • Run npm run test To Pass the Tests:

    • Start by implementing the functions declared in contracts/Interface.sol, inside contracts/BCCoin.sol file *Hint: The commented line in compile.js file will help you to fix your contract errors.
    • Implement getTokens(), getEthers() functions which will let the sender buy and sell his tokens. By completing the above, you've written the smart contract of your token, now it's the time to compile the code and deploy it.
    • inside of compile.js, you'll find the the compilation code written for you, read it carefully and understand it.
    • in the file Deploy.js you need to write the code that would deploy your compiled contract, in this project we are going to use the Rinkeby test network to depoly the contracts to it, and the hosted Ethereum node cluster, infura to achieve that.

Part Two: Front-End

In order to interact with your contract, we built a simple front-end for you, your job is:

  • Inside web3.js, to create an instance of Web3 with the right provider.
  • to complete src/token.js
  • Inside src/app.js,to fill the functions to make them work properly

Extra Credit

  • Think about a function you can add to let the owner generates new tokens if his balance is out of tokens
  • Inside of Metamask on your browser, go to add token and try to add your token, does it work properly? what do you think is the reason of that? make the necessary changes in your contracts folder to make work on metamask.

ethereumtoken's People

Contributors

azizsarrani avatar ibhzhazem avatar

Watchers

 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.