Skip to content

Commit

Permalink
consistent constant naming
Browse files Browse the repository at this point in the history
  • Loading branch information
nlordell committed May 6, 2024
1 parent 1ecb310 commit 95cb459
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/passkey/contracts/4337/SafeSignerLaunchpad.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
* @notice The EIP-712 type-hash for the domain separator used for verifying Safe initialization signatures.
* @custom:computed-as keccak256("EIP712Domain(uint256 chainId,address verifyingContract)")
*/
bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;
bytes32 private constant _DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;

/**
* @notice The storage slot used for the target Safe singleton address to promote to.
* @custom:computed-as keccak256("SafeSignerLaunchpad.targetSingleton") - 1
* @dev This value is intentionally computed to be a hash -1 as a precaution to avoid any potential issues from
* unintended hash collisions.
*/
uint256 private constant TARGET_SINGLETON_SLOT = 0x610b07c5cf4b478e92ab041de73a412736c750f1bf07a613600b24b3a8bd597e;
uint256 private constant _TARGET_SINGLETON_SLOT = 0x610b07c5cf4b478e92ab041de73a412736c750f1bf07a613600b24b3a8bd597e;

/**
* @notice The keccak256 hash of the EIP-712 SafeInitOp struct, representing the user operation to execute alongside initialization.
Expand All @@ -43,7 +43,7 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
* {address} entryPoint - The address of the entry point that will execute the user operation.
* @custom:computed-as keccak256("SafeInitOp(bytes32 userOpHash,uint48 validAfter,uint48 validUntil,address entryPoint)")
*/
bytes32 private constant SAFE_INIT_OP_TYPEHASH = 0x25838d3914a61e3531f21f12b8cd3110a5f9d478292d07dd197859a5c4eaacb2;
bytes32 private constant _SAFE_INIT_OP_TYPEHASH = 0x25838d3914a61e3531f21f12b8cd3110a5f9d478292d07dd197859a5c4eaacb2;

/**
* @notice An error indicating that the entry point used when deploying a new module instance is invalid.
Expand Down Expand Up @@ -205,7 +205,7 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
* @return domainSeparatorHash The EIP-712 domain separator hash for this contract.
*/
function domainSeparator() public view returns (bytes32) {
return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, block.chainid, _SELF));
return keccak256(abi.encode(_DOMAIN_SEPARATOR_TYPEHASH, block.chainid, _SELF));
}

/**
Expand All @@ -223,7 +223,7 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
abi.encodePacked(
bytes2(0x1901),
domainSeparator(),
keccak256(abi.encode(SAFE_INIT_OP_TYPEHASH, userOpHash, validAfter, validUntil, SUPPORTED_ENTRYPOINT))
keccak256(abi.encode(_SAFE_INIT_OP_TYPEHASH, userOpHash, validAfter, validUntil, SUPPORTED_ENTRYPOINT))
)
);
}
Expand Down Expand Up @@ -378,7 +378,7 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
assembly ("memory-safe") {
// Note that we explicitly don't mask the address, as Solidity will generate masking code for every time
// the variable is read.
value := sload(TARGET_SINGLETON_SLOT)
value := sload(_TARGET_SINGLETON_SLOT)
}
}

Expand All @@ -389,7 +389,7 @@ contract SafeSignerLaunchpad is IAccount, SafeStorage {
function _setTargetSingleton(address value) internal {
// solhint-disable-next-line no-inline-assembly
assembly ("memory-safe") {
sstore(TARGET_SINGLETON_SLOT, value)
sstore(_TARGET_SINGLETON_SLOT, value)
}
}
}

0 comments on commit 95cb459

Please sign in to comment.