Skip to content

fadyOne/encode_expert_solidity_bootcamp

 
 

Repository files navigation

Gas optimization exercise

Your task is to edit and optimise the Gas.sol contract. You cannot edit the tests All the tests must pass. You can change the functionality of the contract as long as the tests pass. Try to get the gas usage as low as possible.

To run the tests

$ forge test --match-contract GasTest --gas-report

In this exercise, I was able to reduce the deployment cost and gas usage of the different functions from this:

Gas Before Optimization

To this:

Gas After Optimization

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 99.9%
  • Other 0.1%