Coder Social home page Coder Social logo

mvltoken's Introduction

MVL Token smart contracts

MVL Token

MVL Token is ERC-20 token conforms following ERC-20 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md

Constants
  • name: 'Mass Vehicle Ledger'
  • symbol: 'MVL'
  • decimals: (uint8)18
  • totalSupply: (uint256)3e28
Methods
  • balanceOf: view (address) => (uint256)
  • transfer: (address, uint256) => (bool)
  • transferFrom: (address _from, address _to, uint256) => (bool)
  • approve: (address, uint256) => (bool)
  • allowance: (address _owner, address _spender) => (uint256)
  • increaseApproval: (address _spender, uint256 _addedValue) => (bool)
  • decreaseApproval: (address _spender, uint256 _subtractedValue) => (bool)
Events
  • Transfer(address indexed _from, address indexed _to, uint256 _value)
  • Approval(address indexed _owner, address indexed _spender, uint256 _value)
Note on N+M spend attack

There is an attack vector which exploits approve function to spend unwanted by spender. The discussion is here. Since EIP20 fixed its interface, so the suggestion of changing API isn't accepted.

Therefore, MVL token considers the work-around solution, hinted from MiniMeToken

The main idea of this, enforce token holder to call approve(spender, 0) before call it again with positive integer value. This is implemented here and tested here.

Build Environment

  • Solidity v0.4.19 (solc or solc-js both work)
  • Truffle v4.1.3 (core: 4.1.3)
  • Node.js v8.11.1 (for dependency mgmt.)
  • Docker (18.03.0-ce, build 0520e24, for oyente)

Test Environment & status

Build status CircleCI
Test & Coverage status Coverage Status

Commands
  • install dependencies
$ yarn install --frozen-lockfile --production=false
  • test command
$ truffle test

mvltoken's People

Contributors

mvlchaindev 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.