diff --git a/src/LightAccount.sol b/src/LightAccount.sol index af44672..f3ea34c 100644 --- a/src/LightAccount.sol +++ b/src/LightAccount.sol @@ -57,12 +57,12 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus 0x33e4b41198cc5b8053630ed667ea7c0c4c873f7fc8d9a478b5d7259cec0a4a00; // bytes4(keccak256("isValidSignature(bytes32,bytes)")) bytes4 internal constant _1271_MAGIC_VALUE = 0x1626ba7e; - IEntryPoint private immutable _entryPoint; + IEntryPoint private immutable _ENTRY_POINT; // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)") - bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = + bytes32 private constant _DOMAIN_SEPARATOR_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f; // keccak256("LightAccountMessage(bytes message)"); - bytes32 private constant LA_MSG_TYPEHASH = 0x5e3baca2936049843f06038876a12f03627b5edc98025751ecf2ac7562640199; + bytes32 private constant _LA_MSG_TYPEHASH = 0x5e3baca2936049843f06038876a12f03627b5edc98025751ecf2ac7562640199; bytes32 private constant _NAME_HASH = keccak256(bytes("LightAccount")); bytes32 private constant _VERSION_HASH = keccak256(bytes("1")); @@ -107,7 +107,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus } constructor(IEntryPoint anEntryPoint) CustomSlotInitializable(_INITIALIZABLE_STORAGE_POSITION) { - _entryPoint = anEntryPoint; + _ENTRY_POINT = anEntryPoint; _disableInitializers(); } @@ -185,7 +185,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus /** * @notice Called once as part of initialization, either during initial deployment or when first upgrading to * this contract. - * @dev The _entryPoint member is immutable, to reduce gas consumption. To upgrade EntryPoint, + * @dev The _ENTRY_POINT member is immutable, to reduce gas consumption. To upgrade EntryPoint, * a new implementation of LightAccount must be deployed with the new EntryPoint address, then upgrading * the implementation by calling `upgradeTo()` * @param anOwner The initial owner of the account @@ -212,7 +212,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus /// @inheritdoc BaseAccount function entryPoint() public view virtual override returns (IEntryPoint) { - return _entryPoint; + return _ENTRY_POINT; } /** @@ -238,7 +238,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus function domainSeparator() public view returns (bytes32) { return keccak256( abi.encode( - DOMAIN_SEPARATOR_TYPEHASH, + _DOMAIN_SEPARATOR_TYPEHASH, _NAME_HASH, // name _VERSION_HASH, // version block.chainid, // chainId @@ -253,7 +253,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus * @return Encoded message. */ function encodeMessageData(bytes memory message) public view returns (bytes memory) { - bytes32 messageHash = keccak256(abi.encode(LA_MSG_TYPEHASH, keccak256(message))); + bytes32 messageHash = keccak256(abi.encode(_LA_MSG_TYPEHASH, keccak256(message))); return abi.encodePacked("\x19\x01", domainSeparator(), messageHash); } @@ -289,7 +289,7 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus revert InvalidOwner(address(0)); } _getStorage().owner = anOwner; - emit LightAccountInitialized(_entryPoint, anOwner); + emit LightAccountInitialized(_ENTRY_POINT, anOwner); emit OwnershipTransferred(address(0), anOwner); }