Skip to content

Commit c1bf00f

Browse files
committed
chore: reformat with latest stable foundry
1 parent 6808f1d commit c1bf00f

Some content is hidden

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

53 files changed

+621
-241
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install foundry
2525
uses: foundry-rs/foundry-toolchain@v1
2626
with:
27-
version: nightly
27+
version: stable
2828

2929
- name: Install Docker buildx
3030
uses: docker/setup-buildx-action@v2
@@ -102,7 +102,7 @@ jobs:
102102
- name: Install foundry
103103
uses: foundry-rs/foundry-toolchain@v1
104104
with:
105-
version: nightly
105+
version: stable
106106

107107
- name: Run forge build
108108
run: |
@@ -148,6 +148,8 @@ jobs:
148148

149149
- name: Install Foundry
150150
uses: foundry-rs/foundry-toolchain@v1
151+
with:
152+
version: stable
151153

152154
- name: Check code coverage
153155
run: forge coverage --report summary --report lcov

script/DeployL1.s.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ contract DeployL1 is ImmutableCreate2Deployer {
2222
runDeploy(loadDeploymentParams());
2323
}
2424

25-
function runDeploy(DeploymentParams memory params) public returns (Contracts memory) {
25+
function runDeploy(
26+
DeploymentParams memory params
27+
) public returns (Contracts memory) {
2628
return runDeploy(params, true);
2729
}
2830

script/DeployL2.s.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ contract DeployL2 is ImmutableCreate2Deployer {
7575
runSetup(runDeploy(loadDeploymentParams()));
7676
}
7777

78-
function runDeploy(DeploymentParams memory params) public returns (Contracts memory) {
78+
function runDeploy(
79+
DeploymentParams memory params
80+
) public returns (Contracts memory) {
7981
return runDeploy(params, true);
8082
}
8183

@@ -175,7 +177,9 @@ contract DeployL2 is ImmutableCreate2Deployer {
175177
}
176178
}
177179

178-
function runSetup(Contracts memory contracts) public {
180+
function runSetup(
181+
Contracts memory contracts
182+
) public {
179183
DeploymentParams memory params = loadDeploymentParams();
180184
runSetup(contracts, params, true);
181185
}

script/LocalDeploy.s.sol

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,11 @@ contract LocalDeploy is Script {
3636

3737
vm.startBroadcast();
3838
(AggregatorV3Interface priceFeed, AggregatorV3Interface uptimeFeed) = _getOrDeployPriceFeeds();
39-
IdRegistry idRegistry = new IdRegistry{salt: ID_REGISTRY_CREATE2_SALT}(
40-
migrator,
41-
initialIdRegistryOwner
39+
IdRegistry idRegistry = new IdRegistry{salt: ID_REGISTRY_CREATE2_SALT}(migrator, initialIdRegistryOwner);
40+
KeyRegistry keyRegistry = new KeyRegistry{salt: KEY_REGISTRY_CREATE2_SALT}(
41+
address(idRegistry), migrator, initialKeyRegistryOwner, 1000
4242
);
43-
KeyRegistry keyRegistry = new KeyRegistry{
44-
salt: KEY_REGISTRY_CREATE2_SALT
45-
}(address(idRegistry), migrator, initialKeyRegistryOwner, 1000);
46-
StorageRegistry storageRegistry = new StorageRegistry{
47-
salt: STORAGE_RENT_CREATE2_SALT
48-
}(
43+
StorageRegistry storageRegistry = new StorageRegistry{salt: STORAGE_RENT_CREATE2_SALT}(
4944
priceFeed,
5045
uptimeFeed,
5146
INITIAL_USD_UNIT_PRICE,

script/UpgradeL2.s.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ contract UpgradeL2 is ImmutableCreate2Deployer, Test {
6969
runSetup(runDeploy(loadDeploymentParams()));
7070
}
7171

72-
function runDeploy(DeploymentParams memory params) public returns (Contracts memory) {
72+
function runDeploy(
73+
DeploymentParams memory params
74+
) public returns (Contracts memory) {
7375
return runDeploy(params, true);
7476
}
7577

@@ -182,7 +184,9 @@ contract UpgradeL2 is ImmutableCreate2Deployer, Test {
182184
}
183185
}
184186

185-
function runSetup(Contracts memory contracts) public {
187+
function runSetup(
188+
Contracts memory contracts
189+
) public {
186190
DeploymentParams memory params = loadDeploymentParams();
187191
runSetup(contracts, params, true);
188192
}

script/abstract/ImmutableCreate2Deployer.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import "forge-std/console.sol";
66
import {Strings} from "openzeppelin/contracts/utils/Strings.sol";
77

88
interface ImmutableCreate2Factory {
9-
function hasBeenDeployed(address deploymentAddress) external view returns (bool);
9+
function hasBeenDeployed(
10+
address deploymentAddress
11+
) external view returns (bool);
1012

1113
function findCreate2Address(
1214
bytes32 salt,
@@ -132,7 +134,9 @@ abstract contract ImmutableCreate2Deployer is Script {
132134
/**
133135
* @dev Deploy all registered contracts.
134136
*/
135-
function deploy(bool broadcast) internal {
137+
function deploy(
138+
bool broadcast
139+
) internal {
136140
console.log(pad("State", 10), pad("Name", 27), pad("Address", 43), "Initcode hash");
137141
for (uint256 i; i < names.length; i++) {
138142
_deploy(names[i], broadcast);
@@ -153,7 +157,9 @@ abstract contract ImmutableCreate2Deployer is Script {
153157
_deploy(name, broadcast);
154158
}
155159

156-
function deploy(string memory name) internal {
160+
function deploy(
161+
string memory name
162+
) internal {
157163
deploy(name, true);
158164
}
159165

src/Bundler.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ contract Bundler is IBundler {
5757
/**
5858
* @inheritdoc IBundler
5959
*/
60-
function price(uint256 extraStorage) external view returns (uint256) {
60+
function price(
61+
uint256 extraStorage
62+
) external view returns (uint256) {
6163
return idGateway.price(extraStorage);
6264
}
6365

src/FnameResolver.sol

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import {ERC165} from "openzeppelin/contracts/utils/introspection/ERC165.sol";
88
import {EIP712} from "./abstract/EIP712.sol";
99

1010
interface IAddressQuery {
11-
function addr(bytes32 node) external view returns (address);
11+
function addr(
12+
bytes32 node
13+
) external view returns (address);
1214
}
1315

1416
interface IExtendedResolver {
@@ -183,7 +185,9 @@ contract FnameResolver is IExtendedResolver, EIP712, ERC165, Ownable2Step {
183185
*
184186
* @param signer The signer address.
185187
*/
186-
function addSigner(address signer) external onlyOwner {
188+
function addSigner(
189+
address signer
190+
) external onlyOwner {
187191
signers[signer] = true;
188192
emit AddSigner(signer);
189193
}
@@ -193,7 +197,9 @@ contract FnameResolver is IExtendedResolver, EIP712, ERC165, Ownable2Step {
193197
*
194198
* @param signer The signer address.
195199
*/
196-
function removeSigner(address signer) external onlyOwner {
200+
function removeSigner(
201+
address signer
202+
) external onlyOwner {
197203
signers[signer] = false;
198204
emit RemoveSigner(signer);
199205
}
@@ -202,7 +208,9 @@ contract FnameResolver is IExtendedResolver, EIP712, ERC165, Ownable2Step {
202208
INTERFACE DETECTION
203209
//////////////////////////////////////////////////////////////*/
204210

205-
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
211+
function supportsInterface(
212+
bytes4 interfaceId
213+
) public view override returns (bool) {
206214
return interfaceId == type(IExtendedResolver).interfaceId || super.supportsInterface(interfaceId);
207215
}
208216
}

src/IdGateway.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ contract IdGateway is IIdGateway, Guardians, Signatures, EIP712, Nonces {
9090
/**
9191
* @inheritdoc IIdGateway
9292
*/
93-
function price(uint256 extraStorage) external view returns (uint256) {
93+
function price(
94+
uint256 extraStorage
95+
) external view returns (uint256) {
9496
return storageRegistry.price(1 + extraStorage);
9597
}
9698

@@ -101,7 +103,9 @@ contract IdGateway is IIdGateway, Guardians, Signatures, EIP712, Nonces {
101103
/**
102104
* @inheritdoc IIdGateway
103105
*/
104-
function register(address recovery) external payable returns (uint256, uint256) {
106+
function register(
107+
address recovery
108+
) external payable returns (uint256, uint256) {
105109
return register(recovery, 0);
106110
}
107111

@@ -145,7 +149,9 @@ contract IdGateway is IIdGateway, Guardians, Signatures, EIP712, Nonces {
145149
/**
146150
* @inheritdoc IIdGateway
147151
*/
148-
function setStorageRegistry(address _storageRegistry) external onlyOwner {
152+
function setStorageRegistry(
153+
address _storageRegistry
154+
) external onlyOwner {
149155
emit SetStorageRegistry(address(storageRegistry), _storageRegistry);
150156
storageRegistry = IStorageRegistry(_storageRegistry);
151157
}

src/IdRegistry.sol

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces {
255255
/**
256256
* @inheritdoc IIdRegistry
257257
*/
258-
function changeRecoveryAddress(address recovery) external whenNotPaused {
258+
function changeRecoveryAddress(
259+
address recovery
260+
) external whenNotPaused {
259261
/* Revert if the caller does not own an fid */
260262
uint256 ownerId = idOf[msg.sender];
261263
if (ownerId == 0) revert HasNoId();
@@ -359,7 +361,9 @@ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces {
359361
/**
360362
* @inheritdoc IIdRegistry
361363
*/
362-
function setIdGateway(address _idGateway) external onlyOwner {
364+
function setIdGateway(
365+
address _idGateway
366+
) external onlyOwner {
363367
if (gatewayFrozen) revert GatewayFrozen();
364368
emit SetIdGateway(idGateway, _idGateway);
365369
idGateway = _idGateway;
@@ -378,7 +382,9 @@ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces {
378382
MIGRATION
379383
//////////////////////////////////////////////////////////////*/
380384

381-
function bulkRegisterIds(BulkRegisterData[] calldata ids) external onlyMigrator {
385+
function bulkRegisterIds(
386+
BulkRegisterData[] calldata ids
387+
) external onlyMigrator {
382388
// Safety: i can be incremented unchecked since it is bound by ids.length.
383389
unchecked {
384390
for (uint256 i = 0; i < ids.length; i++) {
@@ -403,7 +409,9 @@ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces {
403409
}
404410
}
405411

406-
function bulkResetIds(uint24[] calldata ids) external onlyMigrator {
412+
function bulkResetIds(
413+
uint24[] calldata ids
414+
) external onlyMigrator {
407415
// Safety: i can be incremented unchecked since it is bound by ids.length.
408416
unchecked {
409417
for (uint256 i = 0; i < ids.length; i++) {
@@ -419,7 +427,9 @@ contract IdRegistry is IIdRegistry, Migration, Signatures, EIP712, Nonces {
419427
}
420428
}
421429

422-
function setIdCounter(uint256 _counter) external onlyMigrator {
430+
function setIdCounter(
431+
uint256 _counter
432+
) external onlyMigrator {
423433
emit SetIdCounter(idCounter, _counter);
424434
idCounter = _counter;
425435
}

0 commit comments

Comments
 (0)