Skip to content
This repository has been archived by the owner. It is now read-only.
Fungible token implementation for the Ethereum blockchain.
Branch: master
Clone or download
MoMannn Merge pull request #11 from lknix/update_utils
Update ethereum-utils package
Latest commit 2f1d4ba Aug 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Initialize project Jun 4, 2018
contracts Fix code style Jun 7, 2018
migrations Initialize project Jun 4, 2018
test Merge pull request #10 from lknix/token_amount_fix Jun 22, 2018
.editorconfig Initialize project Jun 4, 2018
.eslintrc.js Initialize project Jun 4, 2018
.gitignore Initialize project Jun 4, 2018
.npmignore
.travis.yml Initialize project Jun 4, 2018
CONTRIBUTING.md Initialize project Jun 4, 2018
LICENSE
README.md Update README Jun 5, 2018
package-lock.json
package.json Update ethereum-utils package Jun 25, 2018
truffle.js Initialize project Jun 4, 2018

README.md

Build Status NPM Version Dependencies Status Bug Bounty

This is a complete implementation of the ERC-20 fungible token standard for the Ethereum blockchain. This is an open source project build with Truffle framework.

Purpose of this implementation is to provide a good starting point for anyone who wants to use and develop fungible tokens on the Ethereum blockchain. Instead of re-implementing the ERC-20 yourself you can use this code which has gone through multiple audits and we hope it will be extensively used by the community in the future.

Structure

Since this is a Truffle project, you will find all tokens in contracts/tokens/ directory.

Requirements

  • NodeJS 9.0+ recommended.
  • Windows, Linux or Mac OS X.

Installation

NPM

This is an NPM module for Truffle framework. In order to use it as a dependency in your Javascript project, you must install it through the npm command:

$ npm install @0xcert/ethereum-erc20

Source

Clone the repository and install the required npm dependencies:

$ git clone git@github.com:0xcert/ethereum-erc20.git
$ cd ethereum-erc20
$ npm install

Make sure that everything has been set up correctly:

$ npm run test

Usage

NPM

To interact with package's contracts within JavaScript code, you simply need to require that package's .json files:

const contract = require("@0xcert/ethereum-erc20/build/contracts/Token.json");
console.log(contract);

Source

Creating smart contract

The easiest way to start is to create a new file under contracts/tokens/ (e.g. MyToken.sol):

pragma solidity ^0.4.24;

import "../tokens/Token.sol";

contract MyToken is Token {

  constructor()
    public
  {
    tokenName = "My Token";
    tokenSymbol = "MTK";
    tokenDecimals = 18;
    tokenTotalSupply = 100000000000000000000000000;
    balances[msg.sender] = totalTokenSupply; // Give the owner of the contract the whole balance
  }
}

That's it. Let's compile the contract:

$ npm run compile

The easiest way to deploy it locally and start interacting with the contract (minting and transferring tokens) is to deploy it on your personal (local) blockchain using Ganache. Follow the steps in the Truffle documentation which are described here.

Contributing

See CONTRIBUTING.md for how to help out.

Licence

See LICENSE for details.

You can’t perform that action at this time.