Commit e6b60e2 1 parent 4c3fc59 commit e6b60e2 Copy full SHA for e6b60e2
File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,17 @@ contract ReverseRegistrar is Ownable {
71
71
/// @notice Decorator for checking authorization status for a caller against a provided `addr`.
72
72
///
73
73
/// @dev A caller is authorized to set the record for `addr` if they are one of:
74
- /// 1. The `addr` is the sender
74
+ /// 1. The `addr` is the sender
75
75
/// 2. The sender is an approved `controller`
76
76
/// 3. The sender is an approved operator for `addr` on the registry
77
77
/// 4. The sender is `Ownable:ownerOf()` for `addr`
78
78
///
79
79
/// @param addr The `addr` that is being modified.
80
80
modifier authorized (address addr ) {
81
- if (addr != msg .sender && ! controllers[msg .sender ] && ! registry.isApprovedForAll (addr, msg .sender ) && ! _ownsContract (addr)) {
81
+ if (
82
+ addr != msg .sender && ! controllers[msg .sender ] && ! registry.isApprovedForAll (addr, msg .sender )
83
+ && ! _ownsContract (addr)
84
+ ) {
82
85
revert NotAuthorized (addr, msg .sender );
83
86
}
84
87
_;
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ contract SetControllerApproval is ReverseRegistrarBase {
10
10
vm.assume (caller != owner && caller != address (0 ));
11
11
vm.expectRevert (Ownable.Unauthorized.selector );
12
12
reverse.setControllerApproval (caller, true );
13
- }
13
+ }
14
14
15
15
function test_allowsTheOwner_toUpdateControllerApproval (address newController ) public {
16
16
vm.assume (newController != address (0 ));
17
-
17
+
18
18
vm.expectEmit (address (reverse));
19
19
emit ReverseRegistrar.ControllerApprovalChanged (newController, true );
20
20
vm.prank (owner);
@@ -27,4 +27,4 @@ contract SetControllerApproval is ReverseRegistrarBase {
27
27
reverse.setControllerApproval (newController, false );
28
28
assertFalse (reverse.controllers (newController));
29
29
}
30
- }
30
+ }
You can’t perform that action at this time.
0 commit comments