BERA Price: $6.02 (-2.21%)

Contract

0x830Ad25C45072E1fCE2AF5d0028a2fbFb7F83a8E

Overview

BERA Balance

Berachain LogoBerachain LogoBerachain Logo0 BERA

BERA Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...9589432025-02-10 13:30:5638 days ago1739194256IN
0x830Ad25C...Fb7F83a8E
0 BERA0.000004290.15000001
Transfer Ownersh...8770082025-02-08 17:42:1740 days ago1739036537IN
0x830Ad25C...Fb7F83a8E
0 BERA00.00025683

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BeraAuctionHouse

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion, MIT license
File 1 of 43 : BeraAuctionHouse.sol
// SPDX-License-Identifier: GPL-3.0

/// @title The Bera names auction house

// LICENSE
// BeraAuctionHouse.sol is a modified version of Zora's AuctionHouse.sol:
// https://github.com/ourzora/auction-house/blob/54a12ec1a6cf562e49f0a4917990474b11350a2d/contracts/AuctionHouse.sol
//
// BeraAuctionHouse.sol source code Copyright Zora licensed under the GPL-3.0 license.
// With modifications by Beranames.
pragma solidity ^0.8.13;

import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {BaseRegistrar} from "src/registrar/types/BaseRegistrar.sol";

import {IWETH} from "src/auction/interfaces/IWETH.sol";

import {IBeraAuctionHouse} from "src/auction/interfaces/IBeraAuctionHouse.sol";

import {BeraDefaultResolver} from "src/resolver/Resolver.sol";

contract BeraAuctionHouse is IBeraAuctionHouse, Pausable, ReentrancyGuard, Ownable {
    /// @notice A hard-coded cap on time buffer to prevent accidental auction disabling if set with a very high value.
    uint56 public constant MAX_TIME_BUFFER = 1 days;

    /// @notice The Registrar Controller that the auction uses to mint the names
    BaseRegistrar public immutable base;

    /// @notice The resolver that the auction uses to resolve the names
    BeraDefaultResolver public immutable resolver;

    /// @notice The address of the WETH contract
    IWETH public immutable weth;

    /// @notice The auctionDuration of a single auction
    uint256 public immutable auctionDuration;
    uint256 public immutable registrationDuration;

    /// @notice the maximum number of auctions count to prevent excessive gas usage.
    uint256 public maxAuctionCount;

    /// @notice The minimum price accepted in an auction
    uint192 public reservePrice;

    /// @notice The minimum amount of time left in an auction after a new bid is created
    uint56 public timeBuffer;

    /// @notice The minimum percentage difference between the last bid amount and the current bid
    uint8 public minBidIncrementPercentage;

    /// @notice The active auction
    IBeraAuctionHouse.Auction public auctionStorage;

    /// @notice Past auction settlements
    mapping(uint256 => SettlementState) settlementHistory;

    /// @notice The address that will receive funds after closing the auction
    address public paymentReceiver;

    /// Constructor ------------------------------------------------------

    /// @notice Constructor for the auction house
    /// @param base_ The base registrar contract
    /// @param resolver_ The resolver contract
    /// @param weth_ The WETH contract
    /// @param auctionDuration_ The duration of the auction
    /// @param registrationDuration_ The duration of the registration
    /// @param reservePrice_ The reserve price of the auction
    /// @param timeBuffer_ The time buffer of the auction
    /// @param minBidIncrementPercentage_ The minimum bid increment percentage of the auction
    /// @param paymentReceiver_ The address that will receive funds after closing the auction
    constructor(
        BaseRegistrar base_,
        BeraDefaultResolver resolver_,
        IWETH weth_,
        uint256 auctionDuration_,
        uint256 registrationDuration_,
        uint192 reservePrice_,
        uint56 timeBuffer_,
        uint8 minBidIncrementPercentage_,
        address paymentReceiver_
    ) Ownable(msg.sender) {
        base = base_;
        resolver = resolver_;
        weth = weth_;
        auctionDuration = auctionDuration_;
        registrationDuration = registrationDuration_;
        paymentReceiver = paymentReceiver_;
        maxAuctionCount = 25;

        _pause();

        if (reservePrice_ == 0) revert InvalidReservePrice();
        if (minBidIncrementPercentage_ == 0) revert MinBidIncrementPercentageIsZero();
        if (timeBuffer_ > MAX_TIME_BUFFER) {
            revert TimeBufferTooLarge(timeBuffer_);
        }

        reservePrice = reservePrice_;
        timeBuffer = timeBuffer_;
        minBidIncrementPercentage = minBidIncrementPercentage_;
    }

    /**
     * @notice Settle the current auction, mint a new name, and put it up for auction.
     */
    function settleCurrentAndCreateNewAuction(string memory label_) external override whenNotPaused onlyOwner {
        _settleAuction();
        _createAuction(label_);
    }

    /**
     * @notice Settle the current auction.
     * @dev This function can only be called when the contract is paused.
     */
    function settleAuction() external override whenPaused onlyOwner nonReentrant {
        _settleAuction();
    }

    function setMaxAuctionCount(uint256 _maxAuctionCount) external whenNotPaused onlyOwner {
        if (_maxAuctionCount == 0) revert MaxAuctionCountIsZero();

        maxAuctionCount = _maxAuctionCount;

        emit MaxAuctionCountUpdated(maxAuctionCount);
    }

    /**
     * @notice Create a bid for a token, with a given amount.
     * @dev This contract only accepts payment in ETH.
     */
    function createBid(uint256 tokenId) external payable override whenNotPaused nonReentrant {
        IBeraAuctionHouse.Auction memory _auction = auctionStorage;

        (uint192 _reservePrice, uint56 _timeBuffer, uint8 _minBidIncrementPercentage) =
            (reservePrice, timeBuffer, minBidIncrementPercentage);

        if (_auction.tokenId != tokenId) {
            revert TokenNotForUpAuction(tokenId);
        }

        if (block.timestamp >= _auction.endTime) {
            revert AuctionExpired();
        }

        if (msg.value < _reservePrice) {
            revert MustSendAtLeastReservePrice();
        }

        if (msg.value < _auction.amount + ((_auction.amount * _minBidIncrementPercentage) / 100)) {
            revert MustSendMoreThanLastBidByMinBidIncrementPercentageAmount();
        }
        auctionStorage.amount = msg.value;
        auctionStorage.bidder = payable(msg.sender);

        // Extend the auction if the bid was received within `timeBuffer` of the auction end time
        bool extended = _auction.endTime - block.timestamp < _timeBuffer;

        emit AuctionBid(_auction.tokenId, msg.sender, msg.value, extended);

        if (extended) {
            auctionStorage.endTime = _auction.endTime = uint40(block.timestamp + _timeBuffer);
            emit AuctionExtended(_auction.tokenId, _auction.endTime);
        }

        address payable lastBidder = _auction.bidder;

        // Refund the last bidder, if applicable
        if (lastBidder != address(0)) {
            _safeTransferETHWithFallback(lastBidder, _auction.amount);
        }
    }

    /**
     * @notice Get the current auction.
     */
    function auction() external view returns (AuctionView memory) {
        return AuctionView({
            tokenId: auctionStorage.tokenId,
            amount: auctionStorage.amount,
            startTime: auctionStorage.startTime,
            endTime: auctionStorage.endTime,
            bidder: auctionStorage.bidder,
            settled: auctionStorage.settled
        });
    }

    /**
     * @notice Pause the auction house.
     * @dev This function can only be called by the owner when the
     * contract is unpaused. While no new auctions can be started when paused,
     * anyone can settle an ongoing auction.
     */
    function pause() external override onlyOwner {
        _pause();
    }

    /**
     * @notice Unpause the auction house.
     * @dev This function can only be called by the owner when the
     * contract is paused. If required, this function will start a new auction.
     */
    function unpause(string memory label_) external override onlyOwner {
        _unpause();

        if (auctionStorage.startTime == 0 || auctionStorage.settled) {
            _createAuction(label_);
        }
    }

    /**
     * @notice Set the auction time buffer.
     * @dev Only callable by the owner.
     */
    function setTimeBuffer(uint56 _timeBuffer) external override onlyOwner {
        if (_timeBuffer > MAX_TIME_BUFFER) {
            revert TimeBufferTooLarge(_timeBuffer);
        }

        timeBuffer = _timeBuffer;

        emit AuctionTimeBufferUpdated(_timeBuffer);
    }

    /**
     * @notice Set the auction reserve price.
     * @dev Only callable by the owner.
     */
    function setReservePrice(uint192 _reservePrice) external override onlyOwner {
        if (_reservePrice == 0) {
            revert InvalidReservePrice();
        }
        reservePrice = _reservePrice;

        emit AuctionReservePriceUpdated(_reservePrice);
    }

    /**
     * @notice Set the auction minimum bid increment percentage.
     * @dev Only callable by the owner.
     */
    function setMinBidIncrementPercentage(uint8 _minBidIncrementPercentage) external override onlyOwner {
        if (_minBidIncrementPercentage == 0) {
            revert MinBidIncrementPercentageIsZero();
        }

        minBidIncrementPercentage = _minBidIncrementPercentage;

        emit AuctionMinBidIncrementPercentageUpdated(_minBidIncrementPercentage);
    }

    /// @notice Allows the `owner` to set the reverse registrar contract.
    ///
    /// @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 PaymentReceiverUpdated(paymentReceiver_);
    }

    /**
     * @notice Create an auction.
     * @dev Store the auction details in the `auction` state variable and emit an AuctionCreated event.
     * If the mint reverts, the minter was updated without pausing this contract first. To remedy this,
     * catch the revert and pause this contract.
     */
    function _createAuction(string memory label_) internal {
        uint256 id = uint256(keccak256(abi.encodePacked(label_)));
        try base.registerWithRecord(id, address(this), registrationDuration, address(resolver), 0) returns (uint256) {
            uint40 startTime = uint40(block.timestamp);
            uint40 endTime = startTime + uint40(auctionDuration);

            auctionStorage = Auction({
                tokenId: id,
                amount: 0,
                startTime: startTime,
                endTime: endTime,
                bidder: payable(0),
                settled: false
            });

            emit AuctionCreated(id, startTime, endTime);
        } catch Error(string memory reason) {
            _pause();
            emit AuctionCreationError(reason);
        }
    }

    /**
     * @notice Settle an auction, finalizing the bid and paying out to the owner.
     * @dev If there are no bids, the tokenId is burned.
     */
    function _settleAuction() internal {
        if (base.balanceOf(address(this)) == 0) revert NoAuctions();

        IBeraAuctionHouse.Auction memory _auction = auctionStorage;

        if (_auction.startTime == 0) {
            revert AuctionNotBegun();
        }
        if (_auction.settled) {
            revert AuctionAlreadySettled();
        }
        if (block.timestamp < _auction.endTime) {
            revert AuctionNotCompleted();
        }

        auctionStorage.settled = true;

        if (_auction.bidder == address(0)) {
            base.transferFrom(address(this), address(0xdead), _auction.tokenId);
        } else {
            base.transferFrom(address(this), _auction.bidder, _auction.tokenId);
        }

        if (_auction.amount > 0 && paymentReceiver != address(0)) {
            _safeTransferETHWithFallback(paymentReceiver, _auction.amount);
        }

        SettlementState storage settlementState = settlementHistory[_auction.tokenId];
        settlementState.blockTimestamp = uint32(block.timestamp);
        settlementState.amount = ethPriceToUint64(_auction.amount);
        settlementState.winner = _auction.bidder;

        emit AuctionSettled(_auction.tokenId, _auction.bidder, _auction.amount);
    }

    /**
     * @notice Transfer ETH. If the ETH transfer fails, wrap the ETH and try send it as WETH.
     */
    function _safeTransferETHWithFallback(address to, uint256 amount) internal {
        if (!_safeTransferETH(to, amount)) {
            weth.deposit{value: amount}();
            weth.transfer(to, amount);
        }
    }

    /**
     * @notice Transfer ETH and return the success status.
     * @dev This function only forwards 30,000 gas to the callee.
     */
    function _safeTransferETH(address to, uint256 value) internal returns (bool) {
        bool success;
        assembly {
            success := call(30000, to, value, 0, 0, 0, 0)
        }
        return success;
    }

    /**
     * @notice Get past auction settlements.
     * @dev Returns up to `auctionCount` settlements in reverse order, meaning settlements[0] will be the most recent auction price.
     * Includes auctions with no bids (blockTimestamp will be > 1)
     * @param auctionCount The number of price observations to get.
     * @return settlements An array of type `Settlement`, where each Settlement includes a timestamp,
     * the tokenId of that auction, the winning bid amount, and the winner's address.
     */
    function getSettlements(uint256 auctionCount) external view returns (Settlement[] memory settlements) {
        if (auctionCount > maxAuctionCount) revert MaxAuctionCountExceeded(auctionCount);

        uint256 latestTokenId = auctionStorage.tokenId;
        if (latestTokenId == 0) revert NoAuctions();

        if (!auctionStorage.settled && latestTokenId > 0) {
            latestTokenId -= 1;
        }

        // First pass: Count valid settlements
        uint256 validCount = 0;
        for (uint256 id = latestTokenId; validCount < auctionCount; --id) {
            SettlementState memory settlementState = settlementHistory[id];
            if (
                settlementState.blockTimestamp > 0 && settlementState.amount > 0 && settlementState.winner != address(0)
            ) {
                validCount++;
            }
            if (id == 0) break;
        }

        // Allocate array with exact size needed
        settlements = new Settlement[](validCount);

        // Second pass: Populate array
        uint256 index = 0;
        for (uint256 id = latestTokenId; index < validCount; --id) {
            SettlementState memory settlementState = settlementHistory[id];
            if (
                settlementState.blockTimestamp > 0 && settlementState.amount > 0 && settlementState.winner != address(0)
            ) {
                settlements[index] = Settlement({
                    blockTimestamp: settlementState.blockTimestamp,
                    amount: uint64PriceToUint256(settlementState.amount),
                    winner: settlementState.winner,
                    tokenId: id
                });
                index++;
            }
            if (id == 0) break;
        }
    }

    /**
     * @notice Get past auction prices.
     * @dev Returns prices in reverse order, meaning prices[0] will be the most recent auction price.
     * Skips auctions where there was no winner, i.e. no bids.
     * Reverts if getting a empty data for an auction that happened, e.g. historic data not filled
     * Reverts if there's not enough auction data, i.e. reached token id 0
     * @param auctionCount The number of price observations to get.
     * @return prices An array of uint256 prices.
     */
    function getPrices(uint256 auctionCount) external view returns (uint256[] memory prices) {
        uint256 latestTokenId = auctionStorage.tokenId;
        if (latestTokenId == 0) revert NoAuctions();

        if (!auctionStorage.settled && latestTokenId > 0) {
            latestTokenId -= 1;
        }

        prices = new uint256[](auctionCount);
        uint256 actualCount = 0;

        SettlementState memory settlementState;
        for (uint256 id = latestTokenId; id > 0 && actualCount < auctionCount; --id) {
            settlementState = settlementHistory[id];

            // Skip auctions with no bids
            if (
                settlementState.blockTimestamp == 0 || settlementState.winner == address(0)
                    || settlementState.amount == 0
            ) {
                continue;
            }

            prices[actualCount] = uint64PriceToUint256(settlementState.amount);
            ++actualCount;
        }

        if (auctionCount != actualCount) {
            revert NotEnoughHistory();
        }
    }

    /**
     * @notice Get all past auction settlements starting at `startId` and settled before or at `endTimestamp`.
     * @param startId the first tokenId to get prices for.
     * @param endTimestamp the latest timestamp for auctions
     * @return settlements An array of type `Settlement`, where each Settlement includes a timestamp,
     * the tokenId of that auction, the winning bid amount, and the winner's address.
     */
    function getSettlementsFromIdtoTimestamp(uint256 startId, uint256 endTimestamp)
        public
        view
        returns (Settlement[] memory settlements)
    {
        if (startId > maxAuctionCount) revert MaxAuctionCountExceeded(startId);

        uint256 maxId = auctionStorage.tokenId;
        if (startId > maxId) revert StartIdTooLarge(startId);

        // First pass: Count valid settlements
        uint256 validCount = 0;
        for (uint256 id = startId; id <= maxId; ++id) {
            SettlementState memory settlementState = settlementHistory[id];

            if (id == maxId && settlementState.blockTimestamp <= 1 && settlementState.winner == address(0)) {
                continue;
            }

            if (settlementState.blockTimestamp > endTimestamp) break;
            validCount++;
        }

        // Allocate array with exact size needed
        settlements = new Settlement[](validCount);

        // Second pass: Populate array
        uint256 index = 0;
        for (uint256 id = startId; id <= maxId && index < validCount; ++id) {
            SettlementState memory settlementState = settlementHistory[id];

            if (id == maxId && settlementState.blockTimestamp <= 1 && settlementState.winner == address(0)) {
                continue;
            }

            if (settlementState.blockTimestamp > endTimestamp) break;

            settlements[index] = Settlement({
                blockTimestamp: settlementState.blockTimestamp,
                amount: uint64PriceToUint256(settlementState.amount),
                winner: settlementState.winner,
                tokenId: id
            });
            index++;
        }
    }

    /**
     * @notice Get a range of past auction settlements.
     * @dev Returns prices in chronological order, as opposed to `getSettlements(count)` which returns prices in reverse order.
     * Includes auctions with no bids (blockTimestamp will be > 1)
     * @param startId the first tokenId to get prices for.
     * @param endId end tokenId (up to, but not including).
     * @return settlements An array of type `Settlement`, where each Settlement includes a timestamp,
     * the tokenId of that auction, the winning bid amount, and the winner's address.
     */
    function getSettlements(uint256 startId, uint256 endId) external view returns (Settlement[] memory settlements) {
        if (startId > maxAuctionCount) revert MaxAuctionCountExceeded(startId);
        if (startId > endId || startId == 0 || endId == 0) revert InvalidRange();

        // First pass: Count valid settlements
        uint256 validCount = 0;
        for (uint256 id = startId; id < endId; ++id) {
            SettlementState memory settlementState = settlementHistory[id];
            if (
                settlementState.blockTimestamp > 0 && settlementState.amount > 0 && settlementState.winner != address(0)
            ) {
                validCount++;
            }
        }

        // Allocate array with exact size needed
        settlements = new Settlement[](validCount);

        // Second pass: Populate array
        uint256 index = 0;
        for (uint256 id = startId; id < endId; ++id) {
            SettlementState memory settlementState = settlementHistory[id];
            if (
                settlementState.blockTimestamp > 0 && settlementState.amount > 0 && settlementState.winner != address(0)
            ) {
                settlements[index] = Settlement({
                    blockTimestamp: settlementState.blockTimestamp,
                    amount: uint64PriceToUint256(settlementState.amount),
                    winner: settlementState.winner,
                    tokenId: id
                });
                index++;
            }
        }
    }

    /**
     * @dev Convert an ETH price of 256 bits with 18 decimals, to 64 bits with 10 decimals.
     * Max supported value is 1844674407.3709551615 ETH.
     */
    function ethPriceToUint64(uint256 ethPrice) internal pure returns (uint64) {
        uint256 scaled = ethPrice / 1e8;
        if (scaled > type(uint64).max) revert PriceExceedsUint64Range(ethPrice);

        return uint64(scaled);
    }

    /**
     * @dev Convert a 64 bit 10 decimal price to a 256 bit 18 decimal price.
     */
    function uint64PriceToUint256(uint64 price) internal pure returns (uint256) {
        return uint256(price) * 1e8;
    }
}

File 2 of 43 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 3 of 43 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 4 of 43 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 43 : BaseRegistrar.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";

import {BNS} from "src/registry/interfaces/BNS.sol";

import {GRACE_PERIOD, RECLAIM_ID} from "src/utils/Constants.sol";

/// @title Base Registrar
contract BaseRegistrar is ERC721, Ownable {
    using Strings for uint256;

    /// Errors -----------------------------------------------------------

    /// @notice Thrown when the name has expired.
    ///
    /// @param tokenId The id of the token that expired.
    error Expired(uint256 tokenId);

    /// @notice Thrown when called by an unauthorized owner.
    ///
    /// @param tokenId The id that was being called against.
    /// @param sender The unauthorized sender.
    error NotApprovedOwner(uint256 tokenId, address sender);

    /// @notice Thrown when the name is not available for registration.
    ///
    /// @param tokenId The id of the name that is not available.
    error NotAvailable(uint256 tokenId);

    /// @notice Thrown when the queried tokenId does not exist.
    ///
    /// @param tokenId The id of the name that does not exist.
    error NonexistentToken(uint256 tokenId);

    /// @notice Thrown when the name is not registered or in its Grace Period.
    ///
    /// @param tokenId The id of the token that is not registered or in Grace Period.
    error NotRegisteredOrInGrace(uint256 tokenId);

    /// @notice Thrown when msg.sender is not an approved Controller.
    error OnlyController();

    /// @notice Thrown when this contract does not own the `baseNode`.
    error RegistrarNotLive();

    /// Events -----------------------------------------------------------

    /// @notice Emitted when a Controller is added to the approved `controllers` mapping.
    ///
    /// @param controller The address of the approved controller.
    event ControllerAdded(address indexed controller);

    /// @notice Emitted when a Controller is removed from the approved `controllers` mapping.
    ///
    /// @param controller The address of the removed controller.
    event ControllerRemoved(address indexed controller);

    /// @notice Emitted when a name is registered.
    ///
    /// @param id The id of the registered name.
    /// @param owner The owner of the registered name.
    /// @param expires The expiry of the new ownership record.
    event NameRegistered(uint256 indexed id, address indexed owner, uint256 expires);

    /// @notice Emitted when a name is renewed.
    ///
    /// @param id The id of the renewed name.
    /// @param expires The new expiry for the name.
    event NameRenewed(uint256 indexed id, uint256 expires);

    /// @notice Emitted when a name is registered with BNS Records.
    ///
    /// @param id The id of the newly registered name.
    /// @param owner The owner of the registered name.
    /// @param expires The expiry of the new ownership record.
    /// @param resolver The address of the resolver for the name.
    /// @param ttl The time-to-live for the name.
    event NameRegisteredWithRecord(
        uint256 indexed id, address indexed owner, uint256 expires, address resolver, uint64 ttl
    );

    /// @notice Emitted when metadata for a token range is updated.
    ///
    /// @dev Useful for third-party platforms such as NFT marketplaces who can update
    ///     the images and related attributes of the NFTs in a timely fashion.
    ///     To refresh a whole collection, emit `_toTokenId` with `type(uint256).max`
    ///     ERC-4906: https://eip.tools/eip/4906
    ///
    /// @param _fromTokenId The starting range of `tokenId` for which metadata has been updated.
    /// @param _toTokenId The ending range of `tokenId` for which metadata has been updated.
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

    /// @notice Emitted when the metadata for the contract collection is updated.
    ///
    /// @dev ERC-7572: https://eips.ethereum.org/EIPS/eip-7572
    event ContractURIUpdated();

    /// Storage ----------------------------------------------------------

    /// @notice The Registry contract.
    BNS public immutable registry;

    /// @notice A map of expiry times to node.
    mapping(bytes32 node => uint256 expiry) public nameExpires;

    /// @notice The namehash of the TLD this registrar owns (eg, .bera).
    bytes32 public immutable baseNode;

    /// @notice The base URI for token metadata.
    string private _tokenURI;

    /// @notice The URI for collection metadata.
    string private _collectionURI;

    /// @notice A map of addresses that are authorised to register and renew names.
    mapping(address controller => bool isApproved) public controllers;

    /// Modifiers --------------------------------------------------------

    /// @notice Decorator for determining if the contract is actively managing registrations for its `baseNode`.
    modifier live() {
        if (registry.owner(baseNode) != address(this)) {
            revert RegistrarNotLive();
        }
        _;
    }

    /// @notice Decorator for restricting methods to only approved Controller callers.
    modifier onlyController() {
        if (!controllers[msg.sender]) revert OnlyController();
        _;
    }

    /// @notice Decorator for determining if a name is available.
    ///
    /// @param id The id being checked for availability.
    modifier onlyAvailable(uint256 id) {
        if (!isAvailable(id)) revert NotAvailable(id);
        _;
    }

    /// @notice Decorator for determining if a name has expired.
    ///
    /// @param id The id being checked for expiry.
    modifier onlyNonExpired(uint256 id) {
        if (nameExpires[bytes32(id)] <= block.timestamp) revert Expired(id);
        _;
    }

    /// Constructor ------------------------------------------------------

    /// @notice BaseRegistrar constructor used to initialize the configuration of the implementation.
    ///
    /// @param registry_ The Registry contract.
    /// @param owner_ The permissioned address initialized as the `owner` in the `Ownable` context.
    /// @param baseNode_ The node that this contract manages registrations for.
    /// @param tokenURI_ The base token URI for NFT metadata.
    /// @param collectionURI_ The URI for the collection's metadata.
    constructor(BNS registry_, address owner_, bytes32 baseNode_, string memory tokenURI_, string memory collectionURI_)
        ERC721("Beranames", unicode"🐻🪪")
        Ownable(owner_)
    {
        _transferOwnership(owner_);
        registry = registry_;
        baseNode = baseNode_;
        _tokenURI = tokenURI_;
        _collectionURI = collectionURI_;
    }

    /// Admin Functions --------------------------------------------------

    /// @notice Authorises a controller, who can register and renew domains.
    /// @dev Emits `ControllerAdded(controller)` after adding the `controller` to the `controllers` mapping.
    /// @param controller The address of the new controller.
    function addController(address controller) external onlyOwner {
        controllers[controller] = true;
        emit ControllerAdded(controller);
    }

    /// @notice Revoke controller permission for an address.
    /// @dev Emits `ControllerRemoved(controller)` after removing the `controller` from the `controllers` mapping.
    /// @param controller The address of the controller to remove.
    function removeController(address controller) external onlyOwner {
        controllers[controller] = false;
        emit ControllerRemoved(controller);
    }

    /// @notice Set the resolver for the node this registrar manages.
    /// @param resolver The address of the new resolver contract.
    function setResolver(address resolver) external onlyOwner {
        registry.setResolver(baseNode, resolver);
    }

    /// @notice Register a name and add details to the record in the Registry.
    /// @param id The token id determined by keccak256(label).
    /// @param owner The address that should own the registration.
    /// @param duration Duration in seconds for the registration.
    /// @param resolver Address of the resolver for the name.
    /// @param ttl Time-to-live for the name.
    function registerWithRecord(uint256 id, address owner, uint256 duration, address resolver, uint64 ttl)
        external
        live
        onlyController
        onlyAvailable(id)
        returns (uint256)
    {
        uint256 expiry = _localRegister(id, owner, duration);
        registry.setSubnodeRecord(baseNode, bytes32(id), owner, resolver, ttl);
        emit NameRegisteredWithRecord(id, owner, expiry, resolver, ttl);
        return expiry;
    }

    /// @notice Gets the owner of the specified token ID.
    /// @dev Names become unowned when their registration expires.
    /// @param tokenId The id of the name to query the owner of.
    /// @return address The address currently marked as the owner of the given token ID.
    function ownerOf(uint256 tokenId) public view override onlyNonExpired(tokenId) returns (address) {
        return super.ownerOf(tokenId);
    }

    /// @notice Returns true if the specified name is available for registration.
    /// @param id The id of the name to check availability of.
    /// @return `true` if the name is available, else `false`.
    function isAvailable(uint256 id) public view returns (bool) {
        // Not available if it's registered here or in its grace period.
        return nameExpires[bytes32(id)] + GRACE_PERIOD < block.timestamp;
    }

    /// @notice Allows holders of names to renew their ownerhsip and extend their expiry.
    /// @param id The id of the name to renew.
    /// @param duration The time that will be added to this name's expiry.
    /// @return The new expiry date.
    function renew(uint256 id, uint256 duration) external live onlyController returns (uint256) {
        uint256 expires = nameExpires[bytes32(id)];
        if (expires + GRACE_PERIOD < block.timestamp) {
            revert NotRegisteredOrInGrace(id);
        }

        expires += duration;
        nameExpires[bytes32(id)] = expires;
        emit NameRenewed(id, expires);
        return expires;
    }

    /// @notice ERC165 compliant signal for interface support.
    /// @param interfaceID the ERC165 iface id being checked for compliance
    /// @return bool Whether this contract supports the provided interfaceID
    function supportsInterface(bytes4 interfaceID) public pure override(ERC721) returns (bool) {
        return interfaceID == type(IERC165).interfaceId || interfaceID == type(IERC721).interfaceId
            || interfaceID == RECLAIM_ID;
    }

    /// ERC721 Implementation --------------------------------------------

    /// @notice Returns the Uniform Resource Identifier (URI) for token `id`.
    /// @dev Reverts if the `tokenId` has not be registered.
    /// @param tokenId The token for which to return the metadata uri.
    /// @return The URI for the specified `tokenId`.
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        if (_ownerOf(tokenId) == address(0)) revert NonexistentToken(tokenId);

        return bytes(_tokenURI).length > 0 ? string.concat(_tokenURI, tokenId.toString()) : "";
    }

    /// @notice Returns the Uniform Resource Identifier (URI) for the contract.
    /// @dev ERC-7572: https://eips.ethereum.org/EIPS/eip-7572
    function contractURI() public view returns (string memory) {
        return _collectionURI;
    }

    /// @dev Allows the owner to set the the base Uniform Resource Identifier (URI)`.
    ///     Emits the `BatchMetadataUpdate` event for the full range of valid `tokenIds`.
    function setTokenURI(string memory baseURI_) public onlyOwner {
        _tokenURI = baseURI_;
        /// @dev minimum valid tokenId is `1` because uint256(nodehash) will never be called against `nodehash == 0x0`.
        emit BatchMetadataUpdate(1, type(uint256).max);
    }

    /// @dev Allows the owner to set the the contract Uniform Resource Identifier (URI)`.
    ///     Emits the `ContractURIUpdated` event.
    function setContractURI(string memory collectionURI_) public onlyOwner {
        _collectionURI = collectionURI_;
        emit ContractURIUpdated();
    }

    /// @notice transferFrom is overridden to handle the registry update.
    function transferFrom(address from, address to, uint256 tokenId) public override {
        super.transferFrom(from, to, tokenId);
        registry.setSubnodeOwner(baseNode, bytes32(tokenId), to);
    }

    /// Internal Methods -------------------------------------------------

    /// @notice Register a name and possibly update the Registry.
    /// @param id The token id determined by keccak256(label).
    /// @param owner The address that should own the registration.
    /// @param duration Duration in seconds for the registration.
    /// @param updateRegistry Whether to update the Regstiry with the ownership change
    ///
    /// @return The expiry date of the registered name.
    function _register(uint256 id, address owner, uint256 duration, bool updateRegistry)
        internal
        live
        onlyController
        onlyAvailable(id)
        returns (uint256)
    {
        uint256 expiry = _localRegister(id, owner, duration);
        if (updateRegistry) {
            registry.setSubnodeOwner(baseNode, bytes32(id), owner);
        }
        emit NameRegistered(id, owner, expiry);
        return expiry;
    }

    /// @notice Internal handler for local state changes during registrations.
    /// @dev Sets the token's expiry time and then `burn`s and `mint`s a new token.
    /// @param id The token id determined by keccak256(label).
    /// @param owner The address that should own the registration.
    /// @param duration Duration in seconds for the registration.
    ///
    /// @return expiry The expiry date of the registered name.
    function _localRegister(uint256 id, address owner, uint256 duration) internal returns (uint256 expiry) {
        expiry = block.timestamp + duration;
        nameExpires[bytes32(id)] = expiry;
        if (_ownerOf(id) != address(0)) {
            // Name was previously owned, and expired
            _burn(id);
        }
        _mint(owner, id);
    }

    /// @notice Returns whether the given spender can transfer a given token ID.
    /// @param spender address of the spender to query
    /// @param tokenId uint256 ID of the token to be transferred
    /// @return `true` if msg.sender is approved for the given token ID, is an operator of the owner,
    ///         or is the owner of the token, else `false`.
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        onlyNonExpired(tokenId)
        returns (bool)
    {
        address owner_ = _ownerOf(tokenId);
        return owner_ == spender || _isAuthorized(owner_, spender, tokenId);
    }
}

File 6 of 43 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 wad) external;

    function transfer(address to, uint256 value) external returns (bool);
}

File 7 of 43 : IBeraAuctionHouse.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;

/// @title Interface for Bera Names Auction House
interface IBeraAuctionHouse {
    /// Errors -----------------------------------------------------------
    /// @notice Thrown when the token is not up for auction.
    /// @param tokenId The token ID that is not up for auction.
    error TokenNotForUpAuction(uint256 tokenId);

    /// @notice Thrown when the auction has expired.
    error AuctionExpired();

    /// @notice Thrown when the bid is less than the reserve price.
    error MustSendAtLeastReservePrice();

    /// @notice Thrown when the bid is less than the minimum bid increment percentage amount.
    error MustSendMoreThanLastBidByMinBidIncrementPercentageAmount();

    /// @notice Thrown when the time buffer is too large.
    error TimeBufferTooLarge(uint256 timeBuffer);

    /// @notice Thrown when the min bid increment percentage is zero.
    error MinBidIncrementPercentageIsZero();

    /// @notice Thrown when the auction has not begun.
    error AuctionNotBegun();

    /// @notice Thrown when the auction has already been settled.
    error AuctionAlreadySettled();

    /// @notice Thrown when the auction has not completed.
    error AuctionNotCompleted();

    /// @notice Thrown when there is missing data.
    error MissingSettlementsData();

    /// @notice Thrown when there is not enough history.
    error NotEnoughHistory();

    /// @notice Thrown when there are no auctions.
    error NoAuctions();

    /// @notice Thrown when the provided range is invalid.
    error InvalidRange();

    /// @notice Thrown when the start ID is too large.
    error StartIdTooLarge(uint256 startId);

    /// @notice Thrown when the payment receiver is being set to address(0).
    error InvalidPaymentReceiver();

    /// @notice Thrown when the reserve price is being set to 0.
    error InvalidReservePrice();

    /// @notice Thrown when the max auction count is being set to 0.
    error MaxAuctionCountIsZero();

    /// @notice Thrown when the max auction count is exceeded.
    error MaxAuctionCountExceeded(uint256 auctionCount);

    /// @notice Thrown when the price exceeds the uint64 range.
    error PriceExceedsUint64Range(uint256 price);

    struct Auction {
        uint256 tokenId;
        uint256 amount;
        uint64 startTime;
        uint64 endTime;
        // The address of the current highest bid
        address payable bidder;
        // Whether or not the auction has been settled
        bool settled;
    }

    /// @dev We use this struct as the return value of the `auction` function, to maintain backwards compatibility.
    /// @param labelHash The labelHash for the name (max X characters)
    /// @param amount The current highest bid amount
    /// @param startTime The auction period start time
    /// @param endTime The auction period end time
    /// @param bidder The address of the current highest bid
    /// @param settled Whether or not the auction has been settled
    struct AuctionView {
        // Slug 1
        uint256 tokenId;
        // Slug 2
        uint256 amount;
        uint64 startTime;
        uint64 endTime;
        // Slug 3
        address payable bidder;
        bool settled;
    }

    /// @param blockTimestamp The block.timestamp when the auction was settled.
    /// @param amount The winning bid amount, with 10 decimal places (reducing accuracy to save bits).
    /// @param winner The address of the auction winner.
    struct SettlementState {
        uint32 blockTimestamp;
        uint64 amount;
        address winner;
    }

    /// @param blockTimestamp The block.timestamp when the auction was settled.
    /// @param amount The winning bid amount, converted from 10 decimal places to 18, for better client UX.
    /// @param winner The address of the auction winner.
    /// @param tokenId ID for the label (label hash).
    struct Settlement {
        uint32 blockTimestamp;
        uint256 amount;
        address winner;
        uint256 tokenId;
    }

    event AuctionCreated(uint256 indexed tokenId, uint256 startTime, uint256 endTime);

    event AuctionBid(uint256 indexed tokenId, address sender, uint256 value, bool extended);

    event AuctionExtended(uint256 indexed tokenId, uint256 endTime);

    event AuctionSettled(uint256 indexed tokenId, address winner, uint256 amount);

    event AuctionTimeBufferUpdated(uint256 timeBuffer);

    event AuctionReservePriceUpdated(uint256 reservePrice);

    event AuctionMinBidIncrementPercentageUpdated(uint256 minBidIncrementPercentage);

    event AuctionCreationError(string reason);

    event MaxAuctionCountUpdated(uint256 maxAuctionCount);

    /// @notice Emitted when the payment receiver is updated.
    ///
    /// @param newPaymentReceiver The address of the new payment receiver.
    event PaymentReceiverUpdated(address newPaymentReceiver);

    function settleAuction() external;

    function settleCurrentAndCreateNewAuction(string memory label_) external;

    function createBid(uint256 tokenId) external payable;

    // Management functions

    function pause() external;
    function unpause(string memory label_) external;

    function setTimeBuffer(uint56 timeBuffer) external;
    function setReservePrice(uint192 reservePrice) external;
    function setMinBidIncrementPercentage(uint8 minBidIncrementPercentage) external;

    function auction() external view returns (AuctionView memory);

    function getSettlements(uint256 auctionCount) external view returns (Settlement[] memory settlements);

    function getPrices(uint256 auctionCount) external view returns (uint256[] memory prices);

    function getSettlements(uint256 startId, uint256 endId) external view returns (Settlement[] memory settlements);

    function getSettlementsFromIdtoTimestamp(uint256 startId, uint256 endTimestamp)
        external
        view
        returns (Settlement[] memory settlements);

    function auctionDuration() external view returns (uint256);
    function registrationDuration() external view returns (uint256);
}

File 8 of 43 : Resolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

// Admin Controller
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

// Bera Name Service
import {BNS} from "src/registry/interfaces/BNS.sol";

// Interfaces
import {IExtendedResolver} from "src/resolver/interfaces/IExtendedResolver.sol";
import {IReverseRegistrar} from "src/registrar/interfaces/IReverseRegistrar.sol";

// Resolver Profiles
import {ABIResolver} from "src/resolver/profiles/ABIResolver.sol";
import {AddrResolver} from "src/resolver/profiles/AddrResolver.sol";
import {ContentHashResolver} from "src/resolver/profiles/ContentHashResolver.sol";
// import {DNSResolver} from "src/resolver/profiles/DNSResolver.sol";
import {ExtendedResolver} from "src/resolver/profiles/ExtendedResolver.sol";
import {InterfaceResolver} from "src/resolver/profiles/InterfaceResolver.sol";
import {Multicallable} from "src/resolver/types/Multicallable.sol";
import {NameResolver} from "src/resolver/profiles/NameResolver.sol";
import {PubkeyResolver} from "src/resolver/profiles/PubkeyResolver.sol";
import {TextResolver} from "src/resolver/profiles/TextResolver.sol";

/// @title BeraResolver
contract BeraDefaultResolver is
    // Accessability Controller
    Multicallable,
    // Resolvers
    ABIResolver,
    AddrResolver,
    ContentHashResolver,
    // DNSResolver,
    InterfaceResolver,
    NameResolver,
    PubkeyResolver,
    TextResolver,
    ExtendedResolver,
    // Admin Controller
    Ownable
{
    /// Errors -----------------------------------------------------------

    /// @notice Thown when msg.sender tries to set itself as an operator/delegate.
    error CantSetSelf();

    /// @notice Thown when the registrar controller is not set.
    error InvalidRegistrarController();

    /// @notice Thown when the reverse registrar is not set.
    error InvalidReverseRegistrar();

    /// @notice Thown when the caller is not the owner of the node.
    error NotOwner();

    /// Storage ----------------------------------------------------------

    /// @notice The BNS registry.
    BNS public immutable bns;

    /// @notice The trusted registrar controller contract.
    address public registrarController;

    /// @notice The reverse registrar contract.
    address public reverseRegistrar;

    /// @notice A mapping of account operators: can control owner's nodes.
    mapping(address owner => mapping(address operator => bool isApproved)) private _operatorApprovals;

    /// @notice A mapping node operators: can control a specific node.
    mapping(address owner => mapping(bytes32 node => mapping(address delegate => bool isApproved))) private
        _tokenApprovals;

    /// Events -----------------------------------------------------------

    /// @notice Emitted when an operator is added or removed.
    ///
    /// @param owner The address of the owner of names.
    /// @param operator The address of the approved operator for the `owner`.
    /// @param approved Whether the `operator` is approved or not.
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /// @notice Emitted when a delegate is approved or an approval is revoked.
    ///
    /// @param owner The address of the owner of the name.
    /// @param node The namehash of the name.
    /// @param delegate The address of the operator for the specified `node`.
    /// @param approved Whether the `delegate` is approved for the specified `node`.
    event Approved(address owner, bytes32 indexed node, address indexed delegate, bool indexed approved);

    /// @notice Emitted when the owner of this contract updates the Registrar Controller addrress.
    ///
    /// @param newRegistrarController The address of the new RegistrarController contract.
    event RegistrarControllerUpdated(address indexed newRegistrarController);

    /// @notice Emitted when the owner of this contract updates the Reverse Registrar address.
    ///
    /// @param newReverseRegistrar The address of the new ReverseRegistrar contract.
    event ReverseRegistrarUpdated(address indexed newReverseRegistrar);

    /// Constructor ------------------------------------------------------

    /// @notice L2 Resolver constructor used to establish the necessary contract configuration.
    ///
    /// @param bns_ The Registry contract.
    /// @param registrarController_ The address of the RegistrarController contract.
    /// @param reverseRegistrar_ The address of the ReverseRegistrar contract.
    /// @param owner_  The permissioned address initialized as the `owner` in the `Ownable` context.
    constructor(BNS bns_, address registrarController_, address reverseRegistrar_, address owner_) Ownable(owner_) {
        // Set state
        bns = bns_;

        if (registrarController_ == address(0)) revert InvalidRegistrarController();
        if (reverseRegistrar_ == address(0)) revert InvalidReverseRegistrar();

        registrarController = registrarController_;
        reverseRegistrar = reverseRegistrar_;

        // Initialize reverse registrar
        IReverseRegistrar(reverseRegistrar_).claim(owner_);
    }

    /// Authorisation Functions -----------------------------------------

    /// @dev See {IERC1155-setApprovalForAll}.
    function setApprovalForAll(address operator, bool approved) external {
        if (msg.sender == operator) revert CantSetSelf();

        _operatorApprovals[msg.sender][operator] = approved;
        emit ApprovalForAll(msg.sender, operator, approved);
    }

    /// @dev See {IERC1155-isApprovedForAll}.
    function isApprovedForAll(address account, address operator) public view returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /// @notice Modify the permissions for a specified `delegate` for the specified `node`.
    ///
    /// @dev This method only sets the approval status for msg.sender's nodes.
    ///
    /// @param node The namehash `node` whose permissions are being updated.
    /// @param delegate The address of the `delegate`
    /// @param approved Whether the `delegate` has approval to modify records for `msg.sender`'s `node`.
    function approve(bytes32 node, address delegate, bool approved) external {
        if (msg.sender == delegate) revert CantSetSelf();
        if (msg.sender != bns.owner(node)) revert NotOwner();

        _tokenApprovals[msg.sender][node][delegate] = approved;
        emit Approved(msg.sender, node, delegate, approved);
    }

    /// @notice Check to see if the `delegate` has been approved by the `owner` for the `node`.
    ///
    /// @param owner The address of the name owner.
    /// @param node The namehash `node` whose permissions are being checked.
    /// @param delegate The address of the `delegate` whose permissions are being checked.
    ///
    /// @return `true` if `delegate` is approved to modify `msg.sender`'s `node`, else `false`.
    function isApprovedFor(address owner, bytes32 node, address delegate) public view returns (bool) {
        return _tokenApprovals[owner][node][delegate];
    }

    /// @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:
    ///     1. The stored registrarController (for setting records upon registration)
    ///     2  The stored reverseRegistrar (for setting reverse records)
    ///     3. The owner of the node in the Registry
    ///     4. An approved operator for owner
    ///     5. An approved delegate for owner of the specified `node`
    ///
    /// @param node The namehashed `node` being authorized.
    ///
    /// @return `true` if `msg.sender` is authorized to modify records for the specified `node`, else `false`.
    function isAuthorised(bytes32 node) internal view override returns (bool) {
        if (msg.sender == registrarController || msg.sender == reverseRegistrar) {
            return true;
        }
        address owner = bns.owner(node);
        return owner == msg.sender || isApprovedForAll(owner, msg.sender) || isApprovedFor(owner, node, msg.sender);
    }

    /// ERC165 Interface Support -----------------------------------------

    /// @notice ERC165 compliant signal for interface support.
    /// @param interfaceID the ERC165 iface id being checked for compliance
    /// @return bool Whether this contract supports the provided interfaceID
    function supportsInterface(bytes4 interfaceID)
        public
        view
        override(
            Multicallable,
            ABIResolver,
            AddrResolver,
            ContentHashResolver,
            // DNSResolver,
            InterfaceResolver,
            NameResolver,
            PubkeyResolver,
            TextResolver
        )
        returns (bool)
    {
        return (interfaceID == type(IExtendedResolver).interfaceId || super.supportsInterface(interfaceID));
    }

    /// Admin Functions --------------------------------------------------

    /// @notice Allows the `owner` to set the registrar controller contract address.
    ///
    /// @dev Emits `RegistrarControllerUpdated` after setting the `registrarController` address.
    ///
    /// @param registrarController_ The address of the new RegistrarController contract.
    function setRegistrarController(address registrarController_) external onlyOwner {
        if (registrarController_ == address(0)) revert InvalidRegistrarController();

        registrarController = registrarController_;
        emit RegistrarControllerUpdated(registrarController_);
    }

    /// @notice Allows the `owner` to set the reverse registrar contract address.
    ///
    /// @dev Emits `ReverseRegistrarUpdated` after setting the `reverseRegistrar` address.
    ///
    /// @param reverseRegistrar_ The address of the new ReverseRegistrar contract.
    function setReverseRegistrar(address reverseRegistrar_) external onlyOwner {
        if (reverseRegistrar_ == address(0)) revert InvalidReverseRegistrar();

        reverseRegistrar = reverseRegistrar_;
        emit ReverseRegistrarUpdated(reverseRegistrar_);
    }
}

File 9 of 43 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 10 of 43 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.20;

import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint256 tokenId => address) private _owners;

    mapping(address owner => uint256) private _balances;

    mapping(uint256 tokenId => address) private _tokenApprovals;

    mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual returns (uint256) {
        if (owner == address(0)) {
            revert ERC721InvalidOwner(address(0));
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual returns (address) {
        return _requireOwned(tokenId);
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
        _requireOwned(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual {
        _approve(to, tokenId, _msgSender());
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual returns (address) {
        _requireOwned(tokenId);

        return _getApproved(tokenId);
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        address previousOwner = _update(to, tokenId, _msgSender());
        if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
        transferFrom(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     *
     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
     * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
     */
    function _getApproved(uint256 tokenId) internal view virtual returns (address) {
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
     * particular (ignoring whether it is owned by `owner`).
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
        return
            spender != address(0) &&
            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
    }

    /**
     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
     * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
     * the `spender` for the specific `tokenId`.
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
        if (!_isAuthorized(owner, spender, tokenId)) {
            if (owner == address(0)) {
                revert ERC721NonexistentToken(tokenId);
            } else {
                revert ERC721InsufficientApproval(spender, tokenId);
            }
        }
    }

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
     *
     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the
     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
     * remain consistent with one another.
     */
    function _increaseBalance(address account, uint128 value) internal virtual {
        unchecked {
            _balances[account] += value;
        }
    }

    /**
     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that
     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).
     *
     * Emits a {Transfer} event.
     *
     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
        address from = _ownerOf(tokenId);

        // Perform (optional) operator check
        if (auth != address(0)) {
            _checkAuthorized(from, auth, tokenId);
        }

        // Execute the update
        if (from != address(0)) {
            // Clear approval. No need to re-authorize or emit the Approval event
            _approve(address(0), tokenId, address(0), false);

            unchecked {
                _balances[from] -= 1;
            }
        }

        if (to != address(0)) {
            unchecked {
                _balances[to] += 1;
            }
        }

        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        return from;
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner != address(0)) {
            revert ERC721InvalidSender(address(0));
        }
    }

    /**
     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        _checkOnERC721Received(address(0), to, tokenId, data);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal {
        address previousOwner = _update(address(0), tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        } else if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
     * are aware of the ERC721 standard to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is like {safeTransferFrom} in the sense that it invokes
     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `tokenId` token must exist and be owned by `from`.
     * - `to` cannot be the zero address.
     * - `from` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId) internal {
        _safeTransfer(from, to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
     * either the owner of the token, or approved to operate on all tokens held by this owner.
     *
     * Emits an {Approval} event.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address to, uint256 tokenId, address auth) internal {
        _approve(to, tokenId, auth, true);
    }

    /**
     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
     * emitted in the context of transfers.
     */
    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
        // Avoid reading the owner unless necessary
        if (emitEvent || auth != address(0)) {
            address owner = _requireOwned(tokenId);

            // We do not use _isAuthorized because single-token approvals should not be able to call approve
            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
                revert ERC721InvalidApprover(auth);
            }

            if (emitEvent) {
                emit Approval(owner, to, tokenId);
            }
        }

        _tokenApprovals[tokenId] = to;
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Requirements:
     * - operator can't be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC721InvalidOperator(operator);
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
     * Returns the owner.
     *
     * Overrides to ownership logic should be done to {_ownerOf}.
     */
    function _requireOwned(uint256 tokenId) internal view returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
        return owner;
    }

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
     * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
        if (to.code.length > 0) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                if (retval != IERC721Receiver.onERC721Received.selector) {
                    revert ERC721InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }
}

File 11 of 43 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 12 of 43 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 13 of 43 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 14 of 43 : BNS.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface BNS {
    // Logged when the owner of a node assigns a new owner to a subnode.
    event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);

    // Logged when the owner of a node transfers ownership to a new account.
    event Transfer(bytes32 indexed node, address owner);

    // Logged when the resolver for a node changes.
    event NewResolver(bytes32 indexed node, address resolver);

    // Logged when the TTL of a node changes
    event NewTTL(bytes32 indexed node, uint64 ttl);

    // Logged when an operator is added or removed.
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    function setRecord(bytes32 node, address owner, address resolver, uint64 ttl) external;

    function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external;

    function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);

    function setResolver(bytes32 node, address resolver) external;

    function setOwner(bytes32 node, address owner) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function setApprovalForAll(address operator, bool approved) external;

    function owner(bytes32 node) external view returns (address);

    function resolver(bytes32 node) external view returns (address);

    function ttl(bytes32 node) external view returns (uint64);

    function recordExists(bytes32 node) external view returns (bool);

    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 15 of 43 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

// @param BERA_NODE The node hash of "bera"
bytes32 constant BERA_NODE = 0xcac7291742cc038df280cfdc67517aa5d83fe6f4716c336481273a83a877997b;

// @param REVERSE_NODE The node hash of "reverse"
bytes32 constant REVERSE_NODE = 0xa097f6721ce401e757d1223a763fef49b8b5f90bb18567ddb86fd205dff71d34;

// @param ADDR_REVERSE_NODE The node hash of "addr.reverse"
bytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;

// @param GRACE_PERIOD the grace period for expired names
uint256 constant GRACE_PERIOD = 30 days;

// @param RECLAIM_ID InterfaceId for the Reclaim interface
bytes4 constant RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)"));

uint64 constant DEFAULT_TTL = 3600;

File 16 of 43 : IExtendedResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IExtendedResolver {
    function resolve(bytes memory name, bytes memory data) external view returns (bytes memory);
}

File 17 of 43 : IReverseRegistrar.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

interface IReverseRegistrar {
    /// @notice Thrown when the registry is invalid.
    error InvalidRegistry();

    function claim(address claimant) external returns (bytes32);

    function setNameForAddr(address addr, address owner, address resolver, string memory name)
        external
        returns (bytes32);
}

File 18 of 43 : ABIResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import {IABIResolver} from "src/resolver/interfaces/IABIResolver.sol";

abstract contract ABIResolver is IABIResolver, ResolverBase {
    mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_abis;

    /**
     * Sets the ABI associated with an BNS node.
     * Nodes may have one ABI of each content type. To remove an ABI, set it to
     * the empty string.
     * @param node The node to update.
     * @param contentType The content type of the ABI
     * @param data The ABI data.
     */
    function setABI(bytes32 node, uint256 contentType, bytes calldata data) external virtual authorised(node) {
        // Content types must be powers of 2
        require(((contentType - 1) & contentType) == 0);

        versionable_abis[recordVersions[node]][node][contentType] = data;
        emit ABIChanged(node, contentType);
    }

    /**
     * Returns the ABI associated with an BNS node.
     * Defined in EIP205.
     * @param node The BNS node to query
     * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
     * @return contentType The content type of the return value
     * @return data The ABI data
     */
    function ABI(bytes32 node, uint256 contentTypes) external view virtual override returns (uint256, bytes memory) {
        mapping(uint256 => bytes) storage abiset = versionable_abis[recordVersions[node]][node];

        for (uint256 contentType = 1; contentType <= contentTypes; contentType <<= 1) {
            if ((contentType & contentTypes) != 0 && abiset[contentType].length > 0) {
                return (contentType, abiset[contentType]);
            }
        }

        return (0, bytes(""));
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IABIResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 19 of 43 : AddrResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import "src/resolver/interfaces/IAddrResolver.sol";
import "src/resolver/interfaces/IAddressResolver.sol";

abstract contract AddrResolver is IAddrResolver, IAddressResolver, ResolverBase {
    uint256 private constant COIN_TYPE_ETH = 60;

    mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;

    /**
     * Sets the address associated with an BNS node.
     * May only be called by the owner of that node in the BNS registry.
     * @param node The node to update.
     * @param a The address to set.
     */
    function setAddr(bytes32 node, address a) external virtual authorised(node) {
        setAddr(node, COIN_TYPE_ETH, addressToBytes(a));
    }

    /**
     * Returns the address associated with an BNS node.
     * @param node The BNS node to query.
     * @return The associated address.
     */
    function addr(bytes32 node) public view virtual override returns (address payable) {
        bytes memory a = addr(node, COIN_TYPE_ETH);
        if (a.length == 0) {
            return payable(0);
        }
        return bytesToAddress(a);
    }

    function setAddr(bytes32 node, uint256 coinType, bytes memory a) public virtual authorised(node) {
        emit AddressChanged(node, coinType, a);
        if (coinType == COIN_TYPE_ETH) {
            emit AddrChanged(node, bytesToAddress(a));
        }
        versionable_addresses[recordVersions[node]][node][coinType] = a;
    }

    function addr(bytes32 node, uint256 coinType) public view virtual override returns (bytes memory) {
        return versionable_addresses[recordVersions[node]][node][coinType];
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IAddrResolver).interfaceId || interfaceID == type(IAddressResolver).interfaceId
            || super.supportsInterface(interfaceID);
    }

    function bytesToAddress(bytes memory b) internal pure returns (address payable a) {
        require(b.length == 20);
        assembly {
            a := div(mload(add(b, 32)), exp(256, 12))
        }
    }

    function addressToBytes(address a) internal pure returns (bytes memory b) {
        b = new bytes(20);
        assembly {
            mstore(add(b, 32), mul(a, exp(256, 12)))
        }
    }
}

File 20 of 43 : ContentHashResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import "src/resolver/interfaces/IContentHashResolver.sol";

abstract contract ContentHashResolver is IContentHashResolver, ResolverBase {
    mapping(uint64 => mapping(bytes32 => bytes)) versionable_hashes;

    /**
     * Sets the contenthash associated with an BNS node.
     * May only be called by the owner of that node in the BNS registry.
     * @param node The node to update.
     * @param hash The contenthash to set
     */
    function setContenthash(bytes32 node, bytes calldata hash) external virtual authorised(node) {
        versionable_hashes[recordVersions[node]][node] = hash;
        emit ContenthashChanged(node, hash);
    }

    /**
     * Returns the contenthash associated with an BNS node.
     * @param node The BNS node to query.
     * @return The associated contenthash.
     */
    function contenthash(bytes32 node) external view virtual override returns (bytes memory) {
        return versionable_hashes[recordVersions[node]][node];
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IContentHashResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 21 of 43 : ExtendedResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

contract ExtendedResolver {
    function resolve(bytes memory, /* name */ bytes memory data) external view returns (bytes memory) {
        (bool success, bytes memory result) = address(this).staticcall(data);
        if (success) {
            return result;
        } else {
            // Revert with the reason provided by the call
            assembly {
                revert(add(result, 0x20), mload(result))
            }
        }
    }
}

File 22 of 43 : InterfaceResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import {AddrResolver} from "src/resolver/profiles/AddrResolver.sol";
import {IInterfaceResolver} from "src/resolver/interfaces/IInterfaceResolver.sol";

abstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {
    mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address))) versionable_interfaces;

    /**
     * Sets an interface associated with a name.
     * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.
     * @param node The node to update.
     * @param interfaceID The EIP 165 interface ID.
     * @param implementer The address of a contract that implements this interface for this node.
     */
    function setInterface(bytes32 node, bytes4 interfaceID, address implementer) external virtual authorised(node) {
        versionable_interfaces[recordVersions[node]][node][interfaceID] = implementer;
        emit InterfaceChanged(node, interfaceID, implementer);
    }

    /**
     * Returns the address of a contract that implements the specified interface for this name.
     * If an implementer has not been set for this interfaceID and name, the resolver will query
     * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that
     * contract implements EIP165 and returns `true` for the specified interfaceID, its address
     * will be returned.
     * @param node The BNS node to query.
     * @param interfaceID The EIP 165 interface ID to check for.
     * @return The address that implements this interface, or 0 if the interface is unsupported.
     */
    function interfaceImplementer(bytes32 node, bytes4 interfaceID) external view virtual override returns (address) {
        address implementer = versionable_interfaces[recordVersions[node]][node][interfaceID];
        if (implementer != address(0)) {
            return implementer;
        }

        address a = addr(node);
        if (a == address(0)) {
            return address(0);
        }

        (bool success, bytes memory returnData) =
            a.staticcall(abi.encodeWithSignature("supportsInterface(bytes4)", type(IERC165).interfaceId));
        if (!success || returnData.length < 32 || returnData[31] == 0) {
            // EIP 165 not supported by target
            return address(0);
        }

        (success, returnData) = a.staticcall(abi.encodeWithSignature("supportsInterface(bytes4)", interfaceID));
        if (!success || returnData.length < 32 || returnData[31] == 0) {
            // Specified interface not supported by target
            return address(0);
        }

        return a;
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IInterfaceResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 23 of 43 : Multicallable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

// Internal imports
import "src/resolver/interfaces/IMulticallable.sol";

abstract contract Multicallable is IMulticallable, ERC165 {
    function _multicall(bytes32 nodehash, bytes[] calldata data) internal returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            if (nodehash != bytes32(0)) {
                bytes32 txNamehash = bytes32(data[i][4:36]);
                require(txNamehash == nodehash, "multicall: All records must have a matching namehash");
            }

            (bool success, bytes memory result) = address(this).delegatecall(data[i]);
            if (!success) {
                if (result.length > 0) {
                    assembly {
                        let revertDataSize := mload(result)
                        revert(add(result, 32), revertDataSize)
                    }
                } else {
                    revert("Multicall delegatecall failed without a reason");
                }
            }

            results[i] = result;
        }
        return results;
    }

    // This function provides an extra security check when called
    // from priviledged contracts (such as EthRegistrarController)
    // that can set records on behalf of the node owners
    function multicallWithNodeCheck(bytes32 nodehash, bytes[] calldata data)
        external
        returns (bytes[] memory results)
    {
        return _multicall(nodehash, data);
    }

    function multicall(bytes[] calldata data) public override returns (bytes[] memory results) {
        return _multicall(bytes32(0), data);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IMulticallable).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 24 of 43 : NameResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import "src/resolver/interfaces/INameResolver.sol";

abstract contract NameResolver is INameResolver, ResolverBase {
    mapping(uint64 => mapping(bytes32 => string)) versionable_names;

    /**
     * Sets the name associated with an BNS node, for reverse records.
     * May only be called by the owner of that node in the BNS registry.
     * @param node The node to update.
     */
    function setName(bytes32 node, string calldata newName) external virtual authorised(node) {
        versionable_names[recordVersions[node]][node] = newName;
        emit NameChanged(node, newName);
    }

    /**
     * Returns the name associated with an BNS node, for reverse records.
     * Defined in EIP181.
     * @param node The BNS node to query.
     * @return The associated name.
     */
    function name(bytes32 node) external view virtual override returns (string memory) {
        return versionable_names[recordVersions[node]][node];
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(INameResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 25 of 43 : PubkeyResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import "src/resolver/interfaces/IPubkeyResolver.sol";

abstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {
    struct PublicKey {
        bytes32 x;
        bytes32 y;
    }

    mapping(uint64 => mapping(bytes32 => PublicKey)) versionable_pubkeys;

    /**
     * Sets the SECP256k1 public key associated with an BNS node.
     * @param node The BNS node to query
     * @param x the X coordinate of the curve point for the public key.
     * @param y the Y coordinate of the curve point for the public key.
     */
    function setPubkey(bytes32 node, bytes32 x, bytes32 y) external virtual authorised(node) {
        versionable_pubkeys[recordVersions[node]][node] = PublicKey(x, y);
        emit PubkeyChanged(node, x, y);
    }

    /**
     * Returns the SECP256k1 public key associated with an BNS node.
     * Defined in EIP 619.
     * @param node The BNS node to query
     * @return x The X coordinate of the curve point for the public key.
     * @return y The Y coordinate of the curve point for the public key.
     */
    function pubkey(bytes32 node) external view virtual override returns (bytes32 x, bytes32 y) {
        uint64 currentRecordVersion = recordVersions[node];
        return (versionable_pubkeys[currentRecordVersion][node].x, versionable_pubkeys[currentRecordVersion][node].y);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IPubkeyResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 26 of 43 : TextResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ResolverBase} from "src/resolver/types/ResolverBase.sol";
import "src/resolver/interfaces/ITextResolver.sol";

abstract contract TextResolver is ITextResolver, ResolverBase {
    mapping(uint64 => mapping(bytes32 => mapping(string => string))) versionable_texts;

    /**
     * Sets the text data associated with an BNS node and key.
     * May only be called by the owner of that node in the BNS registry.
     * @param node The node to update.
     * @param key The key to set.
     * @param value The text data value to set.
     */
    function setText(bytes32 node, string calldata key, string calldata value) external virtual authorised(node) {
        versionable_texts[recordVersions[node]][node][key] = value;
        emit TextChanged(node, key, key, value);
    }

    /**
     * Returns the text data associated with an BNS node and key.
     * @param node The BNS node to query.
     * @param key The text data key to query.
     * @return The associated text data.
     */
    function text(bytes32 node, string calldata key) external view virtual override returns (string memory) {
        return versionable_texts[recordVersions[node]][node][key];
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(ITextResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 27 of 43 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 28 of 43 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 29 of 43 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 30 of 43 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 31 of 43 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 32 of 43 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 33 of 43 : ResolverBase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";

import {IVersionableResolver} from "src/resolver/interfaces/IVersionableResolver.sol";

abstract contract ResolverBase is ERC165, IVersionableResolver {
    mapping(bytes32 => uint64) public recordVersions;

    function isAuthorised(bytes32 node) internal view virtual returns (bool);

    modifier authorised(bytes32 node) {
        require(isAuthorised(node), "Unauthorized");
        _;
    }

    /**
     * Increments the record version associated with an BNS node.
     * May only be called by the owner of that node in the BNS registry.
     * @param node The node to update.
     */
    function clearRecords(bytes32 node) public virtual authorised(node) {
        recordVersions[node]++;
        emit VersionChanged(node, recordVersions[node]);
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) {
        return interfaceID == type(IVersionableResolver).interfaceId || super.supportsInterface(interfaceID);
    }
}

File 34 of 43 : IABIResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IABIResolver {
    event ABIChanged(bytes32 indexed node, uint256 indexed contentType);

    /**
     * Returns the ABI associated with an ENS node.
     * Defined in EIP205.
     * @param node The ENS node to query
     * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.
     * @return contentType The content type of the return value
     * @return data The ABI data
     */
    function ABI(bytes32 node, uint256 contentTypes) external view returns (uint256, bytes memory);
}

File 35 of 43 : IAddrResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

/**
 * Interface for the legacy (ETH-only) addr function.
 */
interface IAddrResolver {
    event AddrChanged(bytes32 indexed node, address a);

    /**
     * Returns the address associated with an BNS node.
     * @param node The BNS node to query.
     * @return The associated address.
     */
    function addr(bytes32 node) external view returns (address payable);
}

File 36 of 43 : IAddressResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

/**
 * Interface for the new (multicoin) addr function.
 */
interface IAddressResolver {
    event AddressChanged(bytes32 indexed node, uint256 coinType, bytes newAddress);

    function addr(bytes32 node, uint256 coinType) external view returns (bytes memory);
}

File 37 of 43 : IContentHashResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IContentHashResolver {
    event ContenthashChanged(bytes32 indexed node, bytes hash);

    /**
     * Returns the contenthash associated with an BNS node.
     * @param node The BNS node to query.
     * @return The associated contenthash.
     */
    function contenthash(bytes32 node) external view returns (bytes memory);
}

File 38 of 43 : IInterfaceResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IInterfaceResolver {
    event InterfaceChanged(bytes32 indexed node, bytes4 indexed interfaceID, address implementer);

    /**
     * Returns the address of a contract that implements the specified interface for this name.
     * If an implementer has not been set for this interfaceID and name, the resolver will query
     * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that
     * contract implements EIP165 and returns `true` for the specified interfaceID, its address
     * will be returned.
     * @param node The BNS node to query.
     * @param interfaceID The EIP 165 interface ID to check for.
     * @return The address that implements this interface, or 0 if the interface is unsupported.
     */
    function interfaceImplementer(bytes32 node, bytes4 interfaceID) external view returns (address);
}

File 39 of 43 : IMulticallable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IMulticallable {
    function multicall(bytes[] calldata data) external returns (bytes[] memory results);

    function multicallWithNodeCheck(bytes32, bytes[] calldata data) external returns (bytes[] memory results);
}

File 40 of 43 : INameResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface INameResolver {
    event NameChanged(bytes32 indexed node, string name);

    /**
     * Returns the name associated with an BNS node, for reverse records.
     * Defined in EIP181.
     * @param node The BNS node to query.
     * @return The associated name.
     */
    function name(bytes32 node) external view returns (string memory);
}

abstract contract AbstractNameResolver {
    function setName(bytes32 node, string memory name) public virtual;
}

File 41 of 43 : IPubkeyResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IPubkeyResolver {
    event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);

    /**
     * Returns the SECP256k1 public key associated with an ENS node.
     * Defined in EIP 619.
     * @param node The ENS node to query
     * @return x The X coordinate of the curve point for the public key.
     * @return y The Y coordinate of the curve point for the public key.
     */
    function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);
}

File 42 of 43 : ITextResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface ITextResolver {
    event TextChanged(bytes32 indexed node, string indexed indexedKey, string key, string value);

    /**
     * Returns the text data associated with an BNS node and key.
     * @param node The BNS node to query.
     * @param key The text data key to query.
     * @return The associated text data.
     */
    function text(bytes32 node, string calldata key) external view returns (string memory);
}

File 43 of 43 : IVersionableResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IVersionableResolver {
    event VersionChanged(bytes32 indexed node, uint64 newVersion);

    function recordVersions(bytes32 node) external view returns (uint64);
}

Settings
{
  "remappings": [
    "@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract BaseRegistrar","name":"base_","type":"address"},{"internalType":"contract BeraDefaultResolver","name":"resolver_","type":"address"},{"internalType":"contract IWETH","name":"weth_","type":"address"},{"internalType":"uint256","name":"auctionDuration_","type":"uint256"},{"internalType":"uint256","name":"registrationDuration_","type":"uint256"},{"internalType":"uint192","name":"reservePrice_","type":"uint192"},{"internalType":"uint56","name":"timeBuffer_","type":"uint56"},{"internalType":"uint8","name":"minBidIncrementPercentage_","type":"uint8"},{"internalType":"address","name":"paymentReceiver_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AuctionAlreadySettled","type":"error"},{"inputs":[],"name":"AuctionExpired","type":"error"},{"inputs":[],"name":"AuctionNotBegun","type":"error"},{"inputs":[],"name":"AuctionNotCompleted","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"InvalidPaymentReceiver","type":"error"},{"inputs":[],"name":"InvalidRange","type":"error"},{"inputs":[],"name":"InvalidReservePrice","type":"error"},{"inputs":[{"internalType":"uint256","name":"auctionCount","type":"uint256"}],"name":"MaxAuctionCountExceeded","type":"error"},{"inputs":[],"name":"MaxAuctionCountIsZero","type":"error"},{"inputs":[],"name":"MinBidIncrementPercentageIsZero","type":"error"},{"inputs":[],"name":"MissingSettlementsData","type":"error"},{"inputs":[],"name":"MustSendAtLeastReservePrice","type":"error"},{"inputs":[],"name":"MustSendMoreThanLastBidByMinBidIncrementPercentageAmount","type":"error"},{"inputs":[],"name":"NoAuctions","type":"error"},{"inputs":[],"name":"NotEnoughHistory","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"PriceExceedsUint64Range","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"startId","type":"uint256"}],"name":"StartIdTooLarge","type":"error"},{"inputs":[{"internalType":"uint256","name":"timeBuffer","type":"uint256"}],"name":"TimeBufferTooLarge","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNotForUpAuction","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bool","name":"extended","type":"bool"}],"name":"AuctionBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"AuctionCreationError","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"AuctionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minBidIncrementPercentage","type":"uint256"}],"name":"AuctionMinBidIncrementPercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reservePrice","type":"uint256"}],"name":"AuctionReservePriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AuctionSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timeBuffer","type":"uint256"}],"name":"AuctionTimeBufferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxAuctionCount","type":"uint256"}],"name":"MaxAuctionCountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPaymentReceiver","type":"address"}],"name":"PaymentReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_TIME_BUFFER","outputs":[{"internalType":"uint56","name":"","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auction","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"bool","name":"settled","type":"bool"}],"internalType":"struct IBeraAuctionHouse.AuctionView","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionStorage","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"bool","name":"settled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"base","outputs":[{"internalType":"contract BaseRegistrar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"createBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionCount","type":"uint256"}],"name":"getPrices","outputs":[{"internalType":"uint256[]","name":"prices","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startId","type":"uint256"},{"internalType":"uint256","name":"endId","type":"uint256"}],"name":"getSettlements","outputs":[{"components":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IBeraAuctionHouse.Settlement[]","name":"settlements","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"auctionCount","type":"uint256"}],"name":"getSettlements","outputs":[{"components":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IBeraAuctionHouse.Settlement[]","name":"settlements","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startId","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"getSettlementsFromIdtoTimestamp","outputs":[{"components":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct IBeraAuctionHouse.Settlement[]","name":"settlements","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAuctionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBidIncrementPercentage","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registrationDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservePrice","outputs":[{"internalType":"uint192","name":"","type":"uint192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"resolver","outputs":[{"internalType":"contract BeraDefaultResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxAuctionCount","type":"uint256"}],"name":"setMaxAuctionCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_minBidIncrementPercentage","type":"uint8"}],"name":"setMinBidIncrementPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"paymentReceiver_","type":"address"}],"name":"setPaymentReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint192","name":"_reservePrice","type":"uint192"}],"name":"setReservePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint56","name":"_timeBuffer","type":"uint56"}],"name":"setTimeBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settleAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"label_","type":"string"}],"name":"settleCurrentAndCreateNewAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timeBuffer","outputs":[{"internalType":"uint56","name":"","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"label_","type":"string"}],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

610120604052348015610010575f5ffd5b506040516128f03803806128f083398101604081905261002f916102b4565b5f805460ff1916905560018055338061006257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61006b816101ae565b506001600160a01b0389811660805288811660a05287811660c05260e0879052610100869052600a80546001600160a01b03191691831691909117905560196003556100b56101ff565b836001600160c01b03165f036100de5760405163fb33f9b560e01b815260040160405180910390fd5b8160ff165f03610101576040516349ad5d5360e01b815260040160405180910390fd5b6201518066ffffffffffffff8416111561013957604051632380259f60e11b815266ffffffffffffff84166004820152602401610059565b506004805460ff909216600160f81b026001600160f81b0366ffffffffffffff909416600160c01b027fff000000000000000000000000000000000000000000000000000000000000009093166001600160c01b039095169490941791909117919091169190911790555061036d9350505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b610207610258565b5f805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861023b3390565b6040516001600160a01b03909116815260200160405180910390a1565b5f5460ff161561027b5760405163d93c066560e01b815260040160405180910390fd5b565b6001600160a01b0381168114610291575f5ffd5b50565b805160ff811681146102a4575f5ffd5b919050565b80516102a48161027d565b5f5f5f5f5f5f5f5f5f6101208a8c0312156102cd575f5ffd5b89516102d88161027d565b60208b01519099506102e98161027d565b60408b01519098506102fa8161027d565b60608b015160808c015160a08d015192995090975095506001600160c01b0381168114610325575f5ffd5b60c08b015190945066ffffffffffffff81168114610341575f5ffd5b925061034f60e08b01610294565b915061035e6101008b016102a9565b90509295985092959850929598565b60805160a05160c05160e051610100516125076103e95f395f81816107200152611b8b01525f81816102750152611cce01525f818161033501528181611e0a0152611e9b01525f81816101e50152611bb901525f8181610387015281816117ad01528181611956015281816119ee0152611bea01526125075ff3fe6080604052600436106101d0575f3560e01c80637d9f6db5116100fd578063b296024d11610092578063de90d11111610062578063de90d1111461070f578063e79faa5814610742578063ec91f2a414610761578063f2fde38b14610787575f5ffd5b8063b296024d14610668578063c0555d981461069a578063cb37f3b2146106b9578063db2e1eed146106d8575f5ffd5b80638da5cb5b116100cd5780638da5cb5b1461057a5780639149295614610597578063945c37cb146105c3578063a4d0a17e14610654575f5ffd5b80637d9f6db514610410578063827cb478146105195780638456cb591461053857806385317a291461054c575f5ffd5b806336ebdb38116101735780635c975abb116101435780635c975abb146103a9578063659dd2b4146103ca57806365ebf99a146103dd578063715018a6146103fc575f5ffd5b806336ebdb38146103055780633fc8cef31461032457806346f920fd146103575780635001f3b514610376575f5ffd5b80630cbf54c8116101ae5780630cbf54c81461026457806313b3c4e3146102a5578063151281e8146102ba5780632c34064c146102e6575f5ffd5b806304f3bcec146101d4578063092c7ea8146102245780630ba4e9ea14610245575b5f5ffd5b3480156101df575f5ffd5b506102077f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561022f575f5ffd5b5061024361023e3660046120d6565b6107a6565b005b348015610250575f5ffd5b5061024361025f36600461216c565b6107ca565b34801561026f575f5ffd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161021b565b3480156102b0575f5ffd5b5061029760035481565b3480156102c5575f5ffd5b506102d96102d4366004612199565b610870565b60405161021b91906121b9565b3480156102f1575f5ffd5b506102d9610300366004612199565b610ae2565b348015610310575f5ffd5b5061024361031f36600461222d565b610d96565b34801561032f575f5ffd5b506102077f000000000000000000000000000000000000000000000000000000000000000081565b348015610362575f5ffd5b506102d961037136600461224d565b610e11565b348015610381575f5ffd5b506102077f000000000000000000000000000000000000000000000000000000000000000081565b3480156103b4575f5ffd5b505f5460ff16604051901515815260200161021b565b6102436103d836600461224d565b6110ca565b3480156103e8575f5ffd5b506102436103f7366004612264565b611363565b348015610407575f5ffd5b506102436113e0565b34801561041b575f5ffd5b506104b26040805160c0810182525f80825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c081018252600554815260065460208201526007546001600160401b0380821693830193909352600160401b900490911660608201526008546001600160a01b0381166080830152600160a01b900460ff16151560a082015290565b60405161021b91905f60c08201905082518252602083015160208301526001600160401b0360408401511660408301526001600160401b03606084015116606083015260018060a01b03608084015116608083015260a0830151151560a083015292915050565b348015610524575f5ffd5b5061024361053336600461224d565b6113f3565b348015610543575f5ffd5b50610243611458565b348015610557575f5ffd5b506105626201518081565b60405166ffffffffffffff909116815260200161021b565b348015610585575f5ffd5b506002546001600160a01b0316610207565b3480156105a2575f5ffd5b506105b66105b136600461224d565b611468565b60405161021b919061228a565b3480156105ce575f5ffd5b5060055460065460075460085461060f9392916001600160401b0380821692600160401b90920416906001600160a01b03811690600160a01b900460ff1686565b6040805196875260208701959095526001600160401b0393841694860194909452911660608401526001600160a01b03166080830152151560a082015260c00161021b565b34801561065f575f5ffd5b50610243611627565b348015610673575f5ffd5b5060045461068890600160f81b900460ff1681565b60405160ff909116815260200161021b565b3480156106a5575f5ffd5b506102436106b43660046122c1565b611650565b3480156106c4575f5ffd5b50600a54610207906001600160a01b031681565b3480156106e3575f5ffd5b506004546106f7906001600160c01b031681565b6040516001600160c01b03909116815260200161021b565b34801561071a575f5ffd5b506102977f000000000000000000000000000000000000000000000000000000000000000081565b34801561074d575f5ffd5b5061024361075c3660046120d6565b6116cf565b34801561076c575f5ffd5b5060045461056290600160c01b900466ffffffffffffff1681565b348015610792575f5ffd5b506102436107a1366004612264565b61170e565b6107ae611748565b6107b661176b565b6107be611798565b6107c781611b47565b50565b6107d261176b565b6201518066ffffffffffffff8216111561080f57604051632380259f60e11b815266ffffffffffffff821660048201526024015b60405180910390fd5b6004805466ffffffffffffff60c01b1916600160c01b66ffffffffffffff8416908102919091179091556040519081527f1b55d9f7002bda4490f467e326f22a4a847629c0f2d1ed421607d318d25b410d906020015b60405180910390a150565b606060035483111561089857604051630b0b52bb60e11b815260048101849052602401610806565b818311806108a4575082155b806108ad575081155b156108cb5760405163561ce9bb60e01b815260040160405180910390fd5b5f835b83811015610977575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b0316928101929092521580159061094357505f81602001516001600160401b0316115b801561095b575060408101516001600160a01b031615155b1561096e578261096a816122fb565b9350505b506001016108ce565b50806001600160401b0381111561099057610990612096565b6040519080825280602002602001820160405280156109c957816020015b6109b6612063565b8152602001906001900390816109ae5790505b5091505f845b84811015610ad9575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b03169281019290925215801590610a4457505f81602001516001600160401b0316115b8015610a5c575060408101516001600160a01b031615155b15610ad0576040518060800160405280825f015163ffffffff168152602001610a888360200151611db2565b815260200182604001516001600160a01b0316815260200183815250858481518110610ab657610ab6612313565b60200260200101819052508280610acc906122fb565b9350505b506001016109cf565b50505092915050565b6060600354831115610b0a57604051630b0b52bb60e11b815260048101849052602401610806565b60055480841115610b3157604051633839647b60e11b815260048101859052602401610806565b5f845b828111610bfd575f818152600960209081526040918290208251606081018452905463ffffffff81168252600160201b81046001600160401b031692820192909252600160601b9091046001600160a01b0316918101919091528382148015610ba757506001815f015163ffffffff1611155b8015610bbe575060408101516001600160a01b0316155b15610bc95750610bed565b805163ffffffff16861015610bde5750610bfd565b82610be8816122fb565b935050505b610bf6816122fb565b9050610b34565b50806001600160401b03811115610c1657610c16612096565b604051908082528060200260200182016040528015610c4f57816020015b610c3c612063565b815260200190600190039081610c345790505b5092505f855b838111158015610c6457508282105b15610d8c575f818152600960209081526040918290208251606081018452905463ffffffff81168252600160201b81046001600160401b031692820192909252600160601b9091046001600160a01b0316918101919091528482148015610cd557506001815f015163ffffffff1611155b8015610cec575060408101516001600160a01b0316155b15610cf75750610d7c565b805163ffffffff16871015610d0c5750610d8c565b6040518060800160405280825f015163ffffffff168152602001610d338360200151611db2565b815260200182604001516001600160a01b0316815260200183815250868481518110610d6157610d61612313565b60200260200101819052508280610d77906122fb565b935050505b610d85816122fb565b9050610c55565b5050505092915050565b610d9e61176b565b8060ff165f03610dc1576040516349ad5d5360e01b815260040160405180910390fd5b600480546001600160f81b0316600160f81b60ff8416908102919091179091556040519081527fec5ccd96cc77b6219e9d44143df916af68fc169339ea7de5008ff15eae13450d90602001610865565b6060600354821115610e3957604051630b0b52bb60e11b815260048101839052602401610806565b6005545f819003610e5d57604051631e4086cf60e21b815260040160405180910390fd5b600854600160a01b900460ff16158015610e7657505f81115b15610e8957610e86600182612327565b90505b5f815b84821015610f4a575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b03169281019290925215801590610f0157505f81602001516001600160401b0316115b8015610f19575060408101516001600160a01b031615155b15610f2c5782610f28816122fb565b9350505b815f03610f395750610f4a565b50610f438161233a565b9050610e8c565b50806001600160401b03811115610f6357610f63612096565b604051908082528060200260200182016040528015610f9c57816020015b610f89612063565b815260200190600190039081610f815790505b5092505f825b828210156110c1575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b0316928101929092521580159061101757505f81602001516001600160401b0316115b801561102f575060408101516001600160a01b031615155b156110a3576040518060800160405280825f015163ffffffff16815260200161105b8360200151611db2565b815260200182604001516001600160a01b031681526020018381525086848151811061108957611089612313565b6020026020010181905250828061109f906122fb565b9350505b815f036110b057506110c1565b506110ba8161233a565b9050610fa2565b50505050919050565b6110d2611748565b6110da611dd0565b6040805160c08101825260055480825260065460208301526007546001600160401b0380821694840194909452600160401b900490921660608201526008546001600160a01b038116608083015260ff600160a01b9091048116151560a083015260045491926001600160c01b0383169266ffffffffffffff600160c01b82041692600160f81b9091041690851461118857604051632297552d60e11b815260048101869052602401610806565b83606001516001600160401b031642106111b557604051630129799f60e21b815260040160405180910390fd5b826001600160c01b03163410156111df57604051633ddefd2560e21b815260040160405180910390fd5b60648160ff1685602001516111f4919061234f565b6111fe9190612366565b846020015161120d9190612385565b34101561122d57604051634ec82d9560e01b815260040160405180910390fd5b34600655600880546001600160a01b0319163317905560608401515f9066ffffffffffffff8416906112699042906001600160401b0316612327565b86516040805133815234602082015293909210918301829052909250907f1159164c56f277e6fc99c11731bd380e0347deb969b75523398734c252706ea39060600160405180910390a28015611332576112cc66ffffffffffffff841642612385565b64ffffffffff1660608601819052600780546fffffffffffffffff00000000000000001916600160401b83021790558551604051918252907f6e912a3a9105bdd2af817ba5adc14e6c127c1035b5b648faa29ca0d58ab8ff4e9060200160405180910390a25b60808501516001600160a01b0381161561135457611354818760200151611dfa565b5050505050506107c760018055565b61136b61176b565b6001600160a01b038116611392576040516301ed76a760e61b815260040160405180910390fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f6cfddd24d2afc1b9f31d51f0ef77029fdde044799f0a87a2a09b7673b609742290602001610865565b6113e861176b565b6113f15f611f0e565b565b6113fb611748565b61140361176b565b805f0361142357604051636249244960e01b815260040160405180910390fd5b60038190556040518181527fd770aa5d8859528bbc6591dd02a6c17f76c515c44dcb848e8500303042341c1290602001610865565b61146061176b565b6113f1611f5f565b6005546060905f81900361148f57604051631e4086cf60e21b815260040160405180910390fd5b600854600160a01b900460ff161580156114a857505f81115b156114bb576114b8600182612327565b90505b826001600160401b038111156114d3576114d3612096565b6040519080825280602002602001820160405280156114fc578160200160208202803683370190505b50604080516060810182525f8082526020820181905291810182905291935090825b5f8111801561152c57508583105b156115fe575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b031692810192909252909250158061159e575060408201516001600160a01b0316155b806115b4575060208201516001600160401b0316155b6115ee576115c58260200151611db2565b8584815181106115d7576115d7612313565b60209081029190910101526115eb836122fb565b92505b6115f78161233a565b905061151e565b5081851461161f57604051639ee522a960e01b815260040160405180910390fd5b505050919050565b61162f611fb8565b61163761176b565b61163f611dd0565b611647611798565b6113f160018055565b61165861176b565b806001600160c01b03165f036116815760405163fb33f9b560e01b815260040160405180910390fd5b600480546001600160c01b0319166001600160c01b0383169081179091556040519081527f6ab2e127d7fdf53b8f304e59d3aab5bfe97979f52a85479691a6fab27a28a6b290602001610865565b6116d761176b565b6116df611fda565b6007546001600160401b031615806117005750600854600160a01b900460ff165b156107c7576107c781611b47565b61171661176b565b6001600160a01b03811661173f57604051631e4fbdf760e01b81525f6004820152602401610806565b6107c781611f0e565b5f5460ff16156113f15760405163d93c066560e01b815260040160405180910390fd5b6002546001600160a01b031633146113f15760405163118cdaa760e01b8152336004820152602401610806565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156117fa573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061181e9190612398565b5f0361183d57604051631e4086cf60e21b815260040160405180910390fd5b6040805160c081018252600554815260065460208201526007546001600160401b03808216938301849052600160401b9091041660608201526008546001600160a01b0381166080830152600160a01b900460ff16151560a0820152905f036118b9576040516322fb799b60e11b815260040160405180910390fd5b8060a00151156118dc57604051634f4fee1760e01b815260040160405180910390fd5b80606001516001600160401b031642101561190a5760405163857889f760e01b815260040160405180910390fd5b6008805460ff60a01b1916600160a01b17905560808101516001600160a01b03166119ba5780516040516323b872dd60e01b815230600482015261dead602482015260448101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064015f604051808303815f87803b15801561199f575f5ffd5b505af11580156119b1573d5f5f3e3d5ffd5b50505050611a48565b608081015181516040516323b872dd60e01b81523060048201526001600160a01b03928316602482015260448101919091527f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064015f604051808303815f87803b158015611a31575f5ffd5b505af1158015611a43573d5f5f3e3d5ffd5b505050505b5f8160200151118015611a655750600a546001600160a01b031615155b15611a8557600a546020820151611a85916001600160a01b031690611dfa565b80515f908152600960209081526040909120805463ffffffff19164263ffffffff1617815590820151611ab790612012565b8154608084015163ffffffff909116600160201b6001600160401b0393909316929092026bffffffffffffffffffffffff1691909117600160601b6001600160a01b039092169182021782558251602080850151604080519485529184015290917fc9f72b276a388619c6d185d146697036241880c36654b1a3ffdad07c24038d99910160405180910390a25050565b5f81604051602001611b5991906123af565b60408051601f1981840301815290829052805160209091012063eac2aa0960e01b8252600482018190523060248301527f000000000000000000000000000000000000000000000000000000000000000060448301526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660648401525f60848401529092507f0000000000000000000000000000000000000000000000000000000000000000169063eac2aa099060a4016020604051808303815f875af1925050508015611c4e575060408051601f3d908101601f19168201909252611c4b91810190612398565b60015b611cc757611c5a6123c5565b806308c379a003611cbd5750611c6e6123de565b80611c795750611cbf565b611c81611f5f565b7ff63212df4867fef3d461e9b3cb93f7337b231bfb99c82fad9c6eda92d399410581604051611cb09190612460565b60405180910390a1505050565b505b3d5f5f3e3d5ffd5b425f611cf37f000000000000000000000000000000000000000000000000000000000000000083612495565b6040805160c0810182528681525f602080830182905264ffffffffff878116848601819052908616606085018190526080850184905260a090940183905260058a9055600692909255600780546fffffffffffffffffffffffffffffffff19168317600160401b8502179055600880546001600160a81b0319169055835191825281019190915291925085917fd6eddd1118d71820909c1197aa966dbc15ed6f508554252169cc3d5ccac756ca910160405180910390a25050505b5050565b5f611dca6001600160401b0383166305f5e10061234f565b92915050565b600260015403611df357604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b611e04828261204f565b611dae577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b158015611e61575f5ffd5b505af1158015611e73573d5f5f3e3d5ffd5b505060405163a9059cbb60e01b81526001600160a01b038681166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb925060440190506020604051808303815f875af1158015611ee5573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f0991906124b2565b505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b611f67611748565b5f805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f9b3390565b6040516001600160a01b03909116815260200160405180910390a1565b5f5460ff166113f157604051638dfc202b60e01b815260040160405180910390fd5b611fe2611fb8565b5f805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611f9b565b5f806120226305f5e10084612366565b90506001600160401b03811115611dca576040516387a3017d60e01b815260048101849052602401610806565b5f5f5f5f5f5f8688617530f1949350505050565b60405180608001604052805f63ffffffff1681526020015f81526020015f6001600160a01b031681526020015f81525090565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b03811182821017156120cf576120cf612096565b6040525050565b5f602082840312156120e6575f5ffd5b81356001600160401b038111156120fb575f5ffd5b8201601f8101841361210b575f5ffd5b80356001600160401b0381111561212457612124612096565b60405161213b601f8301601f1916602001826120aa565b81815285602083850101111561214f575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f6020828403121561217c575f5ffd5b813566ffffffffffffff81168114612192575f5ffd5b9392505050565b5f5f604083850312156121aa575f5ffd5b50508035926020909101359150565b602080825282518282018190525f918401906040840190835b81811015612222578351805163ffffffff168452602080820151818601526040808301516001600160a01b03169086015260609182015191850191909152909301926080909201916001016121d2565b509095945050505050565b5f6020828403121561223d575f5ffd5b813560ff81168114612192575f5ffd5b5f6020828403121561225d575f5ffd5b5035919050565b5f60208284031215612274575f5ffd5b81356001600160a01b0381168114612192575f5ffd5b602080825282518282018190525f918401906040840190835b818110156122225783518352602093840193909201916001016122a3565b5f602082840312156122d1575f5ffd5b81356001600160c01b0381168114612192575f5ffd5b634e487b7160e01b5f52601160045260245ffd5b5f6001820161230c5761230c6122e7565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b81810381811115611dca57611dca6122e7565b5f81612348576123486122e7565b505f190190565b8082028115828204841417611dca57611dca6122e7565b5f8261238057634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611dca57611dca6122e7565b5f602082840312156123a8575f5ffd5b5051919050565b5f82518060208501845e5f920191825250919050565b5f60033d11156123db5760045f5f3e505f5160e01c5b90565b5f60443d10156123eb5790565b6040513d600319016004823e80513d60248201116001600160401b038211171561241457505090565b80820180516001600160401b0381111561242f575050505090565b3d8401600319018282016020011115612449575050505090565b612458602082850101856120aa565b509392505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b64ffffffffff8181168382160190811115611dca57611dca6122e7565b5f602082840312156124c2575f5ffd5b81518015158114612192575f5ffdfea26469706673582212203009cf90cc47ae5ae0cb7346d0212518a26ad1c5e4850e8336d61e2dfc964a6d64736f6c634300081c00330000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b27000000000000000000000000c23e819766cd5c5f5ec0e1b1764afeba1dc2d03c0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df800000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000001e133800000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dd860bb53d040ad9fbd868c345d18f820a3cd9bc

Deployed Bytecode

0x6080604052600436106101d0575f3560e01c80637d9f6db5116100fd578063b296024d11610092578063de90d11111610062578063de90d1111461070f578063e79faa5814610742578063ec91f2a414610761578063f2fde38b14610787575f5ffd5b8063b296024d14610668578063c0555d981461069a578063cb37f3b2146106b9578063db2e1eed146106d8575f5ffd5b80638da5cb5b116100cd5780638da5cb5b1461057a5780639149295614610597578063945c37cb146105c3578063a4d0a17e14610654575f5ffd5b80637d9f6db514610410578063827cb478146105195780638456cb591461053857806385317a291461054c575f5ffd5b806336ebdb38116101735780635c975abb116101435780635c975abb146103a9578063659dd2b4146103ca57806365ebf99a146103dd578063715018a6146103fc575f5ffd5b806336ebdb38146103055780633fc8cef31461032457806346f920fd146103575780635001f3b514610376575f5ffd5b80630cbf54c8116101ae5780630cbf54c81461026457806313b3c4e3146102a5578063151281e8146102ba5780632c34064c146102e6575f5ffd5b806304f3bcec146101d4578063092c7ea8146102245780630ba4e9ea14610245575b5f5ffd5b3480156101df575f5ffd5b506102077f000000000000000000000000c23e819766cd5c5f5ec0e1b1764afeba1dc2d03c81565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561022f575f5ffd5b5061024361023e3660046120d6565b6107a6565b005b348015610250575f5ffd5b5061024361025f36600461216c565b6107ca565b34801561026f575f5ffd5b506102977f000000000000000000000000000000000000000000000000000000000001518081565b60405190815260200161021b565b3480156102b0575f5ffd5b5061029760035481565b3480156102c5575f5ffd5b506102d96102d4366004612199565b610870565b60405161021b91906121b9565b3480156102f1575f5ffd5b506102d9610300366004612199565b610ae2565b348015610310575f5ffd5b5061024361031f36600461222d565b610d96565b34801561032f575f5ffd5b506102077f0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df881565b348015610362575f5ffd5b506102d961037136600461224d565b610e11565b348015610381575f5ffd5b506102077f0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b2781565b3480156103b4575f5ffd5b505f5460ff16604051901515815260200161021b565b6102436103d836600461224d565b6110ca565b3480156103e8575f5ffd5b506102436103f7366004612264565b611363565b348015610407575f5ffd5b506102436113e0565b34801561041b575f5ffd5b506104b26040805160c0810182525f80825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c081018252600554815260065460208201526007546001600160401b0380821693830193909352600160401b900490911660608201526008546001600160a01b0381166080830152600160a01b900460ff16151560a082015290565b60405161021b91905f60c08201905082518252602083015160208301526001600160401b0360408401511660408301526001600160401b03606084015116606083015260018060a01b03608084015116608083015260a0830151151560a083015292915050565b348015610524575f5ffd5b5061024361053336600461224d565b6113f3565b348015610543575f5ffd5b50610243611458565b348015610557575f5ffd5b506105626201518081565b60405166ffffffffffffff909116815260200161021b565b348015610585575f5ffd5b506002546001600160a01b0316610207565b3480156105a2575f5ffd5b506105b66105b136600461224d565b611468565b60405161021b919061228a565b3480156105ce575f5ffd5b5060055460065460075460085461060f9392916001600160401b0380821692600160401b90920416906001600160a01b03811690600160a01b900460ff1686565b6040805196875260208701959095526001600160401b0393841694860194909452911660608401526001600160a01b03166080830152151560a082015260c00161021b565b34801561065f575f5ffd5b50610243611627565b348015610673575f5ffd5b5060045461068890600160f81b900460ff1681565b60405160ff909116815260200161021b565b3480156106a5575f5ffd5b506102436106b43660046122c1565b611650565b3480156106c4575f5ffd5b50600a54610207906001600160a01b031681565b3480156106e3575f5ffd5b506004546106f7906001600160c01b031681565b6040516001600160c01b03909116815260200161021b565b34801561071a575f5ffd5b506102977f0000000000000000000000000000000000000000000000000000000001e1338081565b34801561074d575f5ffd5b5061024361075c3660046120d6565b6116cf565b34801561076c575f5ffd5b5060045461056290600160c01b900466ffffffffffffff1681565b348015610792575f5ffd5b506102436107a1366004612264565b61170e565b6107ae611748565b6107b661176b565b6107be611798565b6107c781611b47565b50565b6107d261176b565b6201518066ffffffffffffff8216111561080f57604051632380259f60e11b815266ffffffffffffff821660048201526024015b60405180910390fd5b6004805466ffffffffffffff60c01b1916600160c01b66ffffffffffffff8416908102919091179091556040519081527f1b55d9f7002bda4490f467e326f22a4a847629c0f2d1ed421607d318d25b410d906020015b60405180910390a150565b606060035483111561089857604051630b0b52bb60e11b815260048101849052602401610806565b818311806108a4575082155b806108ad575081155b156108cb5760405163561ce9bb60e01b815260040160405180910390fd5b5f835b83811015610977575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b0316928101929092521580159061094357505f81602001516001600160401b0316115b801561095b575060408101516001600160a01b031615155b1561096e578261096a816122fb565b9350505b506001016108ce565b50806001600160401b0381111561099057610990612096565b6040519080825280602002602001820160405280156109c957816020015b6109b6612063565b8152602001906001900390816109ae5790505b5091505f845b84811015610ad9575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b03169281019290925215801590610a4457505f81602001516001600160401b0316115b8015610a5c575060408101516001600160a01b031615155b15610ad0576040518060800160405280825f015163ffffffff168152602001610a888360200151611db2565b815260200182604001516001600160a01b0316815260200183815250858481518110610ab657610ab6612313565b60200260200101819052508280610acc906122fb565b9350505b506001016109cf565b50505092915050565b6060600354831115610b0a57604051630b0b52bb60e11b815260048101849052602401610806565b60055480841115610b3157604051633839647b60e11b815260048101859052602401610806565b5f845b828111610bfd575f818152600960209081526040918290208251606081018452905463ffffffff81168252600160201b81046001600160401b031692820192909252600160601b9091046001600160a01b0316918101919091528382148015610ba757506001815f015163ffffffff1611155b8015610bbe575060408101516001600160a01b0316155b15610bc95750610bed565b805163ffffffff16861015610bde5750610bfd565b82610be8816122fb565b935050505b610bf6816122fb565b9050610b34565b50806001600160401b03811115610c1657610c16612096565b604051908082528060200260200182016040528015610c4f57816020015b610c3c612063565b815260200190600190039081610c345790505b5092505f855b838111158015610c6457508282105b15610d8c575f818152600960209081526040918290208251606081018452905463ffffffff81168252600160201b81046001600160401b031692820192909252600160601b9091046001600160a01b0316918101919091528482148015610cd557506001815f015163ffffffff1611155b8015610cec575060408101516001600160a01b0316155b15610cf75750610d7c565b805163ffffffff16871015610d0c5750610d8c565b6040518060800160405280825f015163ffffffff168152602001610d338360200151611db2565b815260200182604001516001600160a01b0316815260200183815250868481518110610d6157610d61612313565b60200260200101819052508280610d77906122fb565b935050505b610d85816122fb565b9050610c55565b5050505092915050565b610d9e61176b565b8060ff165f03610dc1576040516349ad5d5360e01b815260040160405180910390fd5b600480546001600160f81b0316600160f81b60ff8416908102919091179091556040519081527fec5ccd96cc77b6219e9d44143df916af68fc169339ea7de5008ff15eae13450d90602001610865565b6060600354821115610e3957604051630b0b52bb60e11b815260048101839052602401610806565b6005545f819003610e5d57604051631e4086cf60e21b815260040160405180910390fd5b600854600160a01b900460ff16158015610e7657505f81115b15610e8957610e86600182612327565b90505b5f815b84821015610f4a575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b03169281019290925215801590610f0157505f81602001516001600160401b0316115b8015610f19575060408101516001600160a01b031615155b15610f2c5782610f28816122fb565b9350505b815f03610f395750610f4a565b50610f438161233a565b9050610e8c565b50806001600160401b03811115610f6357610f63612096565b604051908082528060200260200182016040528015610f9c57816020015b610f89612063565b815260200190600190039081610f815790505b5092505f825b828210156110c1575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b0316928101929092521580159061101757505f81602001516001600160401b0316115b801561102f575060408101516001600160a01b031615155b156110a3576040518060800160405280825f015163ffffffff16815260200161105b8360200151611db2565b815260200182604001516001600160a01b031681526020018381525086848151811061108957611089612313565b6020026020010181905250828061109f906122fb565b9350505b815f036110b057506110c1565b506110ba8161233a565b9050610fa2565b50505050919050565b6110d2611748565b6110da611dd0565b6040805160c08101825260055480825260065460208301526007546001600160401b0380821694840194909452600160401b900490921660608201526008546001600160a01b038116608083015260ff600160a01b9091048116151560a083015260045491926001600160c01b0383169266ffffffffffffff600160c01b82041692600160f81b9091041690851461118857604051632297552d60e11b815260048101869052602401610806565b83606001516001600160401b031642106111b557604051630129799f60e21b815260040160405180910390fd5b826001600160c01b03163410156111df57604051633ddefd2560e21b815260040160405180910390fd5b60648160ff1685602001516111f4919061234f565b6111fe9190612366565b846020015161120d9190612385565b34101561122d57604051634ec82d9560e01b815260040160405180910390fd5b34600655600880546001600160a01b0319163317905560608401515f9066ffffffffffffff8416906112699042906001600160401b0316612327565b86516040805133815234602082015293909210918301829052909250907f1159164c56f277e6fc99c11731bd380e0347deb969b75523398734c252706ea39060600160405180910390a28015611332576112cc66ffffffffffffff841642612385565b64ffffffffff1660608601819052600780546fffffffffffffffff00000000000000001916600160401b83021790558551604051918252907f6e912a3a9105bdd2af817ba5adc14e6c127c1035b5b648faa29ca0d58ab8ff4e9060200160405180910390a25b60808501516001600160a01b0381161561135457611354818760200151611dfa565b5050505050506107c760018055565b61136b61176b565b6001600160a01b038116611392576040516301ed76a760e61b815260040160405180910390fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f6cfddd24d2afc1b9f31d51f0ef77029fdde044799f0a87a2a09b7673b609742290602001610865565b6113e861176b565b6113f15f611f0e565b565b6113fb611748565b61140361176b565b805f0361142357604051636249244960e01b815260040160405180910390fd5b60038190556040518181527fd770aa5d8859528bbc6591dd02a6c17f76c515c44dcb848e8500303042341c1290602001610865565b61146061176b565b6113f1611f5f565b6005546060905f81900361148f57604051631e4086cf60e21b815260040160405180910390fd5b600854600160a01b900460ff161580156114a857505f81115b156114bb576114b8600182612327565b90505b826001600160401b038111156114d3576114d3612096565b6040519080825280602002602001820160405280156114fc578160200160208202803683370190505b50604080516060810182525f8082526020820181905291810182905291935090825b5f8111801561152c57508583105b156115fe575f818152600960209081526040918290208251606081018452905463ffffffff8116808352600160201b82046001600160401b031693830193909352600160601b90046001600160a01b031692810192909252909250158061159e575060408201516001600160a01b0316155b806115b4575060208201516001600160401b0316155b6115ee576115c58260200151611db2565b8584815181106115d7576115d7612313565b60209081029190910101526115eb836122fb565b92505b6115f78161233a565b905061151e565b5081851461161f57604051639ee522a960e01b815260040160405180910390fd5b505050919050565b61162f611fb8565b61163761176b565b61163f611dd0565b611647611798565b6113f160018055565b61165861176b565b806001600160c01b03165f036116815760405163fb33f9b560e01b815260040160405180910390fd5b600480546001600160c01b0319166001600160c01b0383169081179091556040519081527f6ab2e127d7fdf53b8f304e59d3aab5bfe97979f52a85479691a6fab27a28a6b290602001610865565b6116d761176b565b6116df611fda565b6007546001600160401b031615806117005750600854600160a01b900460ff165b156107c7576107c781611b47565b61171661176b565b6001600160a01b03811661173f57604051631e4fbdf760e01b81525f6004820152602401610806565b6107c781611f0e565b5f5460ff16156113f15760405163d93c066560e01b815260040160405180910390fd5b6002546001600160a01b031633146113f15760405163118cdaa760e01b8152336004820152602401610806565b6040516370a0823160e01b81523060048201527f0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b276001600160a01b0316906370a0823190602401602060405180830381865afa1580156117fa573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061181e9190612398565b5f0361183d57604051631e4086cf60e21b815260040160405180910390fd5b6040805160c081018252600554815260065460208201526007546001600160401b03808216938301849052600160401b9091041660608201526008546001600160a01b0381166080830152600160a01b900460ff16151560a0820152905f036118b9576040516322fb799b60e11b815260040160405180910390fd5b8060a00151156118dc57604051634f4fee1760e01b815260040160405180910390fd5b80606001516001600160401b031642101561190a5760405163857889f760e01b815260040160405180910390fd5b6008805460ff60a01b1916600160a01b17905560808101516001600160a01b03166119ba5780516040516323b872dd60e01b815230600482015261dead602482015260448101919091527f0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b276001600160a01b0316906323b872dd906064015f604051808303815f87803b15801561199f575f5ffd5b505af11580156119b1573d5f5f3e3d5ffd5b50505050611a48565b608081015181516040516323b872dd60e01b81523060048201526001600160a01b03928316602482015260448101919091527f0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b27909116906323b872dd906064015f604051808303815f87803b158015611a31575f5ffd5b505af1158015611a43573d5f5f3e3d5ffd5b505050505b5f8160200151118015611a655750600a546001600160a01b031615155b15611a8557600a546020820151611a85916001600160a01b031690611dfa565b80515f908152600960209081526040909120805463ffffffff19164263ffffffff1617815590820151611ab790612012565b8154608084015163ffffffff909116600160201b6001600160401b0393909316929092026bffffffffffffffffffffffff1691909117600160601b6001600160a01b039092169182021782558251602080850151604080519485529184015290917fc9f72b276a388619c6d185d146697036241880c36654b1a3ffdad07c24038d99910160405180910390a25050565b5f81604051602001611b5991906123af565b60408051601f1981840301815290829052805160209091012063eac2aa0960e01b8252600482018190523060248301527f0000000000000000000000000000000000000000000000000000000001e1338060448301526001600160a01b037f000000000000000000000000c23e819766cd5c5f5ec0e1b1764afeba1dc2d03c811660648401525f60848401529092507f0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b27169063eac2aa099060a4016020604051808303815f875af1925050508015611c4e575060408051601f3d908101601f19168201909252611c4b91810190612398565b60015b611cc757611c5a6123c5565b806308c379a003611cbd5750611c6e6123de565b80611c795750611cbf565b611c81611f5f565b7ff63212df4867fef3d461e9b3cb93f7337b231bfb99c82fad9c6eda92d399410581604051611cb09190612460565b60405180910390a1505050565b505b3d5f5f3e3d5ffd5b425f611cf37f000000000000000000000000000000000000000000000000000000000001518083612495565b6040805160c0810182528681525f602080830182905264ffffffffff878116848601819052908616606085018190526080850184905260a090940183905260058a9055600692909255600780546fffffffffffffffffffffffffffffffff19168317600160401b8502179055600880546001600160a81b0319169055835191825281019190915291925085917fd6eddd1118d71820909c1197aa966dbc15ed6f508554252169cc3d5ccac756ca910160405180910390a25050505b5050565b5f611dca6001600160401b0383166305f5e10061234f565b92915050565b600260015403611df357604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b611e04828261204f565b611dae577f0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df86001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b158015611e61575f5ffd5b505af1158015611e73573d5f5f3e3d5ffd5b505060405163a9059cbb60e01b81526001600160a01b038681166004830152602482018690527f0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df816935063a9059cbb925060440190506020604051808303815f875af1158015611ee5573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f0991906124b2565b505050565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b611f67611748565b5f805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f9b3390565b6040516001600160a01b03909116815260200160405180910390a1565b5f5460ff166113f157604051638dfc202b60e01b815260040160405180910390fd5b611fe2611fb8565b5f805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611f9b565b5f806120226305f5e10084612366565b90506001600160401b03811115611dca576040516387a3017d60e01b815260048101849052602401610806565b5f5f5f5f5f5f8688617530f1949350505050565b60405180608001604052805f63ffffffff1681526020015f81526020015f6001600160a01b031681526020015f81525090565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b03811182821017156120cf576120cf612096565b6040525050565b5f602082840312156120e6575f5ffd5b81356001600160401b038111156120fb575f5ffd5b8201601f8101841361210b575f5ffd5b80356001600160401b0381111561212457612124612096565b60405161213b601f8301601f1916602001826120aa565b81815285602083850101111561214f575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f6020828403121561217c575f5ffd5b813566ffffffffffffff81168114612192575f5ffd5b9392505050565b5f5f604083850312156121aa575f5ffd5b50508035926020909101359150565b602080825282518282018190525f918401906040840190835b81811015612222578351805163ffffffff168452602080820151818601526040808301516001600160a01b03169086015260609182015191850191909152909301926080909201916001016121d2565b509095945050505050565b5f6020828403121561223d575f5ffd5b813560ff81168114612192575f5ffd5b5f6020828403121561225d575f5ffd5b5035919050565b5f60208284031215612274575f5ffd5b81356001600160a01b0381168114612192575f5ffd5b602080825282518282018190525f918401906040840190835b818110156122225783518352602093840193909201916001016122a3565b5f602082840312156122d1575f5ffd5b81356001600160c01b0381168114612192575f5ffd5b634e487b7160e01b5f52601160045260245ffd5b5f6001820161230c5761230c6122e7565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b81810381811115611dca57611dca6122e7565b5f81612348576123486122e7565b505f190190565b8082028115828204841417611dca57611dca6122e7565b5f8261238057634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611dca57611dca6122e7565b5f602082840312156123a8575f5ffd5b5051919050565b5f82518060208501845e5f920191825250919050565b5f60033d11156123db5760045f5f3e505f5160e01c5b90565b5f60443d10156123eb5790565b6040513d600319016004823e80513d60248201116001600160401b038211171561241457505090565b80820180516001600160401b0381111561242f575050505090565b3d8401600319018282016020011115612449575050505090565b612458602082850101856120aa565b509392505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b64ffffffffff8181168382160190811115611dca57611dca6122e7565b5f602082840312156124c2575f5ffd5b81518015158114612192575f5ffdfea26469706673582212203009cf90cc47ae5ae0cb7346d0212518a26ad1c5e4850e8336d61e2dfc964a6d64736f6c634300081c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b27000000000000000000000000c23e819766cd5c5f5ec0e1b1764afeba1dc2d03c0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df800000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000001e133800000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dd860bb53d040ad9fbd868c345d18f820a3cd9bc

-----Decoded View---------------
Arg [0] : base_ (address): 0x5ede4408e78c36C3AB16C5813c418624C2823b27
Arg [1] : resolver_ (address): 0xC23e819766cD5C5F5ec0E1B1764aFeba1dc2D03C
Arg [2] : weth_ (address): 0x7507c1dc16935B82698e4C63f2746A2fCf994dF8
Arg [3] : auctionDuration_ (uint256): 86400
Arg [4] : registrationDuration_ (uint256): 31536000
Arg [5] : reservePrice_ (uint192): 1000000000000000000
Arg [6] : timeBuffer_ (uint56): 10
Arg [7] : minBidIncrementPercentage_ (uint8): 1
Arg [8] : paymentReceiver_ (address): 0xDd860bB53d040ad9fbd868c345d18F820a3CD9bc

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000005ede4408e78c36c3ab16c5813c418624c2823b27
Arg [1] : 000000000000000000000000c23e819766cd5c5f5ec0e1b1764afeba1dc2d03c
Arg [2] : 0000000000000000000000007507c1dc16935b82698e4c63f2746a2fcf994df8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [4] : 0000000000000000000000000000000000000000000000000000000001e13380
Arg [5] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [8] : 000000000000000000000000dd860bb53d040ad9fbd868c345d18f820a3cd9bc


Deployed Bytecode Sourcemap

924:20549:14:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1381:45;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;206:32:43;;;188:51;;176:2;161:18;1381:45:14;;;;;;;;4260:171;;;;;;;;;;-1:-1:-1;4260:171:14;;;;;:::i;:::-;;:::i;:::-;;7966:273;;;;;;;;;;-1:-1:-1;7966:273:14;;;;;:::i;:::-;;:::i;1572:40::-;;;;;;;;;;;;;;;;;;1875:25:43;;;1863:2;1848:18;1572:40:14;1729:177:43;1755:30:14;;;;;;;;;;;;;;;;19346:1499;;;;;;;;;;-1:-1:-1;19346:1499:14;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;17087:1679::-;;;;;;;;;;-1:-1:-1;17087:1679:14;;;;;:::i;:::-;;:::i;8738:366::-;;;;;;;;;;-1:-1:-1;8738:366:14;;;;;:::i;:::-;;:::i;1482:27::-;;;;;;;;;;;;;;;13351:1729;;;;;;;;;;-1:-1:-1;13351:1729:14;;;;;:::i;:::-;;:::i;1267:35::-;;;;;;;;;;;;;;;1850:84:7;;;;;;;;;;-1:-1:-1;1897:4:7;1920:7;;;1850:84;;4296:14:43;;4289:22;4271:41;;4259:2;4244:18;1850:84:7;4131:187:43;5086:1587:14;;;;;;:::i;:::-;;:::i;9355:256::-;;;;;;;;;;-1:-1:-1;9355:256:14;;;;;:::i;:::-;;:::i;2293:101:0:-;;;;;;;;;;;;;:::i;6735:379:14:-;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6814:293:14;;;;;;;;6849:14;:22;6814:293;;6893:21;;6814:293;;;;6939:24;;-1:-1:-1;;;;;6939:24:14;;;6814:293;;;;;;;-1:-1:-1;;;6986:22:14;;;;;6814:293;;;;6986:22;7030:21;-1:-1:-1;;;;;7030:21:14;;6814:293;;;;-1:-1:-1;;;7074:22:14;;;;6814:293;;;;;;;6735:379;;;;;;;4764:4:43;4806:3;4795:9;4791:19;4783:27;;4843:6;4837:13;4826:9;4819:32;4907:4;4899:6;4895:17;4889:24;4882:4;4871:9;4867:20;4860:54;-1:-1:-1;;;;;4974:4:43;4966:6;4962:17;4956:24;4952:49;4945:4;4934:9;4930:20;4923:79;-1:-1:-1;;;;;5062:4:43;5054:6;5050:17;5044:24;5040:49;5033:4;5022:9;5018:20;5011:79;5175:1;5171;5166:3;5162:11;5158:19;5150:4;5142:6;5138:17;5132:24;5128:50;5121:4;5110:9;5106:20;5099:80;5249:4;5241:6;5237:17;5231:24;5224:32;5217:40;5210:4;5199:9;5195:20;5188:70;4614:650;;;;;4686:261:14;;;;;;;;;;-1:-1:-1;4686:261:14;;;;;:::i;:::-;;:::i;7367:70::-;;;;;;;;;;;;;:::i;1132:47::-;;;;;;;;;;;;1173:6;1132:47;;;;;5443:16:43;5431:29;;;5413:48;;5401:2;5386:18;1132:47:14;5269:198:43;1638:85:0;;;;;;;;;;-1:-1:-1;1710:6:0;;-1:-1:-1;;;;;1710:6:0;1638:85;;15599:1047:14;;;;;;;;;;-1:-1:-1;15599:1047:14;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;2181:47::-;;;;;;;;;;-1:-1:-1;2181:47:14;;;;;;;;;;;;-1:-1:-1;;;;;2181:47:14;;;;-1:-1:-1;;;2181:47:14;;;;;-1:-1:-1;;;;;2181:47:14;;;-1:-1:-1;;;2181:47:14;;;;;;;;;;6589:25:43;;;6645:2;6630:18;;6623:34;;;;-1:-1:-1;;;;;6693:31:43;;;6673:18;;;6666:59;;;;6761:31;;6756:2;6741:18;;6734:59;-1:-1:-1;;;;;6830:32:43;6824:3;6809:19;;6802:61;6907:14;6900:22;6850:3;6879:19;;6872:51;6576:3;6561:19;2181:47:14;6296:633:43;4570:110:14;;;;;;;;;;;;;:::i;2101:38::-;;;;;;;;;;-1:-1:-1;2101:38:14;;;;-1:-1:-1;;;2101:38:14;;;;;;;;;7106:4:43;7094:17;;;7076:36;;7064:2;7049:18;2101:38:14;6934:184:43;8347:264:14;;;;;;;;;;-1:-1:-1;8347:264:14;;;;;:::i;:::-;;:::i;2414:30::-;;;;;;;;;;-1:-1:-1;2414:30:14;;;;-1:-1:-1;;;;;2414:30:14;;;1849:27;;;;;;;;;;-1:-1:-1;1849:27:14;;;;-1:-1:-1;;;;;1849:27:14;;;;;;-1:-1:-1;;;;;7578:32:43;;;7560:51;;7548:2;7533:18;1849:27:14;7414:203:43;1618:45:14;;;;;;;;;;;;;;;7648:212;;;;;;;;;;-1:-1:-1;7648:212:14;;;;;:::i;:::-;;:::i;1972:24::-;;;;;;;;;;-1:-1:-1;1972:24:14;;;;-1:-1:-1;;;1972:24:14;;;;;;2543:215:0;;;;;;;;;;-1:-1:-1;2543:215:0;;;;;:::i;:::-;;:::i;4260:171:14:-;1474:19:7;:17;:19::i;:::-;1531:13:0::1;:11;:13::i;:::-;4376:16:14::2;:14;:16::i;:::-;4402:22;4417:6;4402:14;:22::i;:::-;4260:171:::0;:::o;7966:273::-;1531:13:0;:11;:13::i;:::-;1173:6:14::1;8051:29;::::0;::::1;;8047:98;;;8103:31;::::0;-1:-1:-1;;;8103:31:14;;5443:16:43;5431:29;;8103:31:14::1;::::0;::::1;5413:48:43::0;5386:18;;8103:31:14::1;;;;;;;;8047:98;8155:10;:24:::0;;-1:-1:-1;;;;8155:24:14::1;-1:-1:-1::0;;;8155:24:14::1;::::0;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;8195:37:::1;::::0;5413:48:43;;;8195:37:14::1;::::0;5401:2:43;5386:18;8195:37:14::1;;;;;;;;7966:273:::0;:::o;19346:1499::-;19425:31;19482:15;;19472:7;:25;19468:70;;;19506:32;;-1:-1:-1;;;19506:32:14;;;;;1875:25:43;;;1848:18;;19506:32:14;1729:177:43;19468:70:14;19562:5;19552:7;:15;:31;;;-1:-1:-1;19571:12:14;;19552:31;:45;;;-1:-1:-1;19587:10:14;;19552:45;19548:72;;;19606:14;;-1:-1:-1;;;19606:14:14;;;;;;;;;;;19548:72;19678:18;19728:7;19710:330;19742:5;19737:2;:10;19710:330;;;19769:38;19810:21;;;:17;:21;;;;;;;;;19769:62;;;;;;;;;;;;;;;-1:-1:-1;;;19769:62:14;;-1:-1:-1;;;;;19769:62:14;;;;;;;;-1:-1:-1;;;19769:62:14;;-1:-1:-1;;;;;19769:62:14;;;;;;;;19866:34;;;;:64;;;19929:1;19904:15;:22;;;-1:-1:-1;;;;;19904:26:14;;19866:64;:104;;;;-1:-1:-1;19934:22:14;;;;-1:-1:-1;;;;;19934:36:14;;;19866:104;19845:185;;;20003:12;;;;:::i;:::-;;;;19845:185;-1:-1:-1;19749:4:14;;19710:330;;;;20130:10;-1:-1:-1;;;;;20113:28:14;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;20099:42:14;-1:-1:-1;20191:13:14;20236:7;20218:621;20250:5;20245:2;:10;20218:621;;;20277:38;20318:21;;;:17;:21;;;;;;;;;20277:62;;;;;;;;;;;;;;;-1:-1:-1;;;20277:62:14;;-1:-1:-1;;;;;20277:62:14;;;;;;;;-1:-1:-1;;;20277:62:14;;-1:-1:-1;;;;;20277:62:14;;;;;;;;20374:34;;;;:64;;;20437:1;20412:15;:22;;;-1:-1:-1;;;;;20412:26:14;;20374:64;:104;;;;-1:-1:-1;20442:22:14;;;;-1:-1:-1;;;;;20442:36:14;;;20374:104;20353:476;;;20532:257;;;;;;;;20581:15;:30;;;20532:257;;;;;;20641:44;20662:15;:22;;;20641:20;:44::i;:::-;20532:257;;;;20715:15;:22;;;-1:-1:-1;;;;;20532:257:14;;;;;20768:2;20532:257;;;20511:11;20523:5;20511:18;;;;;;;;:::i;:::-;;;;;;:278;;;;20807:7;;;;;:::i;:::-;;;;20353:476;-1:-1:-1;20257:4:14;;20218:621;;;;19458:1387;;19346:1499;;;;:::o;17087:1679::-;17212:31;17273:15;;17263:7;:25;17259:70;;;17297:32;;-1:-1:-1;;;17297:32:14;;;;;1875:25:43;;;1848:18;;17297:32:14;1729:177:43;17259:70:14;17356:14;:22;17392:15;;;17388:52;;;17416:24;;-1:-1:-1;;;17416:24:14;;;;;1875:25:43;;;1848:18;;17416:24:14;1729:177:43;17388:52:14;17498:18;17548:7;17530:381;17563:5;17557:2;:11;17530:381;;17590:38;17631:21;;;:17;:21;;;;;;;;;17590:62;;;;;;;;;;;;;;-1:-1:-1;;;17590:62:14;;-1:-1:-1;;;;;17590:62:14;;;;;;;;-1:-1:-1;;;17590:62:14;;;-1:-1:-1;;;;;17590:62:14;;;;;;;;17671:11;;;:50;;;;;17720:1;17686:15;:30;;;:35;;;;17671:50;:90;;;;-1:-1:-1;17725:22:14;;;;-1:-1:-1;;;;;17725:36:14;;17671:90;17667:137;;;17781:8;;;17667:137;17822:30;;:45;;;-1:-1:-1;17818:56:14;;;17869:5;;;17818:56;17888:12;;;;:::i;:::-;;;;17576:335;17530:381;17570:4;;;:::i;:::-;;;17530:381;;;;18001:10;-1:-1:-1;;;;;17984:28:14;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;17970:42:14;-1:-1:-1;18062:13:14;18107:7;18089:671;18122:5;18116:2;:11;;:33;;;;;18139:10;18131:5;:18;18116:33;18089:671;;;18171:38;18212:21;;;:17;:21;;;;;;;;;18171:62;;;;;;;;;;;;;;-1:-1:-1;;;18171:62:14;;-1:-1:-1;;;;;18171:62:14;;;;;;;;-1:-1:-1;;;18171:62:14;;;-1:-1:-1;;;;;18171:62:14;;;;;;;;18252:11;;;:50;;;;;18301:1;18267:15;:30;;;:35;;;;18252:50;:90;;;;-1:-1:-1;18306:22:14;;;;-1:-1:-1;;;;;18306:36:14;;18252:90;18248:137;;;18362:8;;;18248:137;18403:30;;:45;;;-1:-1:-1;18399:56:14;;;18450:5;;;18399:56;18491:237;;;;;;;;18536:15;:30;;;18491:237;;;;;;18592:44;18613:15;:22;;;18592:20;:44::i;:::-;18491:237;;;;18662:15;:22;;;-1:-1:-1;;;;;18491:237:14;;;;;18711:2;18491:237;;;18470:11;18482:5;18470:18;;;;;;;;:::i;:::-;;;;;;:258;;;;18742:7;;;;;:::i;:::-;;;;18157:603;18089:671;18151:4;;;:::i;:::-;;;18089:671;;;;17249:1517;;;17087:1679;;;;:::o;8738:366::-;1531:13:0;:11;:13::i;:::-;8852:26:14::1;:31;;8882:1;8852:31:::0;8848:102:::1;;8906:33;;-1:-1:-1::0;;;8906:33:14::1;;;;;;;;;;;8848:102;8960:25;:54:::0;;-1:-1:-1;;;;;8960:54:14::1;-1:-1:-1::0;;;8960:54:14::1;::::0;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;9030:67:::1;::::0;7076:36:43;;;9030:67:14::1;::::0;7064:2:43;7049:18;9030:67:14::1;6934:184:43::0;13351:1729:14;13420:31;13482:15;;13467:12;:30;13463:80;;;13506:37;;-1:-1:-1;;;13506:37:14;;;;;1875:25:43;;;1848:18;;13506:37:14;1729:177:43;13463:80:14;13578:14;:22;13554:21;13614:18;;;13610:43;;13641:12;;-1:-1:-1;;;13641:12:14;;;;;;;;;;;13610:43;13669:22;;-1:-1:-1;;;13669:22:14;;;;13668:23;:44;;;;;13711:1;13695:13;:17;13668:44;13664:93;;;13728:18;13745:1;13728:18;;:::i;:::-;;;13664:93;13814:18;13864:13;13846:383;13892:12;13879:10;:25;13846:383;;;13926:38;13967:21;;;:17;:21;;;;;;;;;13926:62;;;;;;;;;;;;;;;-1:-1:-1;;;13926:62:14;;-1:-1:-1;;;;;13926:62:14;;;;;;;;-1:-1:-1;;;13926:62:14;;-1:-1:-1;;;;;13926:62:14;;;;;;;;14023:34;;;;:64;;;14086:1;14061:15;:22;;;-1:-1:-1;;;;;14061:26:14;;14023:64;:104;;;;-1:-1:-1;14091:22:14;;;;-1:-1:-1;;;;;14091:36:14;;;14023:104;14002:185;;;14160:12;;;;:::i;:::-;;;;14002:185;14204:2;14210:1;14204:7;14200:18;;14213:5;;;14200:18;-1:-1:-1;13906:4:14;;;:::i;:::-;;;13846:383;;;;14319:10;-1:-1:-1;;;;;14302:28:14;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;14288:42:14;-1:-1:-1;14380:13:14;14425;14407:667;14448:10;14440:5;:18;14407:667;;;14480:38;14521:21;;;:17;:21;;;;;;;;;14480:62;;;;;;;;;;;;;;;-1:-1:-1;;;14480:62:14;;-1:-1:-1;;;;;14480:62:14;;;;;;;;-1:-1:-1;;;14480:62:14;;-1:-1:-1;;;;;14480:62:14;;;;;;;;14577:34;;;;:64;;;14640:1;14615:15;:22;;;-1:-1:-1;;;;;14615:26:14;;14577:64;:104;;;;-1:-1:-1;14645:22:14;;;;-1:-1:-1;;;;;14645:36:14;;;14577:104;14556:476;;;14735:257;;;;;;;;14784:15;:30;;;14735:257;;;;;;14844:44;14865:15;:22;;;14844:20;:44::i;:::-;14735:257;;;;14918:15;:22;;;-1:-1:-1;;;;;14735:257:14;;;;;14971:2;14735:257;;;14714:11;14726:5;14714:18;;;;;;;;:::i;:::-;;;;;;:278;;;;15010:7;;;;;:::i;:::-;;;;14556:476;15049:2;15055:1;15049:7;15045:18;;15058:5;;;15045:18;-1:-1:-1;14460:4:14;;;:::i;:::-;;;14407:667;;;;13453:1627;;;13351:1729;;;:::o;5086:1587::-;1474:19:7;:17;:19::i;:::-;2356:21:8::1;:19;:21::i;:::-;5185:58:14::2;::::0;;::::2;::::0;::::2;::::0;;5229:14:::2;5185:58:::0;;;;;;::::2;::::0;::::2;::::0;;;-1:-1:-1;;;;;5185:58:14;;::::2;::::0;;;;;;;-1:-1:-1;;;5185:58:14;::::2;::::0;;::::2;::::0;;;;::::2;::::0;-1:-1:-1;;;;;5185:58:14;::::2;::::0;;;;::::2;-1:-1:-1::0;;;5185:58:14;;::::2;::::0;::::2;;;::::0;;;;5347:12:::2;::::0;5185:58;;-1:-1:-1;;;;;5347:12:14;::::2;::::0;5361:10:::2;-1:-1:-1::0;;;5361:10:14;::::2;;::::0;-1:-1:-1;;;5373:25:14;;::::2;;::::0;5414:27;::::2;5410:94;;5464:29;::::0;-1:-1:-1;;;5464:29:14;;::::2;::::0;::::2;1875:25:43::0;;;1848:18;;5464:29:14::2;1729:177:43::0;5410:94:14::2;5537:8;:16;;;-1:-1:-1::0;;;;;5518:35:14::2;:15;:35;5514:89;;5576:16;;-1:-1:-1::0;;;5576:16:14::2;;;;;;;;;;;5514:89;5629:13;-1:-1:-1::0;;;;;5617:25:14::2;:9;:25;5613:92;;;5665:29;;-1:-1:-1::0;;;5665:29:14::2;;;;;;;;;;;5613:92;5799:3;5769:26;5751:44;;:8;:15;;;:44;;;;:::i;:::-;5750:52;;;;:::i;:::-;5731:8;:15;;;:72;;;;:::i;:::-;5719:9;:84;5715:180;;;5826:58;;-1:-1:-1::0;;;5826:58:14::2;;;;;;;;;;;5715:180;5928:9;5904:21:::0;:33;5947:21;:43;;-1:-1:-1;;;;;;5947:43:14::2;5979:10;5947:43;::::0;;6115:16:::2;::::0;::::2;::::0;5947:21:::2;::::0;6115:48:::2;::::0;::::2;::::0;:34:::2;::::0;6134:15:::2;::::0;-1:-1:-1;;;;;6115:34:14::2;;:::i;:::-;6190:16:::0;;6179:61:::2;::::0;;6208:10:::2;9416:51:43::0;;6220:9:14::2;9498:2:43::0;9483:18;;9476:34;6115:48:14;;;::::2;9526:18:43::0;;;9519:50;;;6115:48:14;;-1:-1:-1;6190:16:14;6179:61:::2;::::0;9404:2:43;9389:18;6179:61:14::2;;;;;;;6255:8;6251:190;;;6330:29;;::::0;::::2;:15;:29;:::i;:::-;6304:56;;:16;::::0;::::2;:56:::0;;;6279:22;:81;;-1:-1:-1;;6279:81:14::2;-1:-1:-1::0;;;6279:81:14;::::2;;::::0;;6395:16;;6379:51:::2;::::0;9725:50:43;;;6395:16:14;6379:51:::2;::::0;9713:2:43;9698:18;6379:51:14::2;;;;;;;6251:190;6480:15;::::0;::::2;::::0;-1:-1:-1;;;;;6559:24:14;::::2;::::0;6555:112:::2;;6599:57;6628:10;6640:8;:15;;;6599:28;:57::i;:::-;5175:1498;;;;;;2398:20:8::1;1713:1:::0;2924:21;;2744:208;9355:256:14;1531:13:0;:11;:13::i;:::-;-1:-1:-1;;;;;9442:30:14;::::1;9438:67;;9481:24;;-1:-1:-1::0;;;9481:24:14::1;;;;;;;;;;;9438:67;9515:15;:34:::0;;-1:-1:-1;;;;;;9515:34:14::1;-1:-1:-1::0;;;;;9515:34:14;::::1;::::0;;::::1;::::0;;;9564:40:::1;::::0;188:51:43;;;9564:40:14::1;::::0;176:2:43;161:18;9564:40:14::1;14:231:43::0;2293:101:0;1531:13;:11;:13::i;:::-;2357:30:::1;2384:1;2357:18;:30::i;:::-;2293:101::o:0;4686:261:14:-;1474:19:7;:17;:19::i;:::-;1531:13:0::1;:11;:13::i;:::-;4787:16:14::2;4807:1;4787:21:::0;4783:57:::2;;4817:23;;-1:-1:-1::0;;;4817:23:14::2;;;;;;;;;;;4783:57;4851:15;:34:::0;;;4901:39:::2;::::0;1875:25:43;;;4901:39:14::2;::::0;1863:2:43;1848:18;4901:39:14::2;1729:177:43::0;7367:70:14;1531:13:0;:11;:13::i;:::-;7422:8:14::1;:6;:8::i;15599:1047::-:0;15722:14;:22;15663:23;;15698:21;15758:18;;;15754:43;;15785:12;;-1:-1:-1;;;15785:12:14;;;;;;;;;;;15754:43;15813:22;;-1:-1:-1;;;15813:22:14;;;;15812:23;:44;;;;;15855:1;15839:13;:17;15812:44;15808:93;;;15872:18;15889:1;15872:18;;:::i;:::-;;;15808:93;15934:12;-1:-1:-1;;;;;15920:27:14;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15920:27:14;-1:-1:-1;;;;;;;;;15957:19:14;-1:-1:-1;;;;;;;;;;;;;;;15911:36:14;;-1:-1:-1;15957:19:14;16057:13;16039:508;16077:1;16072:2;:6;:36;;;;;16096:12;16082:11;:26;16072:36;16039:508;;;16148:21;;;;:17;:21;;;;;;;;;16130:39;;;;;;;;;;;;;;;-1:-1:-1;;;16130:39:14;;-1:-1:-1;;;;;16130:39:14;;;;;;;;-1:-1:-1;;;16130:39:14;;-1:-1:-1;;;;;16130:39:14;;;;;;;;;;-1:-1:-1;16247:35:14;;:75;;-1:-1:-1;16286:22:14;;;;-1:-1:-1;;;;;16286:36:14;;16247:75;:126;;;-1:-1:-1;16346:22:14;;;;-1:-1:-1;;;;;16346:27:14;;16247:126;16406:8;16226:203;16465:44;16486:15;:22;;;16465:20;:44::i;:::-;16443:6;16450:11;16443:19;;;;;;;;:::i;:::-;;;;;;;;;;:66;16523:13;;;:::i;:::-;;;16039:508;16110:4;;;:::i;:::-;;;16039:508;;;;16577:11;16561:12;:27;16557:83;;16611:18;;-1:-1:-1;;;16611:18:14;;;;;;;;;;;16557:83;15688:958;;;15599:1047;;;:::o;4570:110::-;1721:16:7;:14;:16::i;:::-;1531:13:0::1;:11;:13::i;:::-;2356:21:8::2;:19;:21::i;:::-;4657:16:14::3;:14;:16::i;:::-;2398:20:8::2;1713:1:::0;2924:21;;2744:208;8347:264:14;1531:13:0;:11;:13::i;:::-;8437::14::1;-1:-1:-1::0;;;;;8437:18:14::1;8454:1;8437:18:::0;8433:77:::1;;8478:21;;-1:-1:-1::0;;;8478:21:14::1;;;;;;;;;;;8433:77;8519:12;:28:::0;;-1:-1:-1;;;;;;8519:28:14::1;-1:-1:-1::0;;;;;8519:28:14;::::1;::::0;;::::1;::::0;;;8563:41:::1;::::0;7560:51:43;;;8563:41:14::1;::::0;7548:2:43;7533:18;8563:41:14::1;7414:203:43::0;7648:212:14;1531:13:0;:11;:13::i;:::-;7725:10:14::1;:8;:10::i;:::-;7750:24:::0;;-1:-1:-1;;;;;7750:24:14::1;:29:::0;;:55:::1;;-1:-1:-1::0;7783:22:14;;-1:-1:-1;;;7783:22:14;::::1;;;7750:55;7746:108;;;7821:22;7836:6;7821:14;:22::i;2543:215:0:-:0;1531:13;:11;:13::i;:::-;-1:-1:-1;;;;;2627:22:0;::::1;2623:91;;2672:31;::::0;-1:-1:-1;;;2672:31:0;;2700:1:::1;2672:31;::::0;::::1;188:51:43::0;161:18;;2672:31:0::1;14:231:43::0;2623:91:0::1;2723:28;2742:8;2723:18;:28::i;2002:128:7:-:0;1897:4;1920:7;;;2063:61;;;2098:15;;-1:-1:-1;;;2098:15:7;;;;;;;;;;;1796:162:0;1710:6;;-1:-1:-1;;;;;1710:6:0;735:10:6;1855:23:0;1851:101;;1901:40;;-1:-1:-1;;;1901:40:0;;735:10:6;1901:40:0;;;188:51:43;161:18;;1901:40:0;14:231:43;10889:1240:14;10938:29;;-1:-1:-1;;;10938:29:14;;10961:4;10938:29;;;188:51:43;10938:4:14;-1:-1:-1;;;;;10938:14:14;;;;161:18:43;;10938:29:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;10971:1;10938:34;10934:59;;10981:12;;-1:-1:-1;;;10981:12:14;;;;;;;;;;;10934:59;11004:58;;;;;;;;11048:14;11004:58;;;;;;;;;;;-1:-1:-1;;;;;11004:58:14;;;;;;;;;-1:-1:-1;;;11004:58:14;;;;;;;;;;-1:-1:-1;;;;;11004:58:14;;;;;;-1:-1:-1;;;11004:58:14;;;;;;;;;;;-1:-1:-1;11077:23:14;11073:78;;11123:17;;-1:-1:-1;;;11123:17:14;;;;;;;;;;;11073:78;11164:8;:16;;;11160:77;;;11203:23;;-1:-1:-1;;;11203:23:14;;;;;;;;;;;11160:77;11268:8;:16;;;-1:-1:-1;;;;;11250:34:14;:15;:34;11246:93;;;11307:21;;-1:-1:-1;;;11307:21:14;;;;;;;;;;;11246:93;11349:22;:29;;-1:-1:-1;;;;11349:29:14;-1:-1:-1;;;11349:29:14;;;11393:15;;;;-1:-1:-1;;;;;11393:29:14;11389:225;;11488:16;;11438:67;;-1:-1:-1;;;11438:67:14;;11464:4;11438:67;;;10385:51:43;11479:6:14;10452:18:43;;;10445:60;10521:18;;;10514:34;;;;11438:4:14;-1:-1:-1;;;;;11438:17:14;;;;10358:18:43;;11438:67:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11389:225;;;11569:15;;;;11586:16;;11536:67;;-1:-1:-1;;;11536:67:14;;11562:4;11536:67;;;10385:51:43;-1:-1:-1;;;;;10472:32:43;;;10452:18;;;10445:60;10521:18;;;10514:34;;;;11536:4:14;:17;;;;;;10358:18:43;;11536:67:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11389:225;11646:1;11628:8;:15;;;:19;:52;;;;-1:-1:-1;11651:15:14;;-1:-1:-1;;;;;11651:15:14;:29;;11628:52;11624:145;;;11725:15;;11742;;;;11696:62;;-1:-1:-1;;;;;11725:15:14;;11696:28;:62::i;:::-;11839:16;;11779:39;11821:35;;;:17;:35;;;;;;;;11866:56;;-1:-1:-1;;11866:56:14;11906:15;11866:56;;;;;11974:15;;;;11957:33;;:16;:33::i;:::-;11932:58;;12025:15;;;;12000:40;;;;-1:-1:-1;;;;;;;;11932:58:14;;;;;;;;12000:40;;;;;;-1:-1:-1;;;;;;;;12000:40:14;;;;;;;;;12071:16;;12106:15;;;;;12056:66;;;11125:51:43;;;11192:18;;;11185:34;12071:16:14;;12056:66;;11098:18:43;12056:66:14;;;;;;;10924:1205;;10889:1240::o;9924:804::-;9989:10;10037:6;10020:24;;;;;;;;:::i;:::-;;;;-1:-1:-1;;10020:24:14;;;;;;;;;;10010:35;;10020:24;10010:35;;;;-1:-1:-1;;;10060:86:14;;;;;11804:25:43;;;10096:4:14;11845:18:43;;;11838:60;10103:20:14;11914:18:43;;;11907:34;-1:-1:-1;;;;;10133:8:14;11977:32:43;;11957:18;;;11950:60;-1:-1:-1;12026:19:43;;;12019:60;10010:35:14;;-1:-1:-1;10060:4:14;:23;;;;11776:19:43;;10060:86:14;;;;;;;;;;;;;;;;;;;-1:-1:-1;10060:86:14;;;;;;;;-1:-1:-1;;10060:86:14;;;;;;;;;;;;:::i;:::-;;;10056:666;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;10656:8;:6;:8::i;:::-;10683:28;10704:6;10683:28;;;;;;:::i;:::-;;;;;;;;10608:114;9979:749;9924:804;:::o;10056:666::-;;;;;;;;;;;10205:15;10179:16;10252:35;10271:15;10205;10252:35;:::i;:::-;10319:219;;;;;;;;;;;-1:-1:-1;10319:219:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10302:14;:236;;;;;;;;;;;-1:-1:-1;;10302:236:14;;;-1:-1:-1;;;10302:236:14;;;;;;;;-1:-1:-1;;;;;;10302:236:14;;;10558:38;;13680:44:43;;;13740:18;;13733:53;;;;10319:219:14;;-1:-1:-1;10319:219:14;;10558:38;;13653:18:43;10558:38:14;;;;;;;10165:442;;10147:460;10056:666;9979:749;9924:804;:::o;21351:120::-;21418:7;21444:20;-1:-1:-1;;;;;21444:14:14;;21461:3;21444:20;:::i;:::-;21437:27;21351:120;-1:-1:-1;;21351:120:14:o;2431:307:8:-;1755:1;2558:7;;:18;2554:86;;2599:30;;-1:-1:-1;;;2599:30:8;;;;;;;;;;;2554:86;1755:1;2714:7;:17;2431:307::o;12245:219:14:-;12335:28;12352:2;12356:6;12335:16;:28::i;:::-;12330:128;;12379:4;-1:-1:-1;;;;;12379:12:14;;12399:6;12379:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;12422:25:14;;-1:-1:-1;;;12422:25:14;;-1:-1:-1;;;;;11143:32:43;;;12422:25:14;;;11125:51:43;11192:18;;;11185:34;;;12422:4:14;:13;;-1:-1:-1;12422:13:14;;-1:-1:-1;11098:18:43;;;-1:-1:-1;12422:25:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;12245:219;;:::o;2912:187:0:-;3004:6;;;-1:-1:-1;;;;;3020:17:0;;;-1:-1:-1;;;;;;3020:17:0;;;;;;;3052:40;;3004:6;;;3020:17;3004:6;;3052:40;;2985:16;;3052:40;2975:124;2912:187;:::o;2463:115:7:-;1474:19;:17;:19::i;:::-;2522:7:::1;:14:::0;;-1:-1:-1;;2522:14:7::1;2532:4;2522:14;::::0;;2551:20:::1;2558:12;735:10:6::0;;656:96;2558:12:7::1;2551:20;::::0;-1:-1:-1;;;;;206:32:43;;;188:51;;176:2;161:18;2551:20:7::1;;;;;;;2463:115::o:0;2202:126::-;1897:4;1920:7;;;2260:62;;2296:15;;-1:-1:-1;;;2296:15:7;;;;;;;;;;;2710:117;1721:16;:14;:16::i;:::-;2778:5:::1;2768:15:::0;;-1:-1:-1;;2768:15:7::1;::::0;;2798:22:::1;735:10:6::0;2807:12:7::1;656:96:6::0;21016:236:14;21083:6;;21118:14;21129:3;21118:8;:14;:::i;:::-;21101:31;-1:-1:-1;;;;;;21146:25:14;;21142:71;;;21180:33;;-1:-1:-1;;;21180:33:14;;;;;1875:25:43;;;1848:18;;21180:33:14;1729:177:43;12611:217:14;12682:4;12698:12;12786:1;12783;12780;12777;12770:5;12766:2;12759:5;12754:34;12743:45;12611:217;-1:-1:-1;;;;12611:217:14:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;250:127:43:-;311:10;306:3;302:20;299:1;292:31;342:4;339:1;332:15;366:4;363:1;356:15;382:249;492:2;473:13;;-1:-1:-1;;469:27:43;457:40;;-1:-1:-1;;;;;512:34:43;;548:22;;;509:62;506:88;;;574:18;;:::i;:::-;610:2;603:22;-1:-1:-1;;382:249:43:o;636:801::-;705:6;758:2;746:9;737:7;733:23;729:32;726:52;;;774:1;771;764:12;726:52;814:9;801:23;-1:-1:-1;;;;;839:6:43;836:30;833:50;;;879:1;876;869:12;833:50;902:22;;955:4;947:13;;943:27;-1:-1:-1;933:55:43;;984:1;981;974:12;933:55;1024:2;1011:16;-1:-1:-1;;;;;1042:6:43;1039:30;1036:56;;;1072:18;;:::i;:::-;1121:2;1115:9;1133:69;1192:2;1169:17;;-1:-1:-1;;1165:31:43;1198:2;1161:40;1115:9;1133:69;:::i;:::-;1226:6;1218;1211:22;1274:7;1269:2;1260:6;1256:2;1252:15;1248:24;1245:37;1242:57;;;1295:1;1292;1285:12;1242:57;1351:6;1346:2;1342;1338:11;1333:2;1325:6;1321:15;1308:50;1404:1;1378:19;;;1399:2;1374:28;1367:39;;;;1382:6;636:801;-1:-1:-1;;;;636:801:43:o;1442:282::-;1500:6;1553:2;1541:9;1532:7;1528:23;1524:32;1521:52;;;1569:1;1566;1559:12;1521:52;1608:9;1595:23;1658:16;1651:5;1647:28;1640:5;1637:39;1627:67;;1690:1;1687;1680:12;1627:67;1713:5;1442:282;-1:-1:-1;;;1442:282:43:o;1911:346::-;1979:6;1987;2040:2;2028:9;2019:7;2015:23;2011:32;2008:52;;;2056:1;2053;2046:12;2008:52;-1:-1:-1;;2101:23:43;;;2221:2;2206:18;;;2193:32;;-1:-1:-1;1911:346:43:o;2262:907::-;2508:2;2520:21;;;2590:13;;2493:18;;;2612:22;;;2460:4;;2691:15;;;2665:2;2650:18;;;2460:4;2734:409;2748:6;2745:1;2742:13;2734:409;;;2807:13;;2849:9;;2860:10;2845:26;2833:39;;2920:2;2912:11;;;2906:18;2892:12;;;2885:40;2977:2;2969:11;;;2963:18;-1:-1:-1;;;;;2959:44:43;2945:12;;;2938:66;3054:4;3046:13;;;3040:20;3024:14;;;3017:44;;;;3118:15;;;;3090:4;3081:14;;;;3000:1;2763:9;2734:409;;;-1:-1:-1;3160:3:43;;2262:907;-1:-1:-1;;;;;2262:907:43:o;3174:269::-;3231:6;3284:2;3272:9;3263:7;3259:23;3255:32;3252:52;;;3300:1;3297;3290:12;3252:52;3339:9;3326:23;3389:4;3382:5;3378:16;3371:5;3368:27;3358:55;;3409:1;3406;3399:12;3670:226;3729:6;3782:2;3770:9;3761:7;3757:23;3753:32;3750:52;;;3798:1;3795;3788:12;3750:52;-1:-1:-1;3843:23:43;;3670:226;-1:-1:-1;3670:226:43:o;4323:286::-;4382:6;4435:2;4423:9;4414:7;4410:23;4406:32;4403:52;;;4451:1;4448;4441:12;4403:52;4477:23;;-1:-1:-1;;;;;4529:31:43;;4519:42;;4509:70;;4575:1;4572;4565:12;5680:611;5870:2;5882:21;;;5952:13;;5855:18;;;5974:22;;;5822:4;;6053:15;;;6027:2;6012:18;;;5822:4;6096:169;6110:6;6107:1;6104:13;6096:169;;;6171:13;;6159:26;;6214:2;6240:15;;;;6205:12;;;;6132:1;6125:9;6096:169;;7123:286;7182:6;7235:2;7223:9;7214:7;7210:23;7206:32;7203:52;;;7251:1;7248;7241:12;7203:52;7277:23;;-1:-1:-1;;;;;7329:31:43;;7319:42;;7309:70;;7375:1;7372;7365:12;7826:127;7887:10;7882:3;7878:20;7875:1;7868:31;7918:4;7915:1;7908:15;7942:4;7939:1;7932:15;7958:135;7997:3;8018:17;;;8015:43;;8038:18;;:::i;:::-;-1:-1:-1;8085:1:43;8074:13;;7958:135::o;8098:127::-;8159:10;8154:3;8150:20;8147:1;8140:31;8190:4;8187:1;8180:15;8214:4;8211:1;8204:15;8421:128;8488:9;;;8509:11;;;8506:37;;;8523:18;;:::i;8554:136::-;8593:3;8621:5;8611:39;;8630:18;;:::i;:::-;-1:-1:-1;;;8666:18:43;;8554:136::o;8695:168::-;8768:9;;;8799;;8816:15;;;8810:22;;8796:37;8786:71;;8837:18;;:::i;8868:217::-;8908:1;8934;8924:132;;8978:10;8973:3;8969:20;8966:1;8959:31;9013:4;9010:1;9003:15;9041:4;9038:1;9031:15;8924:132;-1:-1:-1;9070:9:43;;8868:217::o;9090:125::-;9155:9;;;9176:10;;;9173:36;;;9189:18;;:::i;9994:184::-;10064:6;10117:2;10105:9;10096:7;10092:23;10088:32;10085:52;;;10133:1;10130;10123:12;10085:52;-1:-1:-1;10156:16:43;;9994:184;-1:-1:-1;9994:184:43:o;11230:303::-;11361:3;11399:6;11393:13;11445:6;11438:4;11430:6;11426:17;11421:3;11415:37;11507:1;11471:16;;11496:13;;;-1:-1:-1;11471:16:43;11230:303;-1:-1:-1;11230:303:43:o;12090:179::-;12125:3;12167:1;12149:16;12146:23;12143:120;;;12213:1;12210;12207;12192:23;-1:-1:-1;12250:1:43;12244:8;12239:3;12235:18;12143:120;12090:179;:::o;12274:628::-;12313:3;12355:4;12337:16;12334:26;12331:39;;;12274:628;:::o;12331:39::-;12397:2;12391:9;12437:16;-1:-1:-1;;12433:29:43;12430:1;12391:9;12409:54;12492:4;12486:11;12566:16;12559:4;12551:6;12547:17;12544:39;-1:-1:-1;;;;;12515:6:43;12512:30;12509:75;12506:88;;;12587:5;;12274:628;:::o;12506:88::-;12624:6;12618:4;12614:17;12660:3;12654:10;-1:-1:-1;;;;;12679:6:43;12676:30;12673:43;;;12709:5;;;;12274:628;:::o;12673:43::-;12774:16;12764:27;;-1:-1:-1;;12760:40:43;12735:16;;;12753:4;12731:27;12728:73;12725:86;;;12804:5;;;;12274:628;:::o;12725:86::-;12820:57;12871:4;12862:6;12854;12850:19;12846:30;12840:4;12820:57;:::i;:::-;-1:-1:-1;12893:3:43;12274:628;-1:-1:-1;;;12274:628:43:o;12907:418::-;13056:2;13045:9;13038:21;13019:4;13088:6;13082:13;13131:6;13126:2;13115:9;13111:18;13104:34;13190:6;13185:2;13177:6;13173:15;13168:2;13157:9;13153:18;13147:50;13246:1;13241:2;13232:6;13221:9;13217:22;13213:31;13206:42;13316:2;13309;13305:7;13300:2;13292:6;13288:15;13284:29;13273:9;13269:45;13265:54;13257:62;;;12907:418;;;;:::o;13330:173::-;13427:12;13398:20;;;13420;;;13394:47;;13453:21;;13450:47;;;13477:18;;:::i;14076:277::-;14143:6;14196:2;14184:9;14175:7;14171:23;14167:32;14164:52;;;14212:1;14209;14202:12;14164:52;14244:9;14238:16;14297:5;14290:13;14283:21;14276:5;14273:32;14263:60;;14319:1;14316;14309:12

Swarm Source

ipfs://3009cf90cc47ae5ae0cb7346d0212518a26ad1c5e4850e8336d61e2dfc964a6d

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.