-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontract.sol
48 lines (38 loc) · 956 Bytes
/
contract.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 _uint;
bool _bool;
string _string;
/**
* @dev Store int value
* @param input value to store
*/
function store_int(uint256 input) public {
_uint = input;
}
/**
* @dev Store bool value
* @param input value to store
*/
function store_bool(bool input) public {
_bool = input;
}
function store_string(string memory input) public {
_string = input;
}
function get_int() public view returns(uint256) {
return _uint;
}
function get_bool() public view returns(bool) {
return _bool;
}
function get_string() public payable returns(string memory) {
require(msg.value > 10, "need to pay at least 10 wei");
return _string;
}
}