Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: upgrade controller mainnet script and postcheck #281

Closed
Closed
Prev Previous commit
Next Next commit
fix(RONRegistrarController): remove duplicate check
TuDo1403 committed Oct 17, 2024
commit 4d6fa4f48ec50a0053ace3d9171ce8a3d963a7cf
7 changes: 3 additions & 4 deletions src/RONRegistrarController.sol
Original file line number Diff line number Diff line change
@@ -241,12 +241,11 @@ contract RONRegistrarController is

for (uint256 i; i < length; ++i) {
(, uint256 ronPrice) = rentPrice(names[i], durations[i]);
totalPrice += ronPrice;

// Require next id to be > previous id to prevent duplicate names
if (id >= (id = computeId(names[i]))) revert InvalidOrderOfNames();

totalPrice += ronPrice;
id = computeId(names[i]);
expiryTime = _rnsUnified.renew(id, durations[i]);

emit NameRenewed(names[i], id, ronPrice, expiryTime);
}

4 changes: 2 additions & 2 deletions src/interfaces/IRONRegistrarController.sol
Original file line number Diff line number Diff line change
@@ -181,9 +181,9 @@ interface IRONRegistrarController {
/**
* @dev Renew multiple names in a single transaction.
* Requirements:
* - `names` and `duration` arrays must have the same length.
* - `names` and `durations` arrays must have the same length.
* - The caller must provide enough value to cover the total renewal cost.
* - `names` must be sorted in ascending order.
* WARNING: The function does not check for duplicate names.
* @param names The array of names to be renewed.
* @param durations The array of durations for the renewal.
*/