ksmit323 / FoundryGasOptimization

Optimize Solidity contract for gas efficiency. Testing done in Foundry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starting Deployment Cost:   2,541,445 gas
Current Deployment Cost:      173,058 gas
Reduction: 93%

GAS OPTIMIZATION

  • Task is to edit and optimize 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 tests & gas report with verbatim trace

Run: forge test --gas-report -vvvv

To run tests & gas report

Run: forge test --gas-report

To run a specific test

RUN:forge test --match-test {TESTNAME} -vvvv EG: forge test --match-test test_onlyOwner -vvvv

About

Optimize Solidity contract for gas efficiency. Testing done in Foundry


Languages

Language:Solidity 99.9%Language:Makefile 0.1%Language:Nix 0.0%