-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.sol
More file actions
43 lines (35 loc) · 1014 Bytes
/
HelloWorld.sol
File metadata and controls
43 lines (35 loc) · 1014 Bytes
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
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract HelloWorld {
string private text;
address public temporaryOwner;
address public masterOwner;
constructor() {
text = "Hello World";
temporaryOwner = msg.sender;
masterOwner = msg.sender;
}
function helloWorld() public view returns (string memory) {
return text;
}
function setText(string calldata newText) public onlyOwner {
text = newText;
}
function transferOwnership(address newOwner) public onlyOwner {
temporaryOwner = newOwner;
}
function revertTransferOwner() public onlyMasterOwner {
require(temporaryOwner != masterOwner);
temporaryOwner = masterOwner;
}
modifier onlyOwner()
{
require (msg.sender == temporaryOwner, "Caller is not the owner");
_;
}
modifier onlyMasterOwner()
{
require (msg.sender == masterOwner, "Caller is not the owner");
_;
}
}