Initial commit: add .gitignore and README
This commit is contained in:
3404
smart_contracts/contracts/Counter.json
Normal file
3404
smart_contracts/contracts/Counter.json
Normal file
File diff suppressed because one or more lines are too long
14
smart_contracts/contracts/Counter.sol
Normal file
14
smart_contracts/contracts/Counter.sol
Normal file
@@ -0,0 +1,14 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.10;
|
||||
contract Counter {
|
||||
int private count = 0;
|
||||
function incrementCounter() public {
|
||||
count += 1;
|
||||
}
|
||||
function decrementCounter() public {
|
||||
count -= 1;
|
||||
}
|
||||
function getCount() public view returns (int) {
|
||||
return count;
|
||||
}
|
||||
}
|
||||
6145
smart_contracts/contracts/SimpleStorage.json
Normal file
6145
smart_contracts/contracts/SimpleStorage.json
Normal file
File diff suppressed because one or more lines are too long
18
smart_contracts/contracts/SimpleStorage.sol
Normal file
18
smart_contracts/contracts/SimpleStorage.sol
Normal file
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.10;
|
||||
|
||||
contract SimpleStorage {
|
||||
uint public storedData;
|
||||
event stored(address _to, uint _amount);
|
||||
constructor(uint initVal) {
|
||||
emit stored(msg.sender, initVal);
|
||||
storedData = initVal;
|
||||
}
|
||||
function set(uint x) public {
|
||||
emit stored(msg.sender, x);
|
||||
storedData = x;
|
||||
}
|
||||
function get() view public returns (uint retVal) {
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user