From f832e97f9ffbff420c6b37877c37103165975103 Mon Sep 17 00:00:00 2001 From: Egill Hreinsson Date: Mon, 15 Sep 2025 19:14:22 +0100 Subject: [PATCH 1/2] add pub key to CredentialAdded event --- src/WebAuthnValidator/WebAuthnValidator.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WebAuthnValidator/WebAuthnValidator.sol b/src/WebAuthnValidator/WebAuthnValidator.sol index ee96527..565744c 100644 --- a/src/WebAuthnValidator/WebAuthnValidator.sol +++ b/src/WebAuthnValidator/WebAuthnValidator.sol @@ -79,7 +79,8 @@ contract WebAuthnValidator is ERC7579HybridValidatorBase { /// @notice Emitted when a credential is added to an account /// @param account The address of the smart account /// @param credentialId The ID of the added credential - event CredentialAdded(address indexed account, bytes32 indexed credentialId); + /// @param credential The WebAuthn credential + event CredentialAdded(address indexed account, bytes32 indexed credentialId, WebAuthnCredential credential); /// @notice Emitted when a credential is removed from an account /// @param account The address of the smart account @@ -202,7 +203,7 @@ contract WebAuthnValidator is ERC7579HybridValidatorBase { } // Emit event - emit CredentialAdded(account, credId); + emit CredentialAdded(account, credId, _credentials[i]); // Cache the credential ID require(credentialId < credId, NotSorted()); @@ -303,7 +304,7 @@ contract WebAuthnValidator is ERC7579HybridValidatorBase { revert CredentialAlreadyExists(); } - emit CredentialAdded(account, credentialId); + emit CredentialAdded(account, credentialId, WebAuthnCredential({ pubKeyX: pubKeyX, pubKeyY: pubKeyY, requireUV: requireUV })); } /// @notice Removes a WebAuthn credential from the account From 2e1a591abac7274c867007672f5fae1602909f75 Mon Sep 17 00:00:00 2001 From: Egill Hreinsson Date: Mon, 15 Sep 2025 20:29:50 +0100 Subject: [PATCH 2/2] lint sol file --- src/WebAuthnValidator/WebAuthnValidator.sol | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/WebAuthnValidator/WebAuthnValidator.sol b/src/WebAuthnValidator/WebAuthnValidator.sol index 565744c..7d616d1 100644 --- a/src/WebAuthnValidator/WebAuthnValidator.sol +++ b/src/WebAuthnValidator/WebAuthnValidator.sol @@ -80,7 +80,9 @@ contract WebAuthnValidator is ERC7579HybridValidatorBase { /// @param account The address of the smart account /// @param credentialId The ID of the added credential /// @param credential The WebAuthn credential - event CredentialAdded(address indexed account, bytes32 indexed credentialId, WebAuthnCredential credential); + event CredentialAdded( + address indexed account, bytes32 indexed credentialId, WebAuthnCredential credential + ); /// @notice Emitted when a credential is removed from an account /// @param account The address of the smart account @@ -304,7 +306,11 @@ contract WebAuthnValidator is ERC7579HybridValidatorBase { revert CredentialAlreadyExists(); } - emit CredentialAdded(account, credentialId, WebAuthnCredential({ pubKeyX: pubKeyX, pubKeyY: pubKeyY, requireUV: requireUV })); + emit CredentialAdded( + account, + credentialId, + WebAuthnCredential({ pubKeyX: pubKeyX, pubKeyY: pubKeyY, requireUV: requireUV }) + ); } /// @notice Removes a WebAuthn credential from the account