diff --git a/packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol b/packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol index 602454f..ead302b 100644 --- a/packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol +++ b/packages/contracts/src/utils/ECDSAOwnedDKIMRegistry.sol @@ -25,6 +25,8 @@ contract ECDSAOwnedDKIMRegistry is string public constant SET_PREFIX = "SET:"; string public constant REVOKE_PREFIX = "REVOKE:"; + event SignerChanged(address indexed oldSigner, address indexed newOwner); + constructor() {} /// @notice Initializes the contract with a predefined signer and deploys a new DKIMRegistry. @@ -159,7 +161,9 @@ contract ECDSAOwnedDKIMRegistry is function changeSigner(address _newSigner) public onlyOwner { require(_newSigner != address(0), "Invalid signer"); require(_newSigner != signer, "Same signer"); + address oldSigner = signer; signer = _newSigner; + emit SignerChanged(oldSigner, _newSigner); } /// @notice Upgrade the implementation of the proxy. diff --git a/packages/contracts/src/utils/ForwardDKIMRegistry.sol b/packages/contracts/src/utils/ForwardDKIMRegistry.sol index fa8fc75..1a5a5c8 100644 --- a/packages/contracts/src/utils/ForwardDKIMRegistry.sol +++ b/packages/contracts/src/utils/ForwardDKIMRegistry.sol @@ -15,6 +15,12 @@ contract ForwardDKIMRegistry is { IDKIMRegistry public sourceDKIMRegistry; + event sourceDKIMRegistryChanged( + address indexed oldRegistry, + address indexed newRegistry + ); + event StorageReset(address indexed sourceDKIMRegistry); + constructor() {} /// @notice Initializes the contract with a predefined signer and deploys a new DKIMRegistry. @@ -57,7 +63,9 @@ contract ForwardDKIMRegistry is _newSourceDKIMRegistry != address(this), "Cannot set self as source DKIMRegistry" ); + address oldRegistryAddr = address(sourceDKIMRegistry); sourceDKIMRegistry = IDKIMRegistry(_newSourceDKIMRegistry); + emit sourceDKIMRegistryChanged(oldRegistryAddr, _newSourceDKIMRegistry); } /// @notice Upgrade the implementation of the proxy from the ECDSAOwnedDKIMRegistry. @@ -70,6 +78,7 @@ contract ForwardDKIMRegistry is sstore(sourceDKIMRegistry.slot, _sourceDKIMRegistry) sstore(add(sourceDKIMRegistry.slot, 1), 0) } + emit StorageReset(_sourceDKIMRegistry); } /// @notice Upgrade the implementation of the proxy.