Skip to content

Commit

Permalink
chore(multi-treasury): merge from release/v0.3.5 (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 authored Jun 25, 2024
2 parents b95e559 + 4b70374 commit 56bb9c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/RONRegistrarController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ contract RONRegistrarController is
_setPriceOracle(priceOracle);
_setMinRegistrationDuration(minRegistrationDuration);
_setCommitmentAge(minCommitmentAge, maxCommitmentAge);
_setTreasury(treasury);

_treasury = treasury;
_rnsUnified = rnsUnified;
_nameChecker = nameChecker;
_reverseRegistrar = reverseRegistrar;
Expand Down Expand Up @@ -281,7 +281,7 @@ contract RONRegistrarController is
* @inheritdoc IRONRegistrarController
*/
function setTreasury(address payable addr) external onlyRole(DEFAULT_ADMIN_ROLE) {
_treasury = addr;
_setTreasury(addr);
}

/**
Expand Down Expand Up @@ -452,6 +452,19 @@ contract RONRegistrarController is
emit DomainPriceUpdated(_msgSender(), priceOracle);
}

/**
* @dev Helper method to update treasury address.
*
* Emits an event {TreasuryUpdated}.
*/
function _setTreasury(address payable addr) internal {
if (addr == address(0x0)) revert NullAddress();

_treasury = addr;

emit TreasuryUpdated(addr);
}

/**
* @dev Helper method to check if a domain name is available for register.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces/IRONRegistrarController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ interface IRONRegistrarController {
error ErrInvalidRegisterProtectedName(string name, address requestOwner, bool nameProtected, bool ownerWhitelisted);
/// @dev Thrown when received invalid array length
error InvalidArrayLength();
/// @dev Thrown when treasury address is set to null
error NullAddress();

/**
* @dev Emitted when the min registration duration is updated.
Expand All @@ -46,6 +48,9 @@ interface IRONRegistrarController {
*/
event MinRegistrationDurationUpdated(address indexed operator, uint256 duration);

/// @dev Emitted when the treasury is updated.
event TreasuryUpdated(address indexed addr);

/**
* @dev Emitted when RNSDomainPrice contract is updated.
* @param operator The address of the operator who triggered the update.
Expand Down

0 comments on commit 56bb9c2

Please sign in to comment.