Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 17693518 | 546 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x1B79474e...A0D90573c The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
NodeRegistryResolver
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Controllable} from "../../controllers/Controllable.sol";
import {INodeRegistryResolver} from "./INodeRegistryResolver.sol";
import {IEnsNameRegistry} from "../registries/IEnsNameRegistry.sol";
/**
* @title NodeRegistryResolver
* @dev This contract stores registry addresses for a given node,
* allowing registry discovery.
*/
contract NodeRegistryResolver is INodeRegistryResolver, Controllable {
mapping(bytes32 => address) public nodeRegistries;
event NodeSet(bytes32 node, address registrar);
/**
* @dev Sets the registry address for a given node.
* Can only be called by a controller.
* @param node The node identifier -> namehash("name.eth").
* @param registrar The address of the registrar for the node.
*/
function setNodeRegistry(
bytes32 node,
address registrar
) external onlyController {
if (nodeRegistries[node] == address(0)) {
nodeRegistries[node] = registrar;
emit NodeSet(node, registrar);
}
}
/**
* @dev Sets the registry address for a given node.
* @param node The subname node namehash -> namehash("subname.name.eth").
* @param parentNode Nodehash of a parent registry node -> namehash("name.eth").
* @return address Returns address of subnode owner, zero address is node is not owned
* reverts if the registry is not present for parentNode
*/
function subnodeOwner(
bytes32 node,
bytes32 parentNode
) external view returns (address) {
address registryAddress = nodeRegistries[parentNode];
require(registryAddress != address(0), "Registry not found");
return IEnsNameRegistry(registryAddress).ownerOf(uint256(node));
}
}// 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);
}
}// 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;
}
}//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controllable is Ownable {
mapping(address => bool) public controllers;
event ControllerChanged(address indexed controller, bool enabled);
constructor() Ownable(msg.sender) {}
modifier onlyController() {
require(
controllers[msg.sender],
"Controllable: Caller is not a controller"
);
_;
}
function setController(address controller, bool enabled) public onlyOwner {
controllers[controller] = enabled;
emit ControllerChanged(controller, enabled);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../Types.sol";
error InvalidExpiry(uint256, string);
error NodeTaken(bytes32, string);
error NodeNotControllable();
error NodeNotFound(bytes32);
struct RegistryConfig {
ParentControlType parentControlType;
ExpirableType expirableType;
string tokenName;
string tokenSymbol;
string metadataUri;
address tokenOwner;
bytes32 namehash;
address emitter;
}
interface IEnsNameRegistry {
//ERC720 functions
function ownerOf(uint256 tokenId) external view returns (address);
function isApprovedForAll(
address owner,
address operator
) external view returns (bool);
function transferFrom(address from, address to, uint256 tokenId) external;
// Ens related functions
function register(
string[] memory labels,
address owner,
uint256 expiry
) external returns (bytes32);
function register(
string memory label,
address owner,
uint256 expiration
) external returns (bytes32);
function setExpiry(bytes32 node, uint256 expiration) external;
function registryNameNode() external view returns (bytes32);
function burn(bytes32 node) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface INodeRegistryResolver {
function setNodeRegistry(bytes32 node, address registry) external;
function nodeRegistries(bytes32 node) external view returns(address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
bytes32 constant MINT_CONTEXT = keccak256(
"MintContext(string label,bytes32 parentNode,address owner,uint256 price,uint256 fee,address paymentReceiver,uint256 expiry,uint256 nonce)"
);
struct MintContext {
address owner;
string label;
bytes32 parentNode;
uint256 price;
uint256 fee;
address paymentReceiver;
uint256 expiry;
uint256 nonce;
}
bytes32 constant FACTORY_CONTEXT = keccak256(
"FactoryContext(string tokenName,string tokenSymbol,string label,string TLD,address owner,uint8 parentControl,uint8 expirableType)"
);
struct FactoryContext {
ParentControlType parentControl;
ExpirableType expirableType;
string tokenName;
string tokenSymbol;
string label;
string TLD;
address owner;
}
struct ExtendExpiryContext {
bytes32 node;
uint256 expiry;
uint256 price;
uint256 fee;
address paymentReceiver;
uint256 nonce;
}
bytes32 constant EXTEND_EXPIRY_CONTEXT = keccak256(
"ExtendExpiryContext(bytes32 node,uint256 expiry,uint256 price,uint256 fee,address paymentReceiver,uint256 nonce)"
);
enum ExpirableType {
NonExpirable,
Expirable
}
enum ParentControlType {
NonControllable,
Controllable
}{
"optimizer": {
"enabled": true,
"runs": 100
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ControllerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"registrar","type":"address"}],"name":"NodeSet","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"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nodeRegistries","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"registrar","type":"address"}],"name":"setNodeRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32","name":"parentNode","type":"bytes32"}],"name":"subnodeOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61058d806100a56000396000f3fe608060405234801561001057600080fd5b50600436106100785760003560e01c8063715018a61461007d578063878a6a67146100875780638da5cb5b146100b05780639a6eca33146100c1578063d82201fc146100d4578063da8c229e146100fd578063e0dba60f14610130578063f2fde38b14610143575b600080fd5b610085610156565b005b61009a61009536600461044f565b61016a565b6040516100a79190610471565b60405180910390f35b6000546001600160a01b031661009a565b6100856100cf36600461049a565b61023a565b61009a6100e23660046104ca565b6002602052600090815260409020546001600160a01b031681565b61012061010b3660046104e3565b60016020526000908152604090205460ff1681565b60405190151581526020016100a7565b61008561013e366004610507565b61032d565b6100856101513660046104e3565b610394565b61015e6103d2565b61016860006103ff565b565b6000818152600260205260408120546001600160a01b0316806101c95760405162461bcd60e51b8152602060048201526012602482015271149959da5cdd1c9e481b9bdd08199bdd5b9960721b60448201526064015b60405180910390fd5b6040516331a9108f60e11b8152600481018590526001600160a01b03821690636352211e90602401602060405180830381865afa15801561020e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610232919061053a565b949350505050565b3360009081526001602052604090205460ff166102aa5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016101c0565b6000828152600260205260409020546001600160a01b03166103295760008281526002602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527fbe2206ad165f9f7f5f82d75fcade724b40a0e6699132e6384b6e7f307985073d910160405180910390a15b5050565b6103356103d2565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b61039c6103d2565b6001600160a01b0381166103c6576000604051631e4fbdf760e01b81526004016101c09190610471565b6103cf816103ff565b50565b6000546001600160a01b03163314610168573360405163118cdaa760e01b81526004016101c09190610471565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561046257600080fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146103cf57600080fd5b600080604083850312156104ad57600080fd5b8235915060208301356104bf81610485565b809150509250929050565b6000602082840312156104dc57600080fd5b5035919050565b6000602082840312156104f557600080fd5b813561050081610485565b9392505050565b6000806040838503121561051a57600080fd5b823561052581610485565b9150602083013580151581146104bf57600080fd5b60006020828403121561054c57600080fd5b81516105008161048556fea2646970667358221220600235aa271fa601b9ace979553a2fc89d8102e9c7f3eb5bec3201655ca20dec64736f6c63430008180033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100785760003560e01c8063715018a61461007d578063878a6a67146100875780638da5cb5b146100b05780639a6eca33146100c1578063d82201fc146100d4578063da8c229e146100fd578063e0dba60f14610130578063f2fde38b14610143575b600080fd5b610085610156565b005b61009a61009536600461044f565b61016a565b6040516100a79190610471565b60405180910390f35b6000546001600160a01b031661009a565b6100856100cf36600461049a565b61023a565b61009a6100e23660046104ca565b6002602052600090815260409020546001600160a01b031681565b61012061010b3660046104e3565b60016020526000908152604090205460ff1681565b60405190151581526020016100a7565b61008561013e366004610507565b61032d565b6100856101513660046104e3565b610394565b61015e6103d2565b61016860006103ff565b565b6000818152600260205260408120546001600160a01b0316806101c95760405162461bcd60e51b8152602060048201526012602482015271149959da5cdd1c9e481b9bdd08199bdd5b9960721b60448201526064015b60405180910390fd5b6040516331a9108f60e11b8152600481018590526001600160a01b03821690636352211e90602401602060405180830381865afa15801561020e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610232919061053a565b949350505050565b3360009081526001602052604090205460ff166102aa5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016101c0565b6000828152600260205260409020546001600160a01b03166103295760008281526002602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527fbe2206ad165f9f7f5f82d75fcade724b40a0e6699132e6384b6e7f307985073d910160405180910390a15b5050565b6103356103d2565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b61039c6103d2565b6001600160a01b0381166103c6576000604051631e4fbdf760e01b81526004016101c09190610471565b6103cf816103ff565b50565b6000546001600160a01b03163314610168573360405163118cdaa760e01b81526004016101c09190610471565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561046257600080fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146103cf57600080fd5b600080604083850312156104ad57600080fd5b8235915060208301356104bf81610485565b809150509250929050565b6000602082840312156104dc57600080fd5b5035919050565b6000602082840312156104f557600080fd5b813561050081610485565b9392505050565b6000806040838503121561051a57600080fd5b823561052581610485565b9150602083013580151581146104bf57600080fd5b60006020828403121561054c57600080fd5b81516105008161048556fea2646970667358221220600235aa271fa601b9ace979553a2fc89d8102e9c7f3eb5bec3201655ca20dec64736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.