@@ -9,7 +9,6 @@ import "openzeppelin/contracts/access/Ownable.sol";
9
9
* Inherits from OpenZeppelin's Ownable contract to enable ownership-based access control.
10
10
*/
11
11
contract ShutterRegistry is Ownable {
12
-
13
12
// Custom error for when an identity is already registered.
14
13
error AlreadyRegistered ();
15
14
@@ -24,6 +23,7 @@ contract ShutterRegistry is Ownable {
24
23
25
24
/**
26
25
* @dev Emitted when a new identity is successfully registered.
26
+ * @param eon The eon associated with the identity.
27
27
* @param identityPrefix The raw prefix input used to derive the registered identity hash.
28
28
* @param sender The address of the account that performed the registration.
29
29
* @param timestamp The timestamp associated with the registered identity.
@@ -50,9 +50,15 @@ contract ShutterRegistry is Ownable {
50
50
* - The identity must not already be registered.
51
51
* - The provided timestamp must not be in the past.
52
52
*/
53
- function register (uint64 eon , bytes32 identityPrefix , uint64 timestamp ) external {
53
+ function register (
54
+ uint64 eon ,
55
+ bytes32 identityPrefix ,
56
+ uint64 timestamp
57
+ ) external {
54
58
// Generate the identity hash from the provided prefix and the sender's address.
55
- bytes32 identity = keccak256 (abi.encodePacked (identityPrefix, msg .sender ));
59
+ bytes32 identity = keccak256 (
60
+ abi.encodePacked (identityPrefix, msg .sender )
61
+ );
56
62
57
63
// Ensure the identity is not already registered.
58
64
require (registrations[identity] == uint64 (0 ), AlreadyRegistered ());
@@ -64,11 +70,6 @@ contract ShutterRegistry is Ownable {
64
70
registrations[identity] = timestamp;
65
71
66
72
// Emit the IdentityRegistered event.
67
- emit IdentityRegistered (
68
- eon,
69
- identityPrefix,
70
- msg .sender ,
71
- timestamp
72
- );
73
+ emit IdentityRegistered (eon, identityPrefix, msg .sender , timestamp);
73
74
}
74
75
}
0 commit comments