Giter Site home page Giter Site logo

rareskills / gas-puzzles Goto Github PK

View Code? Open in Web Editor NEW
452.0 452.0 170.0 5.83 MB

A sequence of smart contracts to practice gas optimization. These are used as practice assignments for RareSkills.io and the Udemy Gas Optimization Course

Home Page: https://rareskills.io

License: GNU Affero General Public License v3.0

Solidity 33.80% JavaScript 66.20%

gas-puzzles's People

Contributors

burke-md avatar jeffreyscholz avatar jesperkristensen58 avatar omahs avatar rareskills avatar remedcu avatar uranium93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gas-puzzles's Issues

Gitcoin - Create a new gas puzzle!

Contribute a new gas puzzle to the RareSkills.io repo. To qualify, your gas puzzle must:

  • Follow the same pattern as the ones in this repo
  • Inefficient code must be realistic and clean. The point is to teach developers how to make reasonable code great, not how to fix ugly code.
  • The gas target must require using a non-obvious trick or two, but should not require excessive and highly advanced optimization, unless explicitly marked as such. (See ERC165 for an example)
  • The problem should be realistic. Puzzles that are clearly useless like "discover if the calldata is a palindrome" won't be accepted.
  • However, solutions don't have to be safe or realistic. The point is to drill knowledge of the EVM.

For this bounty, only one solution will be accepted.

Trouble with Distribute challenge

I am having some trouble trying to optimize the Distribute contract. I believe that I need to do something about the transfer functions. I tried putting the 4 transfers in a for loop and also defining a local memory array that copies the contributors storage array, so that it does not get cold access for each element. But nothing of that worked. Could you give some tip that can help me solve this challenge? Thank you

Nonpayable test

Non payable functions should have a unit test to ensure they stay nonpayable.

Business logic unit tests

There should be unit tests to ensure people aren't hardcoding solutions. These should pass if the logic is adhered to and not measure the gas cost. This is to let people know they didn't break things as they update the contract.

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.