Catalog npm
Back to packageRELEASE DETAILS

1.2.0

npm

@0xcert/ethereum-erc20

Fungible token standard implementation for the Ethereum blockchain.

blockchaincontractcontractseipercerc-20erc20ethethereumfungabilityfungiblesmartsmart-contractsmart-contractsstandardtoken
All keywords (17)
tokens
Published7 Jun 2018
Direct dependencies3
Transitive dependenciesNot calculated

README

Current package documentation

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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xcert/ethereum-utils
Environment
{
  "local_name": "@0xcert/ethereum-utils",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
truffle
Environment
{
  "local_name": "truffle",
  "alias": false,
  "peer_metadata": null
}
^4.1.11development
truffle-flattener
Environment
{
  "local_name": "truffle-flattener",
  "alias": false,
  "peer_metadata": null
}
^1.2.5development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-7uqxehZLS16ugUvD2BSLGJEzs71ovRIyet70ycsHNAI9xWKujtDKSVKEcQQELC0RoD1sZL8c5GXEi8x0qaqXoQ==",
  "shasum": "335ddf880c4e624641346571f42d6ed35067b5b9",
  "tarball": "https://registry.npmjs.org/@0xcert/ethereum-erc20/-/ethereum-erc20-1.2.0.tgz",
  "fileCount": 22,
  "unpackedSize": 765981,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGN03CRA9TVsSAnZWagAAkpAP/2sypIMcs8w2jzgSCNnK\nF2y5EDwSzI0EEioxv3Y43KCVA/6bw7W83aD6D2KRoCq+sVLHZafzZ3XgxBjW\n/7uf0bs4mh5WIloWugrict9hQuxJoB+9eOAxevlUCHaTxubWqSRFB50XM52K\noUaAl0/VhuvMfNCsPK3P+lcjIhPA5rmp7XyNHU4809iomi0lzjIG29c/Z1og\ntg+3WFPUJHn9mK0gvzzbTaxqfVd0RLekd6JYxa2O4hwMutR9DUGcDzoapDNa\n6YGdqUDCLdA/zuqcUX1V/A7juq8sQSPRn2cpKw7mqsBH/KNjdn+m0XZE4Aw9\nw4+XC3OmRbd399pp6f5xCDwUe+2UGXEeJrzFsOZC8uQjqFG32Xe+ceVtqo83\nIx8rF/YQle7n6c/giO8W+OcUsqh/q4c9+o+xxxMul9Vq5/it5E4Eb6q3DENQ\nHBlKuxAlfnCJxocBfiqdQ8+BYykcWThzh8ESOPe+yR9Firxy9cw0uJ34lOwp\n3pUrYILmhA2OEajmpETkdGUW+Dls8N7AfSsv1OYZjqqSrD+32Tl9ehffzCGC\nvFkw1zB1rVedvGfFVYJzK0fWVCpmWZMU0aJxtdiktcqNq9KPwXGB6NhvTqVs\nV9SXS/yvVv7T4a6Pu9OHk+u4dtBF40oVPfHhDWFunveQbzpnHD7n9PJ44+Ms\n/+vQ\r\n=02SS\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCICgWc1g+KMUEx5I2v4y+FTbMgyfmLD7t7g5L8seWSWQ2AiEA4GdybRMm6l798ptAmeYbUH1IrJUB1VvRBWrrpHynLgI="
    }
  ]
}

Repository

PENDING
0xcert/ethereum-erc20

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:45 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:7b23eba75c17204fbf6b5d00fb9208fb250014e3e04e6da741fac9377fbff4ff

Other collected versions

1.2.17 Jun1.1.06 Jun1.0.05 JunView all collected versions →