Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/modules/validation/ISingleSignerValidationModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ interface ISingleSignerValidationModule is IValidationModule {
/// @notice This event is emitted when Signer of the account's validation changes.
/// @param account The account whose validation Signer changed.
/// @param entityId The entityId for the account and the signer.
/// @param previousSigner The address of the previous signer.
/// @param newSigner The address of the new signer.
/// @param previousSigner The address of the previous signer.
event SignerTransferred(
address indexed account, uint32 indexed entityId, address previousSigner, address newSigner
);
address indexed account, uint32 indexed entityId, address indexed newSigner, address previousSigner
) anonymous;

error NotAuthorized();

Expand Down
7 changes: 2 additions & 5 deletions src/modules/validation/SingleSignerValidationModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ contract SingleSignerValidationModule is ISingleSignerValidationModule, BaseModu
/// @inheritdoc IValidationModule
/// @dev The signature is valid if it is signed by the owner's private key
/// (if the owner is an EOA) or if it is a valid ERC-1271 signature from the
/// owner (if the owner is a contract). Note that unlike the signature
/// validation used in `validateUserOp`, this does///*not** wrap the digest in
/// an "Ethereum Signed Message" envelope before checking the signature in
/// the EOA-owner case.
/// owner (if the owner is a contract). Note that the signature is wrapped in an EIP-191 message
function validateSignature(address account, uint32 entityId, address, bytes32 digest, bytes calldata signature)
external
view
Expand Down Expand Up @@ -130,6 +127,6 @@ contract SingleSignerValidationModule is ISingleSignerValidationModule, BaseModu
function _transferSigner(uint32 entityId, address newSigner) internal {
address previousSigner = signers[entityId][msg.sender];
signers[entityId][msg.sender] = newSigner;
emit SignerTransferred(msg.sender, entityId, previousSigner, newSigner);
emit SignerTransferred(msg.sender, entityId, newSigner, previousSigner);
}
}
6 changes: 6 additions & 0 deletions test/module/SingleSignerValidationModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ contract SingleSignerValidationModuleTest is AccountTestBase {

event ValidationInstalled(address indexed module, uint32 indexed entityId);

event SignerTransferred(
address indexed account, uint32 indexed entityId, address indexed newSigner, address previousSigner
) anonymous;

function setUp() public {
ethRecipient = makeAddr("ethRecipient");
(owner2, owner2Key) = makeAddrAndKey("owner2");
Expand Down Expand Up @@ -82,6 +86,8 @@ contract SingleSignerValidationModuleTest is AccountTestBase {
uint32 newEntityId = TEST_DEFAULT_VALIDATION_ENTITY_ID + 1;
vm.prank(address(entryPoint));

vm.expectEmit(address(singleSignerValidationModule));
emit SignerTransferred(address(account), newEntityId, owner2, address(0));
vm.expectEmit(true, true, true, true);
emit ValidationInstalled(address(singleSignerValidationModule), newEntityId);
account.installValidation(
Expand Down