Skip to content

Commit

Permalink
refactor: add condition to Counter for property
Browse files Browse the repository at this point in the history
  • Loading branch information
nican0r committed Sep 26, 2024
1 parent 48e6999 commit f4fc0c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
19 changes: 0 additions & 19 deletions script/Counter.s.sol

This file was deleted.

8 changes: 5 additions & 3 deletions src/Counter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
pragma solidity ^0.8.13;

contract Counter {
uint256 public number;
uint256 public number = 1;

function setNumber(uint256 newNumber) public {
number = newNumber;
if (newNumber != 0) {
number = newNumber;
}
}

function increment() public {
number++;
}
}
}

0 comments on commit f4fc0c9

Please sign in to comment.