Skip to content

Commit

Permalink
[audit2] #2 Typos and Documentation (#72)
Browse files Browse the repository at this point in the history
* Fix typo in PaymentReceiverUpdated

* Fix typo in L2Resolver commment

* Fix typos in L2Resolver and ReverseRegistrar natspec

* Fix comment in IPriceOracle

* Fix natspec in controllers
  • Loading branch information
stevieraykatz authored Jul 22, 2024
1 parent 62d33f2 commit 0aa3e00
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/L2/EARegistrarController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ contract EARegistrarController is Ownable {
/// @notice Emitted when the payment receiver is updated.
///
/// @param newPaymentReceiver The address of the new payment receiver.
event PayemntReceiverUpdated(address newPaymentReceiver);
event PaymentReceiverUpdated(address newPaymentReceiver);

/// @notice Emitted when the price oracle is updated.
///
Expand Down Expand Up @@ -323,13 +323,13 @@ contract EARegistrarController is Ownable {

/// @notice Allows the `owner` to set the reverse registrar contract.
///
/// @dev Emits `ReverseRegistrarUpdated` after setting the `paymentReceiver` address.
/// @dev Emits `PaymentReceiverUpdated` after setting the `paymentReceiver` address.
///
/// @param paymentReceiver_ The new payment receiver address.
function setPaymentReceiver(address paymentReceiver_) external onlyOwner {
if (paymentReceiver_ == address(0)) revert InvalidPaymentReceiver();
paymentReceiver = paymentReceiver_;
emit PayemntReceiverUpdated(paymentReceiver_);
emit PaymentReceiverUpdated(paymentReceiver_);
}

/// @notice Checks whether any of the provided addresses have registered with a discount.
Expand Down
4 changes: 2 additions & 2 deletions src/L2/L2Resolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract L2Resolver is
/// @notice The reverse registrar contract.
address public reverseRegistrar;

/// @notice A mapping of operators per owner address. An operator is authroized to make changes to
/// @notice A mapping of operators per owner address. An operator is authorized to make changes to
/// all names owned by the `owner`.
mapping(address owner => mapping(address operator => bool isApproved)) private _operatorApprovals;

Expand Down Expand Up @@ -173,7 +173,7 @@ contract L2Resolver is
return _tokenApprovals[owner][node][delegate];
}

/// @notice Check to see whether `msg.sender` is authroized to modify records for the specified `node`.
/// @notice Check to see whether `msg.sender` is authorized to modify records for the specified `node`.
///
/// @dev Override for `ResolverBase:isAuthorised()`. Used in the context of each inherited resolver "profile".
/// Validates that `msg.sender` is one of:
Expand Down
6 changes: 3 additions & 3 deletions src/L2/RegistrarController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ contract RegistrarController is Ownable {
/// @notice Emitted when the payment receiver is updated.
///
/// @param newPaymentReceiver The address of the new payment receiver.
event PayemntReceiverUpdated(address newPaymentReceiver);
event PaymentReceiverUpdated(address newPaymentReceiver);

/// @notice Emitted when the price oracle is updated.
///
Expand Down Expand Up @@ -333,13 +333,13 @@ contract RegistrarController is Ownable {

/// @notice Allows the `owner` to set the reverse registrar contract.
///
/// @dev Emits `ReverseRegistrarUpdated` after setting the `paymentReceiver` address.
/// @dev Emits `PaymentReceiverUpdated` after setting the `paymentReceiver` address.
///
/// @param paymentReceiver_ The new payment receiver address.
function setPaymentReceiver(address paymentReceiver_) external onlyOwner {
if (paymentReceiver_ == address(0)) revert InvalidPaymentReceiver();
paymentReceiver = paymentReceiver_;
emit PayemntReceiverUpdated(paymentReceiver_);
emit PaymentReceiverUpdated(paymentReceiver_);
}

/// @notice Checks whether any of the provided addresses have registered with a discount.
Expand Down
4 changes: 2 additions & 2 deletions src/L2/ReverseRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract ReverseRegistrar is Ownable {
/* ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

/// @notice Thrown when `sender` is not authrorized to modify records for `addr`.
/// @notice Thrown when `sender` is not authorized to modify records for `addr`.
///
/// @param addr The `addr` that was being modified.
/// @param sender The unauthorized sender.
Expand Down Expand Up @@ -201,7 +201,7 @@ contract ReverseRegistrar is Ownable {

/// @notice Sets the `name()` record for the reverse ENS records associated with the `addr` provided.
///
/// @dev Updates the resolver to a designated resolver. Only callable by `addr`'s `authroized` addresses.
/// @dev Updates the resolver to a designated resolver. Only callable by `addr`'s `authorized` addresses.
/// Establishes both a vestigial `addr.reverse` node and an ENSIP-19 compliant chain-specific `chain.reverse` node.
///
/// @param addr The reverse record to set.
Expand Down
2 changes: 1 addition & 1 deletion src/L2/interface/IPriceOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface IPriceOracle {
/**
* @dev Returns the price to register or renew a name.
* @param name The name being registered or renewed.
* @param expires When the name presently expires (0 if this is a new registration).
* @param expires When the name presently expires (`launchTime` if this is a new registration).
* @param duration How long the name is being registered or extended for, in seconds.
* @return price Price struct containing base price and premium price
*/
Expand Down
2 changes: 1 addition & 1 deletion test/EARegistrarController/SetPaymentReceiver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract SetPaymentReceiver is EARegistrarControllerBase {
function test_allowsTheOwner_toSetThePaymentReceiver(address newReceiver) public {
vm.assume(newReceiver != address(0));
vm.expectEmit(address(controller));
emit EARegistrarController.PayemntReceiverUpdated(newReceiver);
emit EARegistrarController.PaymentReceiverUpdated(newReceiver);
vm.prank(owner);
controller.setPaymentReceiver(newReceiver);
assertEq(newReceiver, controller.paymentReceiver());
Expand Down
2 changes: 1 addition & 1 deletion test/RegistrarController/SetPaymentReceiver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract SetPaymentReceiver is RegistrarControllerBase {
function test_allowsTheOwner_toSetThePaymentReceiver(address newReceiver) public {
vm.assume(newReceiver != address(0));
vm.expectEmit(address(controller));
emit RegistrarController.PayemntReceiverUpdated(newReceiver);
emit RegistrarController.PaymentReceiverUpdated(newReceiver);
vm.prank(owner);
controller.setPaymentReceiver(newReceiver);
assertEq(newReceiver, controller.paymentReceiver());
Expand Down

0 comments on commit 0aa3e00

Please sign in to comment.