Giter Site home page Giter Site logo

dividend-erc20's Introduction

Run

  • Install dependencies
yarn install
  • Run tests
npx hardhat test

Test cases

DToken ✓ Ensure token deployed properly (50ms) ERC20 mint related tests ✓ mint() -- owner minting quantity for alice (49ms) ✓ mint() -- Bob trying to mint, should revert (39ms) ✓ mint() -- Owner trying to mint more than allowed quantity, should revert ✓ mint() -- Owner trying to mint more than allowed quantity over multiple calls should revert (101ms) Withdrawal related tests ✓ withdraw() -- Trying to call while locked, should revert ✓ withdraw() -- Ensure shares are distributed properly (107ms) ✓ withdraw() -- Verify transferring of debt properly with dividends (214ms) ✓ withdraw() -- ensure proper distribution with more general scenario (170ms) ✓ withdraw() -- Caller has no token balance, should revert Next Level Withdrawal related tests ✓ withdraw() -- Minting on different instants of fund receptions (196ms) ✓ withdraw() -- Minting on different instants of fund receptions (245ms) Withdrawal subtleties and possible attack ✓ withdraw() -- Resistant to reentrancy attack ✓ withdraw() -- Fund withdrawal failure, should revert Other tests ✓ Do not allow sending funds if no tokens are minted ✓ emergencyWithdraw() -- all funds of contract are withdrawn to owner (56ms) ✓ toggleLock() -- ✓ emergencyWithdraw() -- ensure only owner can call ✓ toggleLock() -- ensure only owner can call

dividend-erc20's People

Contributors

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