Skip to content

Commit 8b91778

Browse files
authored
Merge branch 'main' into feature/deploy-ci
2 parents df21e2e + 83d1069 commit 8b91778

File tree

7 files changed

+154
-65
lines changed

7 files changed

+154
-65
lines changed

docs/soldoc/src/src/bridges/layerZero/IexecLayerZeroBridge.sol/contract.IexecLayerZeroBridge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function unpause() external onlyRole(PAUSER_ROLE);
148148
LEVEL 2: Pauses only outbound transfers.
149149

150150
*Can only be called by accounts with PAUSER_ROLE
151-
When outbount transfers are paused:
151+
When outbound transfers are paused:
152152
- All _debit operations (outbound transfers) are blocked
153153
- All _credit operations (inbound transfers) still work
154154
- Users can still receive funds and "exit" their positions

docs/soldoc/src/src/bridges/utils/DualPausableUpgradeable.sol/abstract.DualPausableUpgradeable.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ function _getDualPausableStorage() private pure returns (DualPausableStorage sto
3838

3939
### whenOutboundTransfersNotPaused
4040

41-
Use this modifier for functions that should be blocked during outbount transfer pause
41+
Use this modifier for functions that should be blocked during outbound transfer pause
4242

43-
*Modifier for send operations - blocks when outbount transfer is paused*
43+
*Modifier for send operations - blocks when outbound transfer is paused*
4444

4545

4646
```solidity
4747
modifier whenOutboundTransfersNotPaused();
4848
```
4949

50-
### whenOutbountTransfersPaused
50+
### whenOutboundTransfersPaused
5151

52-
Use this modifier for administrative functions that should only work during outbount transfer pause
52+
Use this modifier for administrative functions that should only work during outbound transfer pause
5353

5454
*Modifier to make a function callable only when send operations are paused*
5555

5656

5757
```solidity
58-
modifier whenOutbountTransfersPaused();
58+
modifier whenOutboundTransfersPaused();
5959
```
6060

6161
### __DualPausable_init
@@ -72,13 +72,13 @@ function __DualPausable_init() internal onlyInitializing;
7272
function __DualPausable_init_unchained() internal onlyInitializing;
7373
```
7474

75-
### outbountTransfersPaused
75+
### outboundTransfersPaused
7676

7777
*Returns true if send operations are paused, false otherwise*
7878

7979

8080
```solidity
81-
function outbountTransfersPaused() public view virtual returns (bool);
81+
function outboundTransfersPaused() public view virtual returns (bool);
8282
```
8383

8484
### pauseStatus
@@ -94,30 +94,30 @@ function pauseStatus() public view virtual returns (bool fullyPaused, bool onlyO
9494
|Name|Type|Description|
9595
|----|----|-----------|
9696
|`fullyPaused`|`bool`|True if complete pause is active (blocks all operations)|
97-
|`onlyOutboundTransfersPaused`|`bool`|True if outbount transfer pause is active (blocks only send operations)|
97+
|`onlyOutboundTransfersPaused`|`bool`|True if outbound transfer pause is active (blocks only send operations)|
9898

9999

100-
### _requireOutbountTransfersNotPaused
100+
### _requireOutboundTransfersNotPaused
101101

102102
*Throws if send operations are paused*
103103

104104

105105
```solidity
106-
function _requireOutbountTransfersNotPaused() internal view virtual;
106+
function _requireOutboundTransfersNotPaused() internal view virtual;
107107
```
108108

109-
### _requireOutbountTransfersPaused
109+
### _requireOutboundTransfersPaused
110110

111111
*Throws if send operations are not paused*
112112

113113

114114
```solidity
115-
function _requireOutbountTransfersPaused() internal view virtual;
115+
function _requireOutboundTransfersPaused() internal view virtual;
116116
```
117117

118118
### _pauseOutboundTransfers
119119

120-
*Triggers outbount transfers pause.
120+
*Triggers outbound transfers pause.
121121
Requirements:
122122
- Send operations must not already be paused*
123123

@@ -128,26 +128,26 @@ function _pauseOutboundTransfers() internal virtual whenOutboundTransfersNotPaus
128128

129129
### _unpauseOutboundTransfers
130130

131-
*Unpauses outbount transfers.
131+
*Unpauses outbound transfers.
132132
Requirements:
133133
- Send operations must already be paused*
134134

135135

136136
```solidity
137-
function _unpauseOutboundTransfers() internal virtual whenOutbountTransfersPaused;
137+
function _unpauseOutboundTransfers() internal virtual whenOutboundTransfersPaused;
138138
```
139139

140140
## Events
141141
### OutboundTransfersPaused
142-
*Emitted when outbount transfer pause is triggered by `account`*
142+
*Emitted when outbound transfer pause is triggered by `account`*
143143

144144

145145
```solidity
146146
event OutboundTransfersPaused(address account);
147147
```
148148

149149
### OutboundTransfersUnpaused
150-
*Emitted when outbount transfer pause is lifted by `account`*
150+
*Emitted when outbound transfer pause is lifted by `account`*
151151

152152

153153
```solidity

src/bridges/layerZero/IexecLayerZeroBridge.sol

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ contract IexecLayerZeroBridge is
146146
* @notice LEVEL 2: Pauses only outbound transfers.
147147
* @dev Can only be called by accounts with PAUSER_ROLE
148148
*
149-
* When outbount transfers are paused:
149+
* When outbound transfers are paused:
150150
* - All _debit operations (outbound transfers) are blocked
151151
* - All _credit operations (inbound transfers) still work
152152
* - Users can still receive funds and "exit" their positions
@@ -189,20 +189,43 @@ contract IexecLayerZeroBridge is
189189
// ============ ACCESS CONTROL OVERRIDES ============
190190

191191
/**
192-
* @notice Returns the owner of the contract
193-
* @return The address of the current owner
194-
*
195-
* @dev This override resolves the conflict between OwnableUpgradeable and
196-
* AccessControlDefaultAdminRulesUpgradeable, both of which define owner().
197-
* We use the OwnableUpgradeable version for consistency.
192+
* @dev Overridden to prevent ownership renouncement.
193+
* AccessControlDefaultAdminRulesUpgradeable is used to manage ownership.
194+
*/
195+
function renounceOwnership() public pure override {
196+
revert OperationNotAllowed("Use AccessControlDefaultAdminRulesUpgradeable instead");
197+
}
198+
199+
/**
200+
* @dev Overridden to prevent ownership transfer.
201+
* AccessControlDefaultAdminRulesUpgradeable is used to manage ownership.
202+
*/
203+
function transferOwnership(address) public pure override {
204+
revert OperationNotAllowed("Use AccessControlDefaultAdminRulesUpgradeable instead");
205+
}
206+
207+
/**
208+
* Returns the owner of the contract which is also the default admin.
209+
* @return The address of the current owner and default admin
198210
*/
199211
function owner()
200212
public
201213
view
202214
override(OwnableUpgradeable, AccessControlDefaultAdminRulesUpgradeable)
203215
returns (address)
204216
{
205-
return OwnableUpgradeable.owner();
217+
return AccessControlDefaultAdminRulesUpgradeable.owner();
218+
}
219+
220+
/**
221+
* Accepts the default admin transfer and sets the owner to the new admin.
222+
* @dev This ensures the state variable `OwnableUpgradeable._owner` is set correctly after the default
223+
* admin transfer. Even though `OwnableUpgradeable._owner` is not used in `owner()` accessor, we chose
224+
* to update it for consistency purposes.
225+
*/
226+
function _acceptDefaultAdminTransfer() internal override {
227+
super._acceptDefaultAdminTransfer();
228+
_transferOwnership(defaultAdmin());
206229
}
207230

208231
// ============ CORE BRIDGE FUNCTIONS ============

src/bridges/utils/DualPausableUpgradeable.sol

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ abstract contract DualPausableUpgradeable is PausableUpgradeable {
4242
// ============ EVENTS ============
4343

4444
/**
45-
* @dev Emitted when outbount transfer pause is triggered by `account`
45+
* @dev Emitted when outbound transfer pause is triggered by `account`
4646
*/
4747
event OutboundTransfersPaused(address account);
4848

4949
/**
50-
* @dev Emitted when outbount transfer pause is lifted by `account`
50+
* @dev Emitted when outbound transfer pause is lifted by `account`
5151
*/
5252
event OutboundTransfersUnpaused(address account);
5353

@@ -66,20 +66,20 @@ abstract contract DualPausableUpgradeable is PausableUpgradeable {
6666
// ============ MODIFIERS ============
6767

6868
/**
69-
* @dev Modifier for send operations - blocks when outbount transfer is paused
70-
* @notice Use this modifier for functions that should be blocked during outbount transfer pause
69+
* @dev Modifier for send operations - blocks when outbound transfer is paused
70+
* @notice Use this modifier for functions that should be blocked during outbound transfer pause
7171
*/
7272
modifier whenOutboundTransfersNotPaused() {
73-
_requireOutbountTransfersNotPaused();
73+
_requireOutboundTransfersNotPaused();
7474
_;
7575
}
7676

7777
/**
7878
* @dev Modifier to make a function callable only when send operations are paused
79-
* @notice Use this modifier for administrative functions that should only work during outbount transfer pause
79+
* @notice Use this modifier for administrative functions that should only work during outbound transfer pause
8080
*/
81-
modifier whenOutbountTransfersPaused() {
82-
_requireOutbountTransfersPaused();
81+
modifier whenOutboundTransfersPaused() {
82+
_requireOutboundTransfersPaused();
8383
_;
8484
}
8585

@@ -101,43 +101,43 @@ abstract contract DualPausableUpgradeable is PausableUpgradeable {
101101
/**
102102
* @dev Returns true if send operations are paused, false otherwise
103103
*/
104-
function outbountTransfersPaused() public view virtual returns (bool) {
104+
function outboundTransfersPaused() public view virtual returns (bool) {
105105
DualPausableStorage storage $ = _getDualPausableStorage();
106106
return $._outboundTransfersPaused;
107107
}
108108

109109
/**
110110
* @dev Returns the overall operational state of the contract
111111
* @return fullyPaused True if complete pause is active (blocks all operations)
112-
* @return onlyOutboundTransfersPaused True if outbount transfer pause is active (blocks only send operations)
112+
* @return onlyOutboundTransfersPaused True if outbound transfer pause is active (blocks only send operations)
113113
*/
114114
function pauseStatus() public view virtual returns (bool fullyPaused, bool onlyOutboundTransfersPaused) {
115115
fullyPaused = paused();
116-
onlyOutboundTransfersPaused = outbountTransfersPaused();
116+
onlyOutboundTransfersPaused = outboundTransfersPaused();
117117
}
118118

119119
// ============ INTERNAL FUNCTIONS ============
120120

121121
/**
122122
* @dev Throws if send operations are paused
123123
*/
124-
function _requireOutbountTransfersNotPaused() internal view virtual {
125-
if (outbountTransfersPaused()) {
124+
function _requireOutboundTransfersNotPaused() internal view virtual {
125+
if (outboundTransfersPaused()) {
126126
revert EnforcedOutboundTransfersPause();
127127
}
128128
}
129129

130130
/**
131131
* @dev Throws if send operations are not paused
132132
*/
133-
function _requireOutbountTransfersPaused() internal view virtual {
134-
if (!outbountTransfersPaused()) {
133+
function _requireOutboundTransfersPaused() internal view virtual {
134+
if (!outboundTransfersPaused()) {
135135
revert ExpectedOutboundTransfersPause();
136136
}
137137
}
138138

139139
/**
140-
* @dev Triggers outbount transfers pause.
140+
* @dev Triggers outbound transfers pause.
141141
* Requirements:
142142
* - Send operations must not already be paused
143143
*/
@@ -148,11 +148,11 @@ abstract contract DualPausableUpgradeable is PausableUpgradeable {
148148
}
149149

150150
/**
151-
* @dev Unpauses outbount transfers.
151+
* @dev Unpauses outbound transfers.
152152
* Requirements:
153153
* - Send operations must already be paused
154154
*/
155-
function _unpauseOutboundTransfers() internal virtual whenOutbountTransfersPaused {
155+
function _unpauseOutboundTransfers() internal virtual whenOutboundTransfersPaused {
156156
DualPausableStorage storage $ = _getDualPausableStorage();
157157
$._outboundTransfersPaused = false;
158158
emit OutboundTransfersUnpaused(_msgSender());

src/interfaces/IIexecLayerZeroBridge.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
pragma solidity ^0.8.22;
33

44
interface IIexecLayerZeroBridge {
5+
error OperationNotAllowed(string message);
6+
57
/**
68
* @notice Pauses the contract, disabling `_credit` & `_debit` functions.
79
* @dev Should only be callable by authorized accounts: PAUSER_ROLE.

0 commit comments

Comments
 (0)