Skip to content

Commit 727b621

Browse files
Filipp MakarovFilipp Makarov
authored andcommitted
chore: forge linting
1 parent 213edde commit 727b621

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

contracts/lib/nexus/ProxyLib.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ library ProxyLib {
5757
returns (address payable predictedAddress)
5858
{
5959
// Get the init code hash
60-
/// forge-lint:disable-next-line(asm-keccak256)
60+
/// forge-lint:disable-start(asm-keccak256)
6161
bytes32 initCodeHash = keccak256(
6262
abi.encodePacked(
6363
type(NexusProxy).creationCode,
6464
abi.encode(implementation, abi.encodeCall(INexus.initializeAccount, initData))
6565
)
6666
);
67+
/// forge-lint:disable-end(asm-keccak256)
6768

6869
// Compute the predicted address
6970
predictedAddress = payable(address(

contracts/lib/stx-validator/validation-modes/SimpleValidatorLib.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ library SimpleValidatorLib {
6868
return SIG_VALIDATION_FAILED;
6969
}
7070

71-
/// forge-lint:disable-next-line(unsafe-typecast)
7271
/// timestamps are never big enough to overflow uint48
72+
/// forge-lint:disable-next-line(unsafe-typecast)
7373
return _packValidationData(false, uint48(upperBoundTimestamp), uint48(lowerBoundTimestamp));
7474
}
7575

contracts/lib/stx-validator/validation-modes/TxValidatorLib.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ library TxValidatorLib {
327327
if (v >= EIP_155_MIN_V_VALUE) {
328328
return uint8((v - 2 * _extractChainIdFromV(v) - 35) + 27);
329329
} else if (v <= 1) {
330+
/// forge-lint:disable-next-line(unsafe-typecast)
330331
return uint8(v + 27);
331332
} else {
333+
/// forge-lint:disable-next-line(unsafe-typecast)
332334
return uint8(v);
333335
}
334336
}

contracts/nexus/Nexus.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
412412
// Handle potential ERC7739 support detection request
413413
if (signature.length == 0) {
414414
// Forces the compiler to optimize for smaller bytecode size.
415+
/// forge-lint:disable-next-line(divide-before-multiplModuleManager.sol:716:16y)
415416
if (uint256(hash) == (~signature.length / 0xffff) * 0x7739) {
416417
return _checkERC7739Support(hash, signature);
417418
}
@@ -453,6 +454,7 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
453454
|| MODULE_TYPE_PREVALIDATION_HOOK_ERC4337 || MODULE_TYPE_MULTI */
454455
// Bitmap: 0x31F represents supported module types: 0,1,2,3,4,8,9
455456
// 0x31F = 0b1100011111 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9)
457+
/// forge-lint:disable-next-line(incorrect-shift)
456458
return ((1 << moduleTypeId) & 0x31F) != 0;
457459
}
458460

@@ -556,6 +558,7 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
556558
returns (bytes4)
557559
{
558560
bytes4 support = IValidator(validator).isValidSignatureWithSender(msg.sender, hash, signature);
561+
/// forge-lint:disable-next-line(unsafe-typecast)
559562
if (bytes2(support) == bytes2(SUPPORTS_ERC7739) && support > prevResult) {
560563
return support;
561564
}

contracts/node-pm/NodePaymasterFactory.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ contract NodePaymasterFactory {
102102
mstore(add(ptr, 0x35), initCodeHash)
103103
predictedAddress := keccak256(ptr, 0x55)
104104
}
105+
/// forge-lint:disable-next-line(unsafe-typecast)
105106
return payable(address(uint160(predictedAddress)));
106107
}
107108

0 commit comments

Comments
 (0)