forked from pooltogether/ERC5164
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Greeter.sol
32 lines (24 loc) · 952 Bytes
/
Greeter.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
//SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.16;
import "../../src/abstract/ExecutorAware.sol";
contract Greeter is ExecutorAware {
string public greeting;
event SetGreeting(
string greeting,
bytes32 messageId, // ID of the message that was executed
uint256 fromChainId, // ID of the chain that dispatched the message
address from, // _msgSender() is the address who dispatched the message on the origin chain
address l2Sender // MessageExecutor contract
);
constructor(address _executor, string memory _greeting) ExecutorAware(_executor) {
greeting = _greeting;
}
function greet() public view returns (string memory) {
return greeting;
}
function setGreeting(string memory _greeting) public {
require(isTrustedExecutor(msg.sender), "Greeter/sender-not-executor");
greeting = _greeting;
emit SetGreeting(_greeting, _messageId(), _fromChainId(), _msgSender(), msg.sender);
}
}