Git Product home page Git Product logo

challenge-1-decentralized-staking's Introduction

👨‍💻 About Me :

I am Umair, a seasoned Software Engineer with 3+ years of professional experience .

  • 🔭 I’m currently working as a Frontend Engineer and contributing to multiple client projects.

  • 🌱 I specialize in React.js, Next.js, Typescript, Nodejs.

  • ⚡ In my free time, I love to write tech articles and guides on my Blog (HelpMeGeek.com).

  • 📫How to reach me: Email Badge


🛠️ Tech Stack :

React NextJS Typescript NodeJS Javascript HTML css3 solidity ethereum tailwindcss Git VS Code

🔥 My Stats :

GitHub Streak

Top Langs


✍️ Recent Blog Posts :

challenge-1-decentralized-staking's People

Contributors

0xsama avatar austintgriffith avatar azf20 avatar btogzhan2000 avatar calvbore avatar carletex avatar changoman avatar chris-kag avatar clacladev avatar codenamejason avatar dmaulick-cb avatar forshtat avatar gregplumbly avatar grothem avatar hodlplus2021 avatar iqdecay avatar ironsoul0 avatar j2r5m3 avatar jacobwillemsma avatar kevinmcmahon avatar owlwilderness avatar pabloruiz55 avatar shravansunder avatar stermi avatar thesuperb1 avatar tomafrench avatar umair-mirza avatar x93xk avatar yutingzhao1991 avatar zakgriffith avatar

Watchers

 avatar  avatar

Forkers

dapang518518

challenge-1-decentralized-staking's Issues

Remarks

  1. Please give names to the parameters in your Stake event. It makes it easy to understand your code, its purpose, and will be helpful for indexing (like creating a subgraph).
  2. Good practice to always set initializing values even when opting for default ones (openForWithdraw state variable)
  3. Your execute function can be more optimized if you check for openForWithdraw. As we know that execute has been already performed if the variable is true.
function execute() public notCompleted {
    //if excuted was performed succesfully before, show an error to reflect this//
    require(!openForWithdraw, "Actions has been already performed!");
    // if deadline is not passed, show error to refelct it//
    require(block.timestamp > deadline, "Deadline is not completed yet!");
    // if is used instead of require becasu we have a counter action to set "openForWithdraw" to true//�
    if(address(this).balance >= threshold) {
      exampleExternalContract.complete{value: address(this).balance}();
    } else {
      // If the `threshold` was not met, allow everyone to call a `withdraw()` function
      openForWithdraw = true;
    }
  }
  1. Bug in withdraw function. You are not updating the balances which will allow user to withdraw multiple times.
  2. Your modifiers must be above functions to follow best practices and conventions.
  3. Good job on deploying and verifying the contract. Please try to link them in readme.
  4. Lack of comments. Please add comments with @notice, @params, etc to make your code easy to understand

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.