Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
- All fill related functions removed from EP.
- EP is now completely stateless, also does not have a constructor.
- PreCall with `nonce = type(uint256).max` is not replayable anymore.
- `OpDataTooShort` error, udpated to `OpDataError`, to enforce tighter validation of opdata.
- `OpDataTooShort` error, updated to `OpDataError`, to enforce tighter validation of opdata.
- `checkAndIncrementNonce` function added to account. Can only be called by EP.
- 6b3294a: Optimize `_isSuperAdmin`

Expand Down Expand Up @@ -150,7 +150,7 @@

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

### Patch Changes

Expand Down
6 changes: 3 additions & 3 deletions src/GuardedExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ abstract contract GuardedExecutor is ERC7821 {
checkKeyHashIsNonZero(keyHash)
{
if (keyHash != ANY_KEYHASH) {
if (_isSuperAdmin(keyHash)) revert SuperAdminCanSpendAnything();
if (_isSuperAdmin(keyHash)) revert SuperAdminCanExecuteEverything();
}

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

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

/// @dev To be overriden to return the storage slot seed for a `keyHash`.
/// @dev To be overridden to return the storage slot seed for a `keyHash`.
function _getGuardedExecutorKeyStorageSeed(bytes32 keyHash)
internal
view
Expand Down
2 changes: 1 addition & 1 deletion src/IthacaAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,6 @@ contract IthacaAccount is IIthacaAccount, EIP712, GuardedExecutor {
returns (string memory name, string memory version)
{
name = "IthacaAccount";
version = "0.5.10";
version = "0.5.11";
}
}
4 changes: 2 additions & 2 deletions src/MultiSigSigner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ contract MultiSigSigner is ISigner {
////////////////////////////////////////////////////////////////////////

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

/// @dev The magic value returned by `isValidSignatureWithKeyHash` when the signature is invalid.
Expand Down Expand Up @@ -175,7 +175,7 @@ contract MultiSigSigner is ISigner {
/// for each owner key hash in the config.
/// - Signature of a multi-sig should be encoded as abi.encode(bytes[] memory ownerSignatures)
/// - For efficiency, place the signatures in the same order as the ownerKeyHashes in the config.
/// - Failing owner signatures are ignored, as long as valid signaturs > threshold.
/// - Failing owner signatures are ignored, as long as valid signatures > threshold.
function isValidSignatureWithKeyHash(bytes32 digest, bytes32 keyHash, bytes memory signature)
public
view
Expand Down
2 changes: 1 addition & 1 deletion src/Orchestrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ contract Orchestrator is IOrchestrator, EIP712, CallContextChecker, ReentrancyGu
/// @dev Executes a single encoded intent.
/// @dev If flags is non-zero, then all errors are bubbled up.
/// Currently there can only be 2 modes - simulation mode, and execution mode.
/// But we use a uint256 for efficient stack operations, and more flexiblity in the future.
/// But we use a uint256 for efficient stack operations, and more flexibility in the future.
/// Note: We keep the flags in the stack/memory (TSTORE doesn't work) to make sure they are reset in each new call context,
/// to provide protection against attacks which could spoof the execute function to believe it is in simulation mode.
function _execute(bytes calldata encodedIntent, uint256 combinedGasOverride, uint256 flags)
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleFunder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ contract SimpleFunder is EIP712, Ownable, IFunder {
if gt(amount, allowance) {
mstore(m, 0x095ea7b3) // `approve(address,uint256)`.
mstore(add(m, 0x20), caller())
mstore(add(m, 0x40), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) // type(uint256).max
mstore(add(m, 0x40), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) // 20-byte all-ones sentinel (2^160-1), not uint256 max
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took a look at the other PR - theres 42 F's here so this is actually u168max, not u160max

im fine with either changing this to 40 F's, or changing the comment to u168max

// Orchestrator checks for token transfer success, so we don't need to check it here.
pop(call(gas(), token, 0, add(m, 0x1c), 0x44, 0x00, 0x00))
}
Expand Down
2 changes: 1 addition & 1 deletion src/Simulator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ contract Simulator {
/// @dev Same as simulateCombinedGas, but with an additional verification run
/// that generates a successful non reverting state override simulation.
/// Which can be used in eth_simulateV1 to get the trace.\
/// @param combinedGasVerificationOffset is a static value that is added after a succesful combinedGas is found.
/// @param combinedGasVerificationOffset is a static value that is added after a successful combinedGas is found.
/// This can be used to account for variations in sig verification gas, for keytypes like P256.
/// @param paymentPerGasPrecision The precision of the payment per gas value.
/// paymentAmount = gas * paymentPerGas / (10 ** paymentPerGasPrecision)
Expand Down
4 changes: 2 additions & 2 deletions test/utils/interfaces/IPimlicoPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ library PimlicoHelpers {
/// @notice The length of the mode and allowAllBundlers bytes.
uint8 constant MODE_AND_ALLOW_ALL_BUNDLERS_LENGTH = 1;

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

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

uint256 constant PAYMASTER_DATA_OFFSET = 52;
Expand Down