Skip to content

Commit aa7911b

Browse files
committed
re-add contract docs with camelCase
1 parent 4dbc26f commit aa7911b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4592
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# `IGenericErrors`
2+
3+
### ZeroAddressNotAllowed
4+
5+
```solidity
6+
error ZeroAddressNotAllowed()
7+
```
8+
9+
_Thrown when a parameter is the zero address._
10+
11+
### ZeroHashNotAllowed
12+
13+
```solidity
14+
error ZeroHashNotAllowed()
15+
```
16+
17+
_Thrown when a parameter is the zero hash._
18+
19+
### ArrayLengthsDoNotMatch
20+
21+
```solidity
22+
error ArrayLengthsDoNotMatch()
23+
```
24+
25+
_Thrown when array lengths are mismatched._
26+
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# `IMessageService`
2+
3+
### MessageSent
4+
5+
```solidity
6+
event MessageSent(address _from, address _to, uint256 _fee, uint256 _value, uint256 _nonce, bytes _calldata, bytes32 _messageHash)
7+
```
8+
9+
Emitted when a message is sent.
10+
11+
__calldata has the _ because calldata is a reserved word.
12+
We include the message hash to save hashing costs on the rollup.
13+
This event is used on both L1 and L2._
14+
15+
#### Parameters
16+
17+
| Name | Type | Description |
18+
| ---- | ---- | ----------- |
19+
| _from | address | The indexed sender address of the message (msg.sender). |
20+
| _to | address | The indexed intended recipient address of the message on the other layer. |
21+
| _fee | uint256 | The fee being being paid to deliver the message to the recipient in Wei. |
22+
| _value | uint256 | The value being sent to the recipient in Wei. |
23+
| _nonce | uint256 | The unique message number. |
24+
| _calldata | bytes | The calldata being passed to the intended recipient when being called on claiming. |
25+
| _messageHash | bytes32 | The indexed hash of the message parameters. |
26+
27+
### MessageClaimed
28+
29+
```solidity
30+
event MessageClaimed(bytes32 _messageHash)
31+
```
32+
33+
Emitted when a message is claimed.
34+
35+
#### Parameters
36+
37+
| Name | Type | Description |
38+
| ---- | ---- | ----------- |
39+
| _messageHash | bytes32 | The indexed hash of the message that was claimed. |
40+
41+
### FeeTooLow
42+
43+
```solidity
44+
error FeeTooLow()
45+
```
46+
47+
_Thrown when fees are lower than the minimum fee._
48+
49+
### ValueSentTooLow
50+
51+
```solidity
52+
error ValueSentTooLow()
53+
```
54+
55+
_Thrown when the value sent is less than the fee.
56+
Value to forward on is msg.value - _fee._
57+
58+
### MessageSendingFailed
59+
60+
```solidity
61+
error MessageSendingFailed(address destination)
62+
```
63+
64+
_Thrown when the destination address reverts._
65+
66+
### FeePaymentFailed
67+
68+
```solidity
69+
error FeePaymentFailed(address recipient)
70+
```
71+
72+
_Thrown when the recipient address reverts._
73+
74+
### sendMessage
75+
76+
```solidity
77+
function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable
78+
```
79+
80+
Sends a message for transporting from the given chain.
81+
82+
_This function should be called with a msg.value = _value + _fee. The fee will be paid on the destination chain._
83+
84+
#### Parameters
85+
86+
| Name | Type | Description |
87+
| ---- | ---- | ----------- |
88+
| _to | address | The destination address on the destination chain. |
89+
| _fee | uint256 | The message service fee on the origin chain. |
90+
| _calldata | bytes | The calldata used by the destination message service to call the destination contract. |
91+
92+
### claimMessage
93+
94+
```solidity
95+
function claimMessage(address _from, address _to, uint256 _fee, uint256 _value, address payable _feeRecipient, bytes _calldata, uint256 _nonce) external
96+
```
97+
98+
Deliver a message to the destination chain.
99+
Is called by the Postman, dApp or end user.
100+
101+
#### Parameters
102+
103+
| Name | Type | Description |
104+
| ---- | ---- | ----------- |
105+
| _from | address | The msg.sender calling the origin message service. |
106+
| _to | address | The destination address on the destination chain. |
107+
| _fee | uint256 | The message service fee on the origin chain. |
108+
| _value | uint256 | The value to be transferred to the destination address. |
109+
| _feeRecipient | address payable | Address that will receive the fees. |
110+
| _calldata | bytes | The calldata used by the destination message service to call/forward to the destination contract. |
111+
| _nonce | uint256 | Unique message number. |
112+
113+
### sender
114+
115+
```solidity
116+
function sender() external view returns (address originalSender)
117+
```
118+
119+
Returns the original sender of the message on the origin layer.
120+
121+
#### Return Values
122+
123+
| Name | Type | Description |
124+
| ---- | ---- | ----------- |
125+
| originalSender | address | The original sender of the message on the origin layer. |
126+
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# `IPauseManager`
2+
3+
### PauseTypeRole
4+
5+
```solidity
6+
struct PauseTypeRole {
7+
enum IPauseManager.PauseType pauseType;
8+
bytes32 role;
9+
}
10+
```
11+
12+
### PauseType
13+
14+
```solidity
15+
enum PauseType {
16+
UNUSED,
17+
GENERAL,
18+
L1_L2,
19+
L2_L1,
20+
BLOB_SUBMISSION,
21+
CALLDATA_SUBMISSION,
22+
FINALIZATION,
23+
INITIATE_TOKEN_BRIDGING,
24+
COMPLETE_TOKEN_BRIDGING
25+
}
26+
```
27+
28+
### Paused
29+
30+
```solidity
31+
event Paused(address messageSender, enum IPauseManager.PauseType pauseType)
32+
```
33+
34+
Emitted when a pause type is paused.
35+
36+
#### Parameters
37+
38+
| Name | Type | Description |
39+
| ---- | ---- | ----------- |
40+
| messageSender | address | The address performing the pause. |
41+
| pauseType | enum IPauseManager.PauseType | The indexed pause type that was paused. |
42+
43+
### UnPaused
44+
45+
```solidity
46+
event UnPaused(address messageSender, enum IPauseManager.PauseType pauseType)
47+
```
48+
49+
Emitted when a pause type is unpaused.
50+
51+
#### Parameters
52+
53+
| Name | Type | Description |
54+
| ---- | ---- | ----------- |
55+
| messageSender | address | The address performing the unpause. |
56+
| pauseType | enum IPauseManager.PauseType | The indexed pause type that was unpaused. |
57+
58+
### PauseTypeRoleSet
59+
60+
```solidity
61+
event PauseTypeRoleSet(enum IPauseManager.PauseType pauseType, bytes32 role)
62+
```
63+
64+
Emitted when a pause type and its associated role are set in the `_pauseTypeRoles` mapping.
65+
66+
#### Parameters
67+
68+
| Name | Type | Description |
69+
| ---- | ---- | ----------- |
70+
| pauseType | enum IPauseManager.PauseType | The indexed type of pause. |
71+
| role | bytes32 | The indexed role associated with the pause type. |
72+
73+
### UnPauseTypeRoleSet
74+
75+
```solidity
76+
event UnPauseTypeRoleSet(enum IPauseManager.PauseType unPauseType, bytes32 role)
77+
```
78+
79+
Emitted when an unpause type and its associated role are set in the `_unPauseTypeRoles` mapping.
80+
81+
#### Parameters
82+
83+
| Name | Type | Description |
84+
| ---- | ---- | ----------- |
85+
| unPauseType | enum IPauseManager.PauseType | The indexed type of unpause. |
86+
| role | bytes32 | The indexed role associated with the unpause type. |
87+
88+
### IsPaused
89+
90+
```solidity
91+
error IsPaused(enum IPauseManager.PauseType pauseType)
92+
```
93+
94+
_Thrown when a specific pause type is paused._
95+
96+
### IsNotPaused
97+
98+
```solidity
99+
error IsNotPaused(enum IPauseManager.PauseType pauseType)
100+
```
101+
102+
_Thrown when a specific pause type is not paused and expected to be._
103+
104+
### pauseByType
105+
106+
```solidity
107+
function pauseByType(enum IPauseManager.PauseType _pauseType) external
108+
```
109+
110+
Pauses functionality by specific type.
111+
112+
_Requires the role mapped in pauseTypeRoles for the pauseType._
113+
114+
#### Parameters
115+
116+
| Name | Type | Description |
117+
| ---- | ---- | ----------- |
118+
| _pauseType | enum IPauseManager.PauseType | The pause type value. |
119+
120+
### unPauseByType
121+
122+
```solidity
123+
function unPauseByType(enum IPauseManager.PauseType _pauseType) external
124+
```
125+
126+
Unpauses functionality by specific type.
127+
128+
_Requires the role mapped in unPauseTypeRoles for the pauseType._
129+
130+
#### Parameters
131+
132+
| Name | Type | Description |
133+
| ---- | ---- | ----------- |
134+
| _pauseType | enum IPauseManager.PauseType | The pause type value. |
135+
136+
### isPaused
137+
138+
```solidity
139+
function isPaused(enum IPauseManager.PauseType _pauseType) external view returns (bool pauseTypeIsPaused)
140+
```
141+
142+
Check if a pause type is enabled.
143+
144+
#### Parameters
145+
146+
| Name | Type | Description |
147+
| ---- | ---- | ----------- |
148+
| _pauseType | enum IPauseManager.PauseType | The pause type value. |
149+
150+
#### Return Values
151+
152+
| Name | Type | Description |
153+
| ---- | ---- | ----------- |
154+
| pauseTypeIsPaused | bool | Returns true if the pause type if paused, false otherwise. |
155+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `IPermissionsManager`
2+
3+
### RoleAddress
4+
5+
```solidity
6+
struct RoleAddress {
7+
address addressWithRole;
8+
bytes32 role;
9+
}
10+
```
11+

0 commit comments

Comments
 (0)