-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSelfKisser.sol
63 lines (48 loc) · 1.51 KB
/
SelfKisser.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import {IAuth} from "chronicle-std/auth/IAuth.sol";
import {Auth} from "chronicle-std/auth/Auth.sol";
import {IToll} from "chronicle-std/toll/IToll.sol";
import {ISelfKisser} from "./ISelfKisser.sol";
contract SelfKisser is ISelfKisser, Auth {
/// @dev Whether SelfKisser is dead.
uint internal _dead;
modifier live() {
if (_dead == 1) {
revert Dead();
}
_;
}
constructor(address initialAuthed) Auth(initialAuthed) {}
// -- User Functionality --
/// @inheritdoc ISelfKisser
function selfKiss(address oracle) external {
selfKiss(oracle, msg.sender);
}
/// @inheritdoc ISelfKisser
function selfKiss(address oracle, address who) public live {
IToll(oracle).kiss(who);
emit SelfKissed(msg.sender, oracle, who);
}
// -- View Functionality --
/// @inheritdoc ISelfKisser
function dead() external view returns (bool) {
return _dead == 1;
}
// -- Auth'ed Functionality --
/// @inheritdoc ISelfKisser
function kill() external auth {
if (_dead == 1) return;
_dead = 1;
emit Killed(msg.sender);
}
}
/**
* @dev Contract overwrite to deploy contract instances with specific naming.
*
* For more info, see docs/Deployment.md.
*/
contract SelfKisser_COUNTER is SelfKisser {
// @todo ^^^^^^^ Adjust name of SelfKisser instance.
constructor(address initialAuthed) SelfKisser(initialAuthed) {}
}