Initial commit: add .gitignore and README
This commit is contained in:
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