Skip to content

Commit 3f39b8a

Browse files
legion2002claude
andcommitted
fix: combine improvements from PRs #357, #314, and #379
Combines the following fixes: - PR #357: Replace SuperAdminCanSpendAnything with SuperAdminCanExecuteEverything in setCallChecker - PR #314: Fix typos across codebase (overriden→overridden, Calcualated→Calculated, etc.) - PR #379: Correct inline comment about approval amount (20-byte all-ones, not type(uint256).max) Co-Authored-By: GarmashAlex <[email protected]> Co-Authored-By: sukrucildirr <[email protected]> Co-Authored-By: Forostovec <[email protected]> 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7997f6a commit 3f39b8a

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
- All fill related functions removed from EP.
114114
- EP is now completely stateless, also does not have a constructor.
115115
- PreCall with `nonce = type(uint256).max` is not replayable anymore.
116-
- `OpDataTooShort` error, udpated to `OpDataError`, to enforce tighter validation of opdata.
116+
- `OpDataTooShort` error, updated to `OpDataError`, to enforce tighter validation of opdata.
117117
- `checkAndIncrementNonce` function added to account. Can only be called by EP.
118118
- 6b3294a: Optimize `_isSuperAdmin`
119119

@@ -150,7 +150,7 @@
150150

151151
- Add back the INSUFFICIENT_GAS check, which prevents the relay from setting up the `execute` call on the
152152
account, in such a way causing it to intentionally fail.
153-
For the relay, gExecute now has to be set atleast as `gExecute > (gCombined + 100_000) * 64/63)`
153+
For the relay, gExecute now has to be set at least as `gExecute > (gCombined + 100_000) * 64/63)`
154154

155155
### Patch Changes
156156

src/GuardedExecutor.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ abstract contract GuardedExecutor is ERC7821 {
400400
checkKeyHashIsNonZero(keyHash)
401401
{
402402
if (keyHash != ANY_KEYHASH) {
403-
if (_isSuperAdmin(keyHash)) revert SuperAdminCanSpendAnything();
403+
if (_isSuperAdmin(keyHash)) revert SuperAdminCanExecuteEverything();
404404
}
405405

406406
// It is ok even if we don't check for `_isSelfExecute` here, as we will still
@@ -698,10 +698,10 @@ abstract contract GuardedExecutor is ERC7821 {
698698
// Configurables
699699
////////////////////////////////////////////////////////////////////////
700700

701-
/// @dev To be overriden to return if `keyHash` corresponds to a super admin key.
701+
/// @dev To be overridden to return if `keyHash` corresponds to a super admin key.
702702
function _isSuperAdmin(bytes32 keyHash) internal view virtual returns (bool);
703703

704-
/// @dev To be overriden to return the storage slot seed for a `keyHash`.
704+
/// @dev To be overridden to return the storage slot seed for a `keyHash`.
705705
function _getGuardedExecutorKeyStorageSeed(bytes32 keyHash)
706706
internal
707707
view

src/MultiSigSigner.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ contract MultiSigSigner is ISigner {
1212
////////////////////////////////////////////////////////////////////////
1313

1414
/// @dev The magic value returned by `isValidSignatureWithKeyHash` when the signature is valid.
15-
/// - Calcualated as: bytes4(keccak256("isValidSignatureWithKeyHash(bytes32,bytes32,bytes)")
15+
/// - Calculated as: bytes4(keccak256("isValidSignatureWithKeyHash(bytes32,bytes32,bytes)")
1616
bytes4 internal constant _MAGIC_VALUE = 0x8afc93b4;
1717

1818
/// @dev The magic value returned by `isValidSignatureWithKeyHash` when the signature is invalid.
@@ -175,7 +175,7 @@ contract MultiSigSigner is ISigner {
175175
/// for each owner key hash in the config.
176176
/// - Signature of a multi-sig should be encoded as abi.encode(bytes[] memory ownerSignatures)
177177
/// - For efficiency, place the signatures in the same order as the ownerKeyHashes in the config.
178-
/// - Failing owner signatures are ignored, as long as valid signaturs > threshold.
178+
/// - Failing owner signatures are ignored, as long as valid signatures > threshold.
179179
function isValidSignatureWithKeyHash(bytes32 digest, bytes32 keyHash, bytes memory signature)
180180
public
181181
view

src/Orchestrator.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ contract Orchestrator is IOrchestrator, EIP712, CallContextChecker, ReentrancyGu
303303
/// @dev Executes a single encoded intent.
304304
/// @dev If flags is non-zero, then all errors are bubbled up.
305305
/// Currently there can only be 2 modes - simulation mode, and execution mode.
306-
/// But we use a uint256 for efficient stack operations, and more flexiblity in the future.
306+
/// But we use a uint256 for efficient stack operations, and more flexibility in the future.
307307
/// Note: We keep the flags in the stack/memory (TSTORE doesn't work) to make sure they are reset in each new call context,
308308
/// to provide protection against attacks which could spoof the execute function to believe it is in simulation mode.
309309
function _execute(bytes calldata encodedIntent, uint256 combinedGasOverride, uint256 flags)

src/SimpleFunder.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ contract SimpleFunder is EIP712, Ownable, IFunder {
182182
if gt(amount, allowance) {
183183
mstore(m, 0x095ea7b3) // `approve(address,uint256)`.
184184
mstore(add(m, 0x20), caller())
185-
mstore(add(m, 0x40), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) // type(uint256).max
185+
mstore(add(m, 0x40), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) // 20-byte all-ones sentinel (2^160-1), not uint256 max
186186
// Orchestrator checks for token transfer success, so we don't need to check it here.
187187
pop(call(gas(), token, 0, add(m, 0x1c), 0x44, 0x00, 0x00))
188188
}

src/Simulator.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ contract Simulator {
226226
/// @dev Same as simulateCombinedGas, but with an additional verification run
227227
/// that generates a successful non reverting state override simulation.
228228
/// Which can be used in eth_simulateV1 to get the trace.\
229-
/// @param combinedGasVerificationOffset is a static value that is added after a succesful combinedGas is found.
229+
/// @param combinedGasVerificationOffset is a static value that is added after a successful combinedGas is found.
230230
/// This can be used to account for variations in sig verification gas, for keytypes like P256.
231231
/// @param paymentPerGasPrecision The precision of the payment per gas value.
232232
/// paymentAmount = gas * paymentPerGas / (10 ** paymentPerGasPrecision)

test/utils/interfaces/IPimlicoPaymaster.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ library PimlicoHelpers {
1919
/// @notice The length of the mode and allowAllBundlers bytes.
2020
uint8 constant MODE_AND_ALLOW_ALL_BUNDLERS_LENGTH = 1;
2121

22-
/// @notice The length of the ERC-20 config without singature.
22+
/// @notice The length of the ERC-20 config without signature.
2323
uint8 constant ERC20_PAYMASTER_DATA_LENGTH = 117;
2424

25-
/// @notice The length of the verfiying config without singature.
25+
/// @notice The length of the verifying config without signature.
2626
uint8 constant VERIFYING_PAYMASTER_DATA_LENGTH = 12; // 12
2727

2828
uint256 constant PAYMASTER_DATA_OFFSET = 52;

0 commit comments

Comments
 (0)