Skip to content

Commit 9e7d55d

Browse files
committed
feat: add cross chain governance contracts to technical documentation
1 parent 668bde4 commit 9e7d55d

File tree

6 files changed

+936
-0
lines changed

6 files changed

+936
-0
lines changed

SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@
155155
* [Timelock](technical-reference/reference-governance/timelock.md)
156156
* [GovernorBravoInterfaces](technical-reference/reference-governance/governor-bravo-interfaces.md)
157157
* [AccessControlledV8](technical-reference/reference-governance/access-controlled-v8.md)
158+
* [BaseOmnichainControllerSrc](technical-reference/reference-governance/base-omnichain-controller-src.md)
159+
* [BaseOmnichainControllerDest](technical-reference/reference-governance/base-omnichain-controller-dest.md)
160+
* [OmnichainProposalSender](technical-reference/reference-governance/omnichain-proposal-sender.md)
161+
* [OmnichainGovernanceExecutor](technical-reference/reference-governance/omnichain-governance-executor.md)
162+
* [OmnichainExecutorOwner](technical-reference/reference-governance/omnichain-executor-owner.md)
158163
* [Token Converter](technical-reference/reference-token-converter/README.md)
159164
* [AbstractTokenConverter](technical-reference/reference-token-converter/AbstractTokenConverter.md)
160165
* [RiskFundConverter](technical-reference/reference-token-converter/RiskFundConverter.md)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# BaseOmnichainControllerDest
2+
3+
# Solidity API
4+
5+
### maxDailyReceiveLimit
6+
7+
Maximum daily limit for receiving commands from Binance chain
8+
9+
```solidity
10+
uint256 maxDailyReceiveLimit
11+
```
12+
13+
---
14+
15+
### last24HourCommandsReceived
16+
17+
Total received commands within the last 24-hour window from Binance chain
18+
19+
```solidity
20+
uint256 last24HourCommandsReceived
21+
```
22+
23+
---
24+
25+
### last24HourReceiveWindowStart
26+
27+
Timestamp when the last 24-hour window started from Binance chain
28+
29+
```solidity
30+
uint256 last24HourReceiveWindowStart
31+
```
32+
33+
---
34+
35+
### setMaxDailyReceiveLimit
36+
37+
Sets the maximum daily limit for receiving commands
38+
39+
```solidity
40+
function setMaxDailyReceiveLimit(uint256 limit_) external
41+
```
42+
43+
#### Parameters
44+
45+
| Name | Type | Description |
46+
| ------- | ------- | ------------------ |
47+
| limit\_ | uint256 | Number of commands |
48+
49+
#### 📅 Events
50+
51+
- Emits SetMaxDailyReceiveLimit with old and new limit
52+
53+
#### ⛔️ Access Requirements
54+
55+
- Only Owner
56+
57+
---
58+
59+
### pause
60+
61+
Triggers the paused state of the controller
62+
63+
```solidity
64+
function pause() external
65+
```
66+
67+
#### ⛔️ Access Requirements
68+
69+
- Only owner
70+
71+
---
72+
73+
### unpause
74+
75+
Triggers the resume state of the controller
76+
77+
```solidity
78+
function unpause() external
79+
```
80+
81+
#### ⛔️ Access Requirements
82+
83+
- Only owner
84+
85+
---
86+
87+
### renounceOwnership
88+
89+
Empty implementation of renounce ownership to avoid any mishappening
90+
91+
```solidity
92+
function renounceOwnership() public
93+
```
94+
95+
---
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# BaseOmnichainControllerSrc
2+
3+
# Solidity API
4+
5+
### accessControlManager
6+
7+
ACM (Access Control Manager) contract address
8+
9+
```solidity
10+
address accessControlManager
11+
```
12+
13+
---
14+
15+
### chainIdToMaxDailyLimit
16+
17+
Maximum daily limit for commands from the local chain
18+
19+
```solidity
20+
mapping(uint16 => uint256) chainIdToMaxDailyLimit
21+
```
22+
23+
---
24+
25+
### chainIdToLast24HourCommandsSent
26+
27+
Total commands transferred within the last 24-hour window from the local chain
28+
29+
```solidity
30+
mapping(uint16 => uint256) chainIdToLast24HourCommandsSent
31+
```
32+
33+
---
34+
35+
### chainIdToLast24HourWindowStart
36+
37+
Timestamp when the last 24-hour window started from the local chain
38+
39+
```solidity
40+
mapping(uint16 => uint256) chainIdToLast24HourWindowStart
41+
```
42+
43+
---
44+
45+
### chainIdToLastProposalSentTimestamp
46+
47+
Timestamp when the last proposal sent from the local chain to dest chain
48+
49+
```solidity
50+
mapping(uint16 => uint256) chainIdToLastProposalSentTimestamp
51+
```
52+
53+
---
54+
55+
### setMaxDailyLimit
56+
57+
Sets the limit of daily (24 Hour) command amount
58+
59+
```solidity
60+
function setMaxDailyLimit(uint16 chainId_, uint256 limit_) external
61+
```
62+
63+
#### Parameters
64+
65+
| Name | Type | Description |
66+
| --------- | ------- | -------------------- |
67+
| chainId\_ | uint16 | Destination chain id |
68+
| limit\_ | uint256 | Number of commands |
69+
70+
#### 📅 Events
71+
72+
- Emits SetMaxDailyLimit with old and new limit and its corresponding chain id
73+
74+
#### ⛔️ Access Requirements
75+
76+
- Controlled by AccessControlManager
77+
78+
---
79+
80+
### pause
81+
82+
Triggers the paused state of the controller
83+
84+
```solidity
85+
function pause() external
86+
```
87+
88+
#### ⛔️ Access Requirements
89+
90+
- Controlled by AccessControlManager
91+
92+
---
93+
94+
### unpause
95+
96+
Triggers the resume state of the controller
97+
98+
```solidity
99+
function unpause() external
100+
```
101+
102+
#### ⛔️ Access Requirements
103+
104+
- Controlled by AccessControlManager
105+
106+
---
107+
108+
### setAccessControlManager
109+
110+
Sets the address of Access Control Manager (ACM)
111+
112+
```solidity
113+
function setAccessControlManager(address accessControlManager_) external
114+
```
115+
116+
#### Parameters
117+
118+
| Name | Type | Description |
119+
| ---------------------- | ------- | --------------------------------------------- |
120+
| accessControlManager\_ | address | The new address of the Access Control Manager |
121+
122+
#### 📅 Events
123+
124+
- Emits NewAccessControlManager with old and new access control manager addresses
125+
126+
#### ⛔️ Access Requirements
127+
128+
- Only owner
129+
130+
---
131+
132+
### renounceOwnership
133+
134+
Empty implementation of renounce ownership to avoid any mishap
135+
136+
```solidity
137+
function renounceOwnership() public
138+
```
139+
140+
---
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# OmnichainExecutorOwner
2+
3+
OmnichainProposalSender contract acts as a governance and access control mechanism,
4+
allowing owner to upsert signature of OmnichainGovernanceExecutor contract,
5+
also contains function to transfer the ownership of contract as well.
6+
7+
# Solidity API
8+
9+
### OMNICHAIN_GOVERNANCE_EXECUTOR
10+
11+
@custom:oz-upgrades-unsafe-allow state-variable-immutable
12+
13+
```solidity
14+
contract IOmnichainGovernanceExecutor OMNICHAIN_GOVERNANCE_EXECUTOR
15+
```
16+
17+
---
18+
19+
### functionRegistry
20+
21+
Stores function signature corresponding to their 4 bytes hash value
22+
23+
```solidity
24+
mapping(bytes4 => string) functionRegistry
25+
```
26+
27+
---
28+
29+
### initialize
30+
31+
Initialize the contract
32+
33+
```solidity
34+
function initialize(address accessControlManager_) external
35+
```
36+
37+
#### Parameters
38+
39+
| Name | Type | Description |
40+
| ---------------------- | ------- | --------------------------------- |
41+
| accessControlManager\_ | address | Address of access control manager |
42+
43+
---
44+
45+
### setTrustedRemoteAddress
46+
47+
Sets the source message sender address
48+
49+
```solidity
50+
function setTrustedRemoteAddress(uint16 srcChainId_, bytes srcAddress_) external
51+
```
52+
53+
#### Parameters
54+
55+
| Name | Type | Description |
56+
| ------------ | ------ | ----------------------------------------------- |
57+
| srcChainId\_ | uint16 | The LayerZero id of a source chain |
58+
| srcAddress\_ | bytes | The address of the contract on the source chain |
59+
60+
#### 📅 Events
61+
62+
- Emits SetTrustedRemoteAddress with source chain Id and source address
63+
64+
#### ⛔️ Access Requirements
65+
66+
- Controlled by AccessControlManager
67+
68+
---
69+
70+
### fallback
71+
72+
Invoked when called function does not exist in the contract
73+
74+
```solidity
75+
fallback(bytes data_) external returns (bytes)
76+
```
77+
78+
#### Parameters
79+
80+
| Name | Type | Description |
81+
| ------ | ----- | --------------------------------------------- |
82+
| data\_ | bytes | Calldata containing the encoded function call |
83+
84+
#### Return Values
85+
86+
| Name | Type | Description |
87+
| ---- | ----- | ----------------------- |
88+
| [0] | bytes | Result of function call |
89+
90+
#### ⛔️ Access Requirements
91+
92+
- Controlled by Access Control Manager
93+
94+
---
95+
96+
### upsertSignature
97+
98+
A registry of functions that are allowed to be executed from proposals
99+
100+
```solidity
101+
function upsertSignature(string[] signatures_, bool[] active_) external
102+
```
103+
104+
#### Parameters
105+
106+
| Name | Type | Description |
107+
| ------------ | -------- | ------------------------------------------ |
108+
| signatures\_ | string[] | Function signature to be added or removed |
109+
| active\_ | bool[] | bool value, should be true to add function |
110+
111+
#### ⛔️ Access Requirements
112+
113+
- Only owner
114+
115+
---
116+
117+
### transferBridgeOwnership
118+
119+
This function transfer the ownership of the executor from this contract to new owner
120+
121+
```solidity
122+
function transferBridgeOwnership(address newOwner_) external
123+
```
124+
125+
#### Parameters
126+
127+
| Name | Type | Description |
128+
| ---------- | ------- | ----------------------------------- |
129+
| newOwner\_ | address | New owner of the governanceExecutor |
130+
131+
#### ⛔️ Access Requirements
132+
133+
- Controlled by AccessControlManager
134+
135+
---
136+
137+
### renounceOwnership
138+
139+
@notice Empty implementation of renounce ownership to avoid any mishappening
140+
141+
```solidity
142+
function renounceOwnership() public virtual
143+
```
144+
145+
---

0 commit comments

Comments
 (0)