Skip to content

Commit 24dc024

Browse files
ermyasdrinkcoffee
andauthored
Update formatting given recent forge fmt changes (#220)
* Update formatting given recent forge fmt changes * Resolve formatting issues --------- Co-authored-by: Peter Robinson <[email protected]>
1 parent f0d0c44 commit 24dc024

File tree

49 files changed

+670
-533
lines changed

Some content is hidden

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

49 files changed

+670
-533
lines changed

contracts/access/MintingAccessControl.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ abstract contract MintingAccessControl is AccessControlEnumerable {
99
/// @notice Role to mint tokens
1010
bytes32 public constant MINTER_ROLE = bytes32("MINTER_ROLE");
1111

12-
/** @notice Allows admin grant `user` `MINTER` role
12+
/**
13+
* @notice Allows admin grant `user` `MINTER` role
1314
* @param user The address to grant the `MINTER` role to
1415
*/
1516
function grantMinterRole(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
1617
grantRole(MINTER_ROLE, user);
1718
}
1819

19-
/** @notice Allows admin to revoke `MINTER_ROLE` role from `user`
20+
/**
21+
* @notice Allows admin to revoke `MINTER_ROLE` role from `user`
2022
* @param user The address to revoke the `MINTER` role from
2123
*/
2224
function revokeMinterRole(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
2325
revokeRole(MINTER_ROLE, user);
2426
}
2527

26-
/** @notice Returns the addresses which have DEFAULT_ADMIN_ROLE */
28+
/**
29+
* @notice Returns the addresses which have DEFAULT_ADMIN_ROLE
30+
*/
2731
function getAdmins() public view returns (address[] memory) {
2832
uint256 adminCount = getRoleMemberCount(DEFAULT_ADMIN_ROLE);
2933
address[] memory admins = new address[](adminCount);

contracts/allowlist/IOperatorAllowlist.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ pragma solidity 0.8.19;
66
* @notice Required interface of an OperatorAllowlist compliant contract
77
*/
88
interface IOperatorAllowlist {
9-
/** @notice Returns true if an address is Allowlisted false otherwise
9+
/**
10+
* @notice Returns true if an address is Allowlisted false otherwise
1011
* @param target the address to be checked against the Allowlist
1112
*/
1213
function isAllowlisted(address target) external view returns (bool);

contracts/bridge/x/v4/CoreV4.sol

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,59 @@ interface CoreV4 {
8686
);
8787
event LogDepositCancel(uint256 starkKey, uint256 vaultId, uint256 assetId);
8888
event LogDepositCancelReclaimed(
89-
uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount
89+
uint256 starkKey,
90+
uint256 vaultId,
91+
uint256 assetType,
92+
uint256 nonQuantizedAmount,
93+
uint256 quantizedAmount
9094
);
9195
event LogDepositNftCancelReclaimed(
92-
uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId
96+
uint256 starkKey,
97+
uint256 vaultId,
98+
uint256 assetType,
99+
uint256 tokenId,
100+
uint256 assetId
93101
);
94102
event LogMintWithdrawalPerformed(
95-
uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount, uint256 assetId
103+
uint256 ownerKey,
104+
uint256 assetType,
105+
uint256 nonQuantizedAmount,
106+
uint256 quantizedAmount,
107+
uint256 assetId
96108
);
97109
event LogMintableWithdrawalAllowed(uint256 ownerKey, uint256 assetId, uint256 quantizedAmount);
98110
event LogNftDeposit(
99-
address depositorEthKey, uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId
111+
address depositorEthKey,
112+
uint256 starkKey,
113+
uint256 vaultId,
114+
uint256 assetType,
115+
uint256 tokenId,
116+
uint256 assetId
100117
);
101118
event LogNftWithdrawalAllowed(uint256 ownerKey, uint256 assetId);
102119
event LogNftWithdrawalPerformed(
103-
uint256 ownerKey, uint256 assetType, uint256 tokenId, uint256 assetId, address recipient
120+
uint256 ownerKey,
121+
uint256 assetType,
122+
uint256 tokenId,
123+
uint256 assetId,
124+
address recipient
104125
);
105126
event LogTokenAdminAdded(address tokenAdmin);
106127
event LogTokenAdminRemoved(address tokenAdmin);
107128
event LogTokenRegistered(uint256 assetType, bytes assetInfo, uint256 quantum);
108129
event LogUserRegistered(address ethKey, uint256 starkKey, address sender);
109130
event LogWithdrawalAllowed(
110-
uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount
131+
uint256 ownerKey,
132+
uint256 assetType,
133+
uint256 nonQuantizedAmount,
134+
uint256 quantizedAmount
111135
);
112136
event LogWithdrawalPerformed(
113-
uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount, address recipient
137+
uint256 ownerKey,
138+
uint256 assetType,
139+
uint256 nonQuantizedAmount,
140+
uint256 quantizedAmount,
141+
address recipient
114142
);
115143

116144
function defaultVaultWithdrawalLock() external view returns (uint256);
@@ -137,24 +165,27 @@ interface CoreV4 {
137165

138166
function getAssetInfo(uint256 assetType) external view returns (bytes memory assetInfo);
139167

140-
function getCancellationRequest(uint256 starkKey, uint256 assetId, uint256 vaultId)
141-
external
142-
view
143-
returns (uint256 request);
168+
function getCancellationRequest(
169+
uint256 starkKey,
170+
uint256 assetId,
171+
uint256 vaultId
172+
) external view returns (uint256 request);
144173

145-
function getDepositBalance(uint256 starkKey, uint256 assetId, uint256 vaultId)
146-
external
147-
view
148-
returns (uint256 balance);
174+
function getDepositBalance(
175+
uint256 starkKey,
176+
uint256 assetId,
177+
uint256 vaultId
178+
) external view returns (uint256 balance);
149179

150180
function getEthKey(uint256 ownerKey) external view returns (address);
151181

152182
function getFullWithdrawalRequest(uint256 starkKey, uint256 vaultId) external view returns (uint256 res);
153183

154-
function getQuantizedDepositBalance(uint256 starkKey, uint256 assetId, uint256 vaultId)
155-
external
156-
view
157-
returns (uint256 balance);
184+
function getQuantizedDepositBalance(
185+
uint256 starkKey,
186+
uint256 assetId,
187+
uint256 vaultId
188+
) external view returns (uint256 balance);
158189

159190
function getQuantum(uint256 presumedAssetType) external view returns (uint256 quantum);
160191

@@ -241,21 +272,26 @@ interface CoreV4 {
241272

242273
event LogDefaultVaultWithdrawalLockSet(uint256 newDefaultLockTime);
243274
event LogDepositToVault(
244-
address ethKey, uint256 assetId, uint256 vaultId, uint256 nonQuantizedAmount, uint256 quantizedAmount
275+
address ethKey,
276+
uint256 assetId,
277+
uint256 vaultId,
278+
uint256 nonQuantizedAmount,
279+
uint256 quantizedAmount
245280
);
246281
event LogVaultWithdrawalLockSet(address ethKey, uint256 assetId, uint256 vaultId, uint256 timeRelease);
247282
event LogWithdrawalFromVault(
248-
address ethKey, uint256 assetId, uint256 vaultId, uint256 nonQuantizedAmount, uint256 quantizedAmount
283+
address ethKey,
284+
uint256 assetId,
285+
uint256 vaultId,
286+
uint256 nonQuantizedAmount,
287+
uint256 quantizedAmount
249288
);
250289

251290
function depositERC20ToVault(uint256 assetId, uint256 vaultId, uint256 quantizedAmount) external;
252291

253292
function depositEthToVault(uint256 assetId, uint256 vaultId) external payable;
254293

255-
function getQuantizedVaultBalance(address ethKey, uint256 assetId, uint256 vaultId)
256-
external
257-
view
258-
returns (uint256);
294+
function getQuantizedVaultBalance(address ethKey, uint256 assetId, uint256 vaultId) external view returns (uint256);
259295

260296
function getVaultBalance(address ethKey, uint256 assetId, uint256 vaultId) external view returns (uint256);
261297

contracts/bridge/x/v4/RegistrationV4.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ contract RegistrationV4 {
2020
imx = CoreV4(_imx);
2121
}
2222

23-
function registerAndWithdrawAll(address ethKey, uint256 starkKey, bytes calldata signature, uint256 assetType)
24-
external
25-
{
23+
function registerAndWithdrawAll(
24+
address ethKey,
25+
uint256 starkKey,
26+
bytes calldata signature,
27+
uint256 assetType
28+
) external {
2629
if (!isRegistered(starkKey)) {
2730
imx.registerEthAddress(ethKey, starkKey, signature);
2831
}

contracts/deployer/create/OwnableCreateDeploy.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ contract OwnableCreateDeploy {
2222
* @param bytecode The bytecode of the contract to be deployed
2323
*/
2424
// slither-disable-next-line locked-ether
25+
2526
function deploy(bytes memory bytecode) external payable {
2627
// solhint-disable-next-line custom-errors
2728
require(msg.sender == owner, "CreateDeploy: caller is not the owner");
2829
assembly {
29-
if iszero(create(callvalue(), add(bytecode, 32), mload(bytecode))) { revert(0, 0) }
30+
if iszero(create(callvalue(), add(bytecode, 32), mload(bytecode))) {
31+
revert(0, 0)
32+
}
3033
}
3134
}
3235
}

contracts/mocks/MockOnReceive.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ contract MockOnReceive {
1515

1616
// Attempt to transfer token to another address on receive
1717
function onERC721Received(
18-
address /* operator */,
19-
address /* from */,
20-
uint256 tokenId,
18+
address,
19+
/* operator */ address,
20+
/* from */ uint256 tokenId,
2121
bytes calldata /* data */
2222
) public returns (bytes4) {
2323
tokenAddress.transferFrom(address(this), recipient, tokenId);

contracts/random/offchainsources/chainlink/VRFConsumerBaseV2.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ pragma solidity 0.8.19;
66
// using the following command to dependency clashes.
77
// npm install @chainlink/contracts
88

9-
/** ****************************************************************************
9+
/**
10+
*
1011
* @notice Interface for contracts using VRF randomness
1112
* *****************************************************************************
1213
* @dev PURPOSE
@@ -102,6 +103,7 @@ pragma solidity 0.8.19;
102103
abstract contract VRFConsumerBaseV2 {
103104
error OnlyCoordinatorCanFulfill(address have, address want);
104105
// solhint-disable-next-line chainlink-solidity/prefix-immutable-variables-with-i
106+
105107
address private immutable vrfCoordinator;
106108

107109
/**

contracts/random/offchainsources/supra/ISupraRouter.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity 0.8.19;
44
/**
55
* @notice API for interacting with Supra's Verifiable Random Function.
66
*/
7-
87
interface ISupraRouter {
98
function generateRequest(
109
string memory _functionSig,

contracts/token/erc1155/preset/ImmutableERC1155.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {ImmutableERC1155Base} from "../abstract/ImmutableERC1155Base.sol";
88
* @title ImmutableERC1155
99
* @author @jasonzwli, Immutable
1010
*/
11-
1211
contract ImmutableERC1155 is ImmutableERC1155Base {
1312
/// ===== Constructor =====
1413

contracts/token/erc20/preset/ImmutableERC20FixedSupplyNoBurn.sol

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,37 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
66
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
77
import {IImmutableERC20Errors} from "./Errors.sol";
88

9-
109
/**
11-
* @notice ERC 20 contract that mints a fixed total supply of tokens when the contract
10+
* @notice ERC 20 contract that mints a fixed total supply of tokens when the contract
1211
* is deployed.
13-
* @dev This contract has the concept of an owner, called _hubOwner in the constructor.
12+
* @dev This contract has the concept of an owner, called _hubOwner in the constructor.
1413
* This account has no rights to execute any administrative actions within the contract,
15-
* with the exception of transferOwnership. This account is accessed via the owner()
16-
* function. The Immutable Hub uses this function to help associate the ERC 20 contract
14+
* with the exception of transferOwnership. This account is accessed via the owner()
15+
* function. The Immutable Hub uses this function to help associate the ERC 20 contract
1716
* with a specific Immutable Hub account.
1817
*/
1918
contract ImmutableERC20FixedSupplyNoBurn is Ownable, ERC20 {
20-
2119
/**
2220
* @dev Mints `_totalSupply` number of token and transfers them to `_owner`.
2321
*
2422
* @param _name Name of the token.
2523
* @param _symbol Token symbol.
2624
* @param _totalSupply Supply of the token.
2725
* @param _treasurer Initial owner of entire supply of all tokens.
28-
* @param _hubOwner The account associated with Immutable Hub.
26+
* @param _hubOwner The account associated with Immutable Hub.
2927
*/
30-
constructor(string memory _name, string memory _symbol, uint256 _totalSupply, address _treasurer, address _hubOwner) ERC20(_name, _symbol) {
28+
constructor(
29+
string memory _name,
30+
string memory _symbol,
31+
uint256 _totalSupply,
32+
address _treasurer,
33+
address _hubOwner
34+
) ERC20(_name, _symbol) {
3135
_mint(_treasurer, _totalSupply);
3236
_transferOwnership(_hubOwner);
3337
}
3438

35-
/**
39+
/**
3640
* @notice Prevent calls to renounce ownership.
3741
*/
3842
function renounceOwnership() public pure override {

contracts/token/erc20/preset/ImmutableERC20MinterBurnerPermit.sol

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {IImmutableERC20Errors} from "./Errors.sol";
1212
* @notice ERC 20 contract that wraps Open Zeppelin's ERC 20 contract.
1313
* This contract has the concept of a hubOwner, called _hubOwner in the constructor.
1414
* This account has no rights to execute any administrative actions within the contract,
15-
* with the exception of renouncing their ownership.
16-
* The Immutable Hub uses this function to help associate the ERC 20 contract
15+
* with the exception of renouncing their ownership.
16+
* The Immutable Hub uses this function to help associate the ERC 20 contract
1717
* with a specific Immutable Hub account.
1818
*/
1919
contract ImmutableERC20MinterBurnerPermit is ERC20Capped, ERC20Burnable, ERC20Permit, MintingAccessControl {
@@ -24,19 +24,24 @@ contract ImmutableERC20MinterBurnerPermit is ERC20Capped, ERC20Burnable, ERC20Pe
2424
* @dev Delegate to Open Zeppelin's contract.
2525
* @param _roleAdmin The account that has the DEFAULT_ADMIN_ROLE.
2626
* @param _minterAdmin The account that has the MINTER_ROLE.
27-
* @param _hubOwner The account that owns the contract and is associated with Immutable Hub.
27+
* @param _hubOwner The account that owns the contract and is associated with Immutable Hub.
2828
* @param _name Name of the token.
2929
* @param _symbol Token symbol.
3030
* @param _maxTokenSupply The maximum supply of the token.
31-
3231
*/
33-
constructor(address _roleAdmin, address _minterAdmin, address _hubOwner, string memory _name, string memory _symbol, uint256 _maxTokenSupply) ERC20(_name, _symbol) ERC20Permit(_name) ERC20Capped(_maxTokenSupply) {
32+
constructor(
33+
address _roleAdmin,
34+
address _minterAdmin,
35+
address _hubOwner,
36+
string memory _name,
37+
string memory _symbol,
38+
uint256 _maxTokenSupply
39+
) ERC20(_name, _symbol) ERC20Permit(_name) ERC20Capped(_maxTokenSupply) {
3440
_grantRole(DEFAULT_ADMIN_ROLE, _roleAdmin);
3541
_grantRole(HUB_OWNER_ROLE, _hubOwner);
3642
_grantRole(MINTER_ROLE, _minterAdmin);
3743
}
3844

39-
4045
/**
4146
* @dev Mints `amount` number of token and transfers them to the `to` address.
4247
* @param to the address to mint the tokens to.
@@ -46,9 +51,8 @@ contract ImmutableERC20MinterBurnerPermit is ERC20Capped, ERC20Burnable, ERC20Pe
4651
_mint(to, amount);
4752
}
4853

49-
5054
/**
51-
* @dev Renounces the role `role` from the calling account. Prevents the last hub owner and admin from
55+
* @dev Renounces the role `role` from the calling account. Prevents the last hub owner and admin from
5256
* renouncing their role.
5357
* @param role The role to renounce.
5458
* @param account The account to renounce the role from.
@@ -60,12 +64,10 @@ contract ImmutableERC20MinterBurnerPermit is ERC20Capped, ERC20Burnable, ERC20Pe
6064
super.renounceRole(role, account);
6165
}
6266

63-
6467
/**
6568
* @dev Delegate to Open Zeppelin's ERC20Capped contract.
6669
*/
6770
function _mint(address account, uint256 amount) internal override(ERC20, ERC20Capped) {
6871
ERC20Capped._mint(account, amount);
6972
}
70-
7173
}

0 commit comments

Comments
 (0)