-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathOneOfUs.sol
More file actions
92 lines (63 loc) · 3.25 KB
/
Copy pathOneOfUs.sol
File metadata and controls
92 lines (63 loc) · 3.25 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
interface IOneOfUs {
function init(uint128 _value, bool _callReply) external returns (bytes32 messageId);
function oneOfUsJoinUs(uint128 _value, bool _callReply) external returns (bytes32 messageId);
function oneOfUsCount(uint128 _value, bool _callReply) external returns (bytes32 messageId);
function oneOfUsIsOneOfUs(uint128 _value, bool _callReply, bytes32 addr) external returns (bytes32 messageId);
function oneOfUsList(uint128 _value, bool _callReply, uint32 page, uint32 pageSize)
external
returns (bytes32 messageId);
function oneOfUsVersion(uint128 _value, bool _callReply) external returns (bytes32 messageId);
}
contract OneOfUsAbi is IOneOfUs {
function init(uint128 _value, bool _callReply) external returns (bytes32 messageId) {}
function oneOfUsJoinUs(uint128 _value, bool _callReply) external returns (bytes32 messageId) {}
function oneOfUsCount(uint128 _value, bool _callReply) external returns (bytes32 messageId) {}
function oneOfUsIsOneOfUs(uint128 _value, bool _callReply, bytes32 addr) external returns (bytes32 messageId) {}
function oneOfUsList(uint128 _value, bool _callReply, uint32 page, uint32 pageSize)
external
returns (bytes32 messageId)
{}
function oneOfUsVersion(uint128 _value, bool _callReply) external returns (bytes32 messageId) {}
}
interface IOneOfUsCallbacks {
function replyOn_init(bytes32 messageId) external;
function replyOn_oneOfUsJoinUs(bytes32 messageId, bool reply) external;
function replyOn_oneOfUsCount(bytes32 messageId, uint32 reply) external;
function replyOn_oneOfUsIsOneOfUs(bytes32 messageId, bool reply) external;
function replyOn_oneOfUsList(bytes32 messageId, bytes32[] calldata reply) external;
function replyOn_oneOfUsVersion(bytes32 messageId, uint32 reply) external;
function onErrorReply(bytes32 messageId, bytes calldata payload, bytes4 replyCode) external;
}
contract OneOfUsCaller is IOneOfUsCallbacks {
IOneOfUs public immutable gearExeProgram;
constructor(IOneOfUs _gearExeProgram) {
gearExeProgram = _gearExeProgram;
}
modifier onlyGearExeProgram() {
require(msg.sender == address(gearExeProgram), "Only Gear.exe program can call this function");
_;
}
function replyOn_init(bytes32 messageId) external onlyGearExeProgram {
// TODO: implement this
}
function replyOn_oneOfUsJoinUs(bytes32 messageId, bool reply) external onlyGearExeProgram {
// TODO: implement this
}
function replyOn_oneOfUsCount(bytes32 messageId, uint32 reply) external onlyGearExeProgram {
// TODO: implement this
}
function replyOn_oneOfUsIsOneOfUs(bytes32 messageId, bool reply) external onlyGearExeProgram {
// TODO: implement this
}
function replyOn_oneOfUsList(bytes32 messageId, bytes32[] calldata reply) external onlyGearExeProgram {
// TODO: implement this
}
function replyOn_oneOfUsVersion(bytes32 messageId, uint32 reply) external onlyGearExeProgram {
// TODO: implement this
}
function onErrorReply(bytes32 messageId, bytes calldata payload, bytes4 replyCode) external onlyGearExeProgram {
// TODO: implement this
}
}