@@ -4,6 +4,7 @@ pragma solidity ^0.8.19;
4
4
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol " ;
5
5
import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol " ;
6
6
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol " ;
7
+ import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol " ;
7
8
import { INSUnified, INSAuction } from "./interfaces/INSAuction.sol " ;
8
9
import { LibSafeRange } from "./libraries/math/LibSafeRange.sol " ;
9
10
import { LibRNSDomain } from "./libraries/LibRNSDomain.sol " ;
@@ -12,6 +13,7 @@ import { RONTransferHelper } from "./libraries/transfers/RONTransferHelper.sol";
12
13
13
14
contract RNSAuction is Initializable , AccessControlEnumerable , INSAuction {
14
15
using LibSafeRange for uint256 ;
16
+ using BitMaps for BitMaps.BitMap;
15
17
using LibEventRange for EventRange;
16
18
17
19
/// @inheritdoc INSAuction
@@ -37,6 +39,8 @@ contract RNSAuction is Initializable, AccessControlEnumerable, INSAuction {
37
39
address payable internal _treasury;
38
40
/// @dev The gap ratio between 2 bids with the starting price.
39
41
uint256 internal _bidGapRatio;
42
+ /// @dev Mapping from id => bool reserved status
43
+ BitMaps.BitMap internal _reserved;
40
44
41
45
modifier whenNotStarted (bytes32 auctionId ) {
42
46
_requireNotStarted (auctionId);
@@ -90,6 +94,7 @@ contract RNSAuction is Initializable, AccessControlEnumerable, INSAuction {
90
94
91
95
for (uint256 i; i < length;) {
92
96
(, ids[i]) = rnsUnified.mint (parentId, labels[i], address (0x0 ), address (this ), domainExpiryDuration);
97
+ _reserved.set (ids[i]);
93
98
94
99
unchecked {
95
100
++ i;
@@ -101,7 +106,7 @@ contract RNSAuction is Initializable, AccessControlEnumerable, INSAuction {
101
106
* @inheritdoc INSAuction
102
107
*/
103
108
function reserved (uint256 id ) public view returns (bool ) {
104
- return _rnsUnified. ownerOf (id) == address ( this );
109
+ return _reserved. get (id);
105
110
}
106
111
107
112
/**
0 commit comments