GithubHelp home page GithubHelp logo

erc20's Introduction

Токен MEGA ERC20

Для контракта написаны тесты и прозведен анализ покрытия. В контракте имеются все методы описанные в стандарте EIP-20: Token Standard https://eips.ethereum.org/EIPS/eip-20 , а так же добавлены функции mint и burn.

npx hardhat test

  • Checking ERC20 functions
  • √ Checking functions - symbol(), decimals(), name(), totalSupply() (151ms)
  • √ Checking function mint() event Transfer (196ms)
  • √ Checking function balanceOf() (153ms)
  • √ Checking function transfer(), event Transfer (165ms)
  • √ Checking function event Approval, aprove(), allowance(), increaseAllowance(), decreaseAllowance() (156ms)
  • √ Checking function transferFrom() (160ms)
  • √ Checking function burn() (91ms)
  • √ Checking contract creater is an owner
  • √ Checking Should assign the total supply of tokens to the owner

npx hardhat coverage

------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
 contracts\ |      100 |       95 |      100 |      100 |                |
  ERC20.sol |      100 |       95 |      100 |      100 |                |
------------|----------|----------|----------|----------|----------------|
All files   |      100 |       95 |      100 |      100 |                |
------------|----------|----------|----------|----------|----------------|
5% Branch снято из-за отсутствия покрытия require(_owner != address(0), "_owner the zero address"); в _approve(...). 
В данной реализации контракта проверить require нельзя, 
но убирать его не желательно т.к в случае использования данного кода могут 
воспользоваться внутренней функцией _approve и передать некорректные параметры.

В проекте составлены следующие tasks:

  • task("transferFrom", "transfer tokens for person")
  • task("approve", "approve tokens transfer for another person")
  • task("transfer", "Transfer tokens MEGA(ERC20)")

erc20's People

Watchers

 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.