endstep2
This commit is contained in:
19
tokenizerRendu/code/contracts/Counter.sol
Normal file
19
tokenizerRendu/code/contracts/Counter.sol
Normal file
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.34;
|
||||
|
||||
contract Counter {
|
||||
uint public x;
|
||||
|
||||
event Increment(uint by);
|
||||
|
||||
function inc() public {
|
||||
x++;
|
||||
emit Increment(1);
|
||||
}
|
||||
|
||||
function incBy(uint by) public {
|
||||
require(by > 0, "incBy: increment should be positive");
|
||||
x += by;
|
||||
emit Increment(by);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user