Skip to content

Commit ca3657c

Browse files
committed
Fix formatting
1 parent 69e118e commit ca3657c

18 files changed

Lines changed: 116 additions & 111 deletions

src/child/ChildERC20Bridge.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ contract ChildERC20Bridge is
121121
}
122122
if (
123123
newBridgeAdaptor == address(0) || newChildTokenTemplate == address(0) || newRootIMXToken == address(0)
124-
|| newRoles.defaultAdmin == address(0) || newRoles.pauser == address(0) || newRoles.unpauser == address(0)
125-
|| newRoles.adaptorManager == address(0) || newRoles.treasuryManager == address(0)
126-
|| newWIMXToken == address(0)
124+
|| newRoles.defaultAdmin == address(0) || newRoles.pauser == address(0)
125+
|| newRoles.unpauser == address(0) || newRoles.adaptorManager == address(0)
126+
|| newRoles.treasuryManager == address(0) || newWIMXToken == address(0)
127127
) {
128128
revert ZeroAddress();
129129
}

src/interfaces/child/IChildERC20.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
pragma solidity 0.8.19;
55

6-
import {IERC20MetadataUpgradeable} from
7-
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
6+
import {
7+
IERC20MetadataUpgradeable
8+
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
89

910
/**
1011
* @dev Interface of IChildERC20

src/root/RootERC20Bridge.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ contract RootERC20Bridge is
168168
}
169169
if (
170170
newRootBridgeAdaptor == address(0) || newChildERC20Bridge == address(0)
171-
|| newChildTokenTemplate == address(0) || newRootIMXToken == address(0) || newRootWETHToken == address(0)
172-
|| newRoles.defaultAdmin == address(0) || newRoles.pauser == address(0) || newRoles.unpauser == address(0)
171+
|| newChildTokenTemplate == address(0) || newRootIMXToken == address(0)
172+
|| newRootWETHToken == address(0) || newRoles.defaultAdmin == address(0)
173+
|| newRoles.pauser == address(0) || newRoles.unpauser == address(0)
173174
|| newRoles.variableManager == address(0) || newRoles.adaptorManager == address(0)
174175
) {
175176
revert ZeroAddress();

test/fork/root/RootERC20BridgeFlowRate.t.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ contract RootERC20BridgeFlowRateForkTest is Test, Utils {
284284
}
285285

286286
function createAddress(uint256 index) private view returns (address) {
287-
return address(
288-
uint160(uint256(keccak256(abi.encodePacked("root-bridge-fork-test", index, blockhash(block.number)))))
289-
);
287+
return
288+
address(
289+
uint160(uint256(keccak256(abi.encodePacked("root-bridge-fork-test", index, blockhash(block.number)))))
290+
);
290291
}
291292
}

test/fuzzing/FuzzIntegrityChildERC20Bridge.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ contract FuzzChildERC20BridgeIntegrity is HandlerChildERC20Bridge, FuzzIntegrity
7373
* @notice Checks the integrity of handler_withdraw
7474
*/
7575
function fuzz_withdraw(uint8 childTokenSelector, uint256 amount, uint256 value) public {
76-
bytes memory callData =
77-
abi.encodeWithSelector(HandlerChildERC20Bridge.handler_withdraw.selector, childTokenSelector, amount, value);
76+
bytes memory callData = abi.encodeWithSelector(
77+
HandlerChildERC20Bridge.handler_withdraw.selector, childTokenSelector, amount, value
78+
);
7879

7980
(bool success, bytes4 errorSelector) = _testSelf(callData);
8081
if (!success) {

test/fuzzing/FuzzSetup.sol

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ contract FuzzSetup is FuzzBase, FuzzStorageVariables {
117117
initialDepositor: address(this),
118118
treasuryManager: address(this)
119119
});
120-
ChildERC20Bridge(payable(childERC20Bridge)).initialize(
121-
childRoles, mockAdaptorChild, tokenTemplate, rootIMXToken, wIMX
122-
);
120+
ChildERC20Bridge(payable(childERC20Bridge))
121+
.initialize(childRoles, mockAdaptorChild, tokenTemplate, rootIMXToken, wIMX);
123122
}
124123

125124
function createRootBridge() private {
@@ -131,16 +130,17 @@ contract FuzzSetup is FuzzBase, FuzzStorageVariables {
131130
variableManager: address(this),
132131
adaptorManager: address(this)
133132
});
134-
RootERC20BridgeFlowRate(payable(rootERC20BridgeFlowRate)).initialize(
135-
rootRoles,
136-
mockAdaptorRoot,
137-
childERC20Bridge,
138-
tokenTemplate,
139-
address(rootIMXToken),
140-
address(wETH),
141-
IMX_DEPOSIT_LIMIT,
142-
address(this)
143-
);
133+
RootERC20BridgeFlowRate(payable(rootERC20BridgeFlowRate))
134+
.initialize(
135+
rootRoles,
136+
mockAdaptorRoot,
137+
childERC20Bridge,
138+
tokenTemplate,
139+
address(rootIMXToken),
140+
address(wETH),
141+
IMX_DEPOSIT_LIMIT,
142+
address(this)
143+
);
144144
}
145145

146146
function initializeMockAdaptors() private {
@@ -160,15 +160,16 @@ contract FuzzSetup is FuzzBase, FuzzStorageVariables {
160160
}
161161

162162
function generateMapTokens() private {
163-
MockAdaptor(mockAdaptorChild).onMessageReceive(
164-
abi.encode(
165-
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
166-
rootSixDecimalInitial,
167-
"Six Child Generated",
168-
"6CG",
169-
ChildERC20(rootSixDecimalInitial).decimals()
170-
)
171-
);
163+
MockAdaptor(mockAdaptorChild)
164+
.onMessageReceive(
165+
abi.encode(
166+
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
167+
rootSixDecimalInitial,
168+
"Six Child Generated",
169+
"6CG",
170+
ChildERC20(rootSixDecimalInitial).decimals()
171+
)
172+
);
172173
childSixDecimalGenerated =
173174
RootERC20Bridge(payable(rootERC20BridgeFlowRate)).mapToken{value: 1}(IERC20Metadata(rootSixDecimalInitial));
174175

@@ -178,15 +179,16 @@ contract FuzzSetup is FuzzBase, FuzzStorageVariables {
178179
== ChildERC20Bridge(payable(childERC20Bridge)).rootTokenToChildToken(rootSixDecimalInitial)
179180
);
180181

181-
MockAdaptor(mockAdaptorChild).onMessageReceive(
182-
abi.encode(
183-
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
184-
rootEightDecimalInitial,
185-
"Eight Child Generated",
186-
"8CG",
187-
ChildERC20(rootEightDecimalInitial).decimals()
188-
)
189-
);
182+
MockAdaptor(mockAdaptorChild)
183+
.onMessageReceive(
184+
abi.encode(
185+
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
186+
rootEightDecimalInitial,
187+
"Eight Child Generated",
188+
"8CG",
189+
ChildERC20(rootEightDecimalInitial).decimals()
190+
)
191+
);
190192
childEightDecimalGenerated = RootERC20Bridge(payable(rootERC20BridgeFlowRate)).mapToken{value: 1}(
191193
IERC20Metadata(rootEightDecimalInitial)
192194
);
@@ -197,15 +199,16 @@ contract FuzzSetup is FuzzBase, FuzzStorageVariables {
197199
== ChildERC20Bridge(payable(childERC20Bridge)).rootTokenToChildToken(rootEightDecimalInitial)
198200
);
199201

200-
MockAdaptor(mockAdaptorChild).onMessageReceive(
201-
abi.encode(
202-
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
203-
rootEighteenDecimalInitial,
204-
"Eighteen Child Generated",
205-
"18CG",
206-
ChildERC20(rootEighteenDecimalInitial).decimals()
207-
)
208-
);
202+
MockAdaptor(mockAdaptorChild)
203+
.onMessageReceive(
204+
abi.encode(
205+
ChildERC20Bridge(payable(childERC20Bridge)).MAP_TOKEN_SIG(),
206+
rootEighteenDecimalInitial,
207+
"Eighteen Child Generated",
208+
"18CG",
209+
ChildERC20(rootEighteenDecimalInitial).decimals()
210+
)
211+
);
209212
childEighteenDecimalGenerated = RootERC20Bridge(payable(rootERC20BridgeFlowRate)).mapToken{value: 1}(
210213
IERC20Metadata(rootEighteenDecimalInitial)
211214
);

test/fuzzing/helper/handlers/HandlerChildERC20Bridge.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ contract HandlerChildERC20Bridge is PreconditionsChildERC20Bridge, Postcondition
2929
uint8 receiverSelector,
3030
uint256 amount
3131
) public setCurrentActor {
32-
OnMessageReceiveChildParams memory params =
33-
onMessageReceiveChildPreconditions(isDeposit, rootTokenSelector, senderSelector, receiverSelector, amount);
32+
OnMessageReceiveChildParams memory params = onMessageReceiveChildPreconditions(
33+
isDeposit, rootTokenSelector, senderSelector, receiverSelector, amount
34+
);
3435

3536
address[] memory actorsToUpdate = new address[](1);
3637
actorsToUpdate[0] = params.receiver;

test/fuzzing/helper/handlers/HandlerRootERC20BridgeFlowRate.sol

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import "../postconditions/PostconditionsRootERC20BridgeFlowRate.sol";
99
* @author 0xScourgedev
1010
* @notice Fuzz handlers for RootERC20BridgeFlowRate
1111
*/
12-
contract HandlerRootERC20BridgeFlowRate is
13-
PreconditionsRootERC20BridgeFlowRate,
14-
PostconditionsRootERC20BridgeFlowRate
15-
{
12+
contract HandlerRootERC20BridgeFlowRate is PreconditionsRootERC20BridgeFlowRate, PostconditionsRootERC20BridgeFlowRate {
1613
///////////////////////////////////////////////////////////////////////////////////////////////
1714
// HANDLERS //
1815
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -239,8 +236,9 @@ contract HandlerRootERC20BridgeFlowRate is
239236
uint256 refillRate,
240237
uint256 largeTransferThreshold
241238
) public setCurrentActor {
242-
SetRateControlThresholdParams memory params =
243-
setRateControlThresholdPreconditions(tokenSelector, capacity, refillRate, largeTransferThreshold);
239+
SetRateControlThresholdParams memory params = setRateControlThresholdPreconditions(
240+
tokenSelector, capacity, refillRate, largeTransferThreshold
241+
);
244242

245243
address[] memory actorsToUpdate = new address[](0);
246244

test/fuzzing/helper/preconditions/PreconditionsChildERC20Bridge.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ abstract contract PreconditionsChildERC20Bridge is PreconditionsBase {
101101
address receiver = USERS[receiverSelector % USERS.length];
102102
bytes memory data = abi.encode(selector, rootToken, sender, receiver, amount);
103103
return OnMessageReceiveChildParams({
104-
data: data,
105-
rootToken: rootToken,
106-
amount: amount,
107-
sender: sender,
108-
receiver: receiver
104+
data: data, rootToken: rootToken, amount: amount, sender: sender, receiver: receiver
109105
});
110106
}
111107

test/fuzzing/helper/preconditions/PreconditionsRootERC20BridgeFlowRate.sol

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ abstract contract PreconditionsRootERC20BridgeFlowRate is PreconditionsBase {
243243
FlowRateWithdrawalQueue(payable(rootERC20BridgeFlowRate)).getPendingWithdrawalsLength(receiver) + 1;
244244
length = fl.clamp(length, 0, maxLength);
245245
return FinaliseQueuedWithdrawalsAggregatedParams({
246-
receiver: receiver,
247-
token: token,
248-
indices: getIndicesFromEntropy(entropy, length, maxLength)
246+
receiver: receiver, token: token, indices: getIndicesFromEntropy(entropy, length, maxLength)
249247
});
250248
}
251249

@@ -297,8 +295,8 @@ abstract contract PreconditionsRootERC20BridgeFlowRate is PreconditionsBase {
297295
}
298296

299297
FlowRateWithdrawalQueue.FindPendingWithdrawal[] memory pending = FlowRateWithdrawalQueue(
300-
payable(rootERC20BridgeFlowRate)
301-
).findPendingWithdrawals(USERS[i], rootToken, 0, pendingLength, MAX_IN_QUEUE);
298+
payable(rootERC20BridgeFlowRate)
299+
).findPendingWithdrawals(USERS[i], rootToken, 0, pendingLength, MAX_IN_QUEUE);
302300
for (uint256 j = 0; j < pending.length; j++) {
303301
rootBridgeQueuedAmounts += pending[j].amount;
304302
}
@@ -349,10 +347,7 @@ abstract contract PreconditionsRootERC20BridgeFlowRate is PreconditionsBase {
349347
largeTransferThreshold =
350348
fl.clamp(largeTransferThreshold, 0, ChildERC20(token).totalSupply() + MAX_REFILL_RATE_GAP);
351349
return SetRateControlThresholdParams({
352-
token: token,
353-
capacity: capacity,
354-
refillRate: refillRate,
355-
largeTransferThreshold: largeTransferThreshold
350+
token: token, capacity: capacity, refillRate: refillRate, largeTransferThreshold: largeTransferThreshold
356351
});
357352
}
358353

0 commit comments

Comments
 (0)