FoundryTesting/src/Counter.sol

23 lines
464 B
Solidity

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
contract Counter {
uint public count;
// Funcion to get the current count
function get() public view returns (uint) {
return count;
}
// Function to increment count by 1
function inc() public {
count += 1;
}
// Function to decrement count by 1
function dec() public {
// thid function will fail if count = 0
count -= 1;
}
}