Giter VIP home page Giter VIP logo

merxnet's Introduction

Custom implementation of basic ERC20 token using OpenZeppelin library

Prerequisites

  1. Check if Node.js and truffle are installed by typing in your terminal: node -v and then truffle version

  2. Initialize truffle truffle init

  3. Create package.json file npm init

  4. Install OpenZeppelin library npm install openzeppelin-solidity

Steps

  1. Create MerxToken.sol file in the contracts folder.

  2. Import from OpenZeppelin libraries using import keyword. Please note the importing format is using forward slashes. If import is highligted red in your editor, add following to your user settings(e.g. in VSC):

"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules", 
  1. Create a constructor to pass in arguments into DetailedERC20.Update a truffle-config.js file with solc....

  2. Run truffle compile. 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 truffleand the npm install -g truffle

  3. Create 2_deploy_token.js in migrations folder.

  4. Run the blockchain emulator. Install npm install ganache-cli and run it ganache-cli.

  5. Modify truffle-config.js (truffle.js for Mac).

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

  7. Run truffle console. Test the blockchain by typing: truffle(development)>MerxNetToken.deployed().then((instance) =>{merx = instance}) and then merx

  8. To test, type merx.name(), merx.decimals()

Tests

  1. Write Merx.test.js in the test folder. See file for detailed steps.

  2. Double check the correctness of the await test, run truffle test (Expected result : 3 passing).

  3. Install chai npm install chai,npm i chai-as-promised and npm i chai-bignumber

  4. Run npm install

  5. ** 03/28/2019 There is a conflict I could not resolve between chai-bignumer and chai-as-promised libraries that results in failed test.**

merxnet's People

Contributors

monkrus avatar

Watchers

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