Skip to content

Commit

Permalink
[ALC-2] add comment explaining contract owner limitations for user op…
Browse files Browse the repository at this point in the history
…eration validation
  • Loading branch information
jaypaik committed Sep 20, 2023
1 parent aa8196b commit a717eca
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/LightAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,19 @@ contract LightAccount is BaseAccount, TokenCallbackHandler, UUPSUpgradeable, Cus
emit OwnershipTransferred(oldOwner, newOwner);
}

/*
* Implement template method of BaseAccount.
*
* Uses a modified version of `SignatureChecker.isValidSignatureNow` in
/**
* @notice Implement template method of BaseAccount.
* @dev Uses a modified version of `SignatureChecker.isValidSignatureNow` in
* which the digest is wrapped with an "Ethereum Signed Message" envelope
* for the EOA-owner case but not in the ERC-1271 contract-owner case.
*
* ERC-4337's validation rules limit the types of contracts that can be
* used as owners to validate user operation signatures. For example, the
* contract's `isValidSignature` function may not use any forbidden opcodes
* such as `TIMESTAMP` or `NUMBER`, and the contract may not be an ERC-1967
* proxy as it accesses a constant implementation slot not associated with
* the account, violating storage access rules. This also means that the
* owner may not be another LightAccount.
*/
function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash)
internal
Expand Down

0 comments on commit a717eca

Please sign in to comment.