dead_storage_elimination.sol 363 B

123456789101112131415
  1. contract test {
  2. int256 a;
  3. // this function reads a twice; this can be reduced to one load
  4. function redundant_load() public returns (int256) {
  5. return a + a;
  6. }
  7. // this function writes to contract storage thrice. This can be reduced to one
  8. function redundant_store() public {
  9. delete a;
  10. a = 1;
  11. a = 2;
  12. }
  13. }