-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGreeter.sol
More file actions
61 lines (50 loc) · 1.38 KB
/
Greeter.sol
File metadata and controls
61 lines (50 loc) · 1.38 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.7.0;
/*import "packages/lib/contracts/openzeppelin-solidity/ownership/Ownable.sol";*/
contract Greeter {
string private _greeting;
address private _owner;
bytes32[] showArray;
bytes32[5] ShowFixedArray;
struct Profile {
string firstName;
string LastName;
string city;
}
Profile contact;
constructor() public {
_owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == _owner, "Only Owner is allowed");
_;
}
function greet() external view returns (string memory) {
return _greeting;
}
function setGreeting(string calldata greeting) external onlyOwner {
_greeting = greeting;
}
function owner() public view returns (address) {
return _owner;
}
function kill() public {
if (msg.sender == _owner) {
selfdestruct(msg.sender);
}
}
function fillArray() public {
ShowFixedArray[0] = "Test1";
showArray.push("Test2");
return;
}
function setProfile() public {
contact = Profile("Jay", "Garrick", "Sydney");
}
function getProfile() public view returns (string memory) {
return contact.firstName;
}
function payGreeter(uint256 NameID) public payable returns (uint256) {
return NameID;
}
}