diff --git a/deploy/dnsregistrar/10_deploy_dnsregistrar.ts b/deploy/dnsregistrar/10_deploy_dnsregistrar.ts index 6f280f25..96b5c7d0 100644 --- a/deploy/dnsregistrar/10_deploy_dnsregistrar.ts +++ b/deploy/dnsregistrar/10_deploy_dnsregistrar.ts @@ -40,6 +40,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } func.tags = ['DNSRegistrar'] -func.dependencies = ['registry', 'dnssec-oracle', 'OffchainDNSResolver', 'Root'] +func.dependencies = [ + 'registry', + 'dnssec-oracle', + 'OffchainDNSResolver', + 'Root', + 'setupRoot', +] export default func diff --git a/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts b/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts index 01f26d2c..c2e24c51 100644 --- a/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts +++ b/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts @@ -6,15 +6,14 @@ import { keccak256 } from 'js-sha3' const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { getNamedAccounts, deployments, network } = hre - const { deploy, fetchIfDifferent } = deployments - const { deployer, owner } = await getNamedAccounts() + const { deploy } = deployments + const { deployer } = await getNamedAccounts() if (!network.tags.use_root) { return true } const registry = await ethers.getContract('ENSRegistry') - const root = await ethers.getContract('Root') const deployArgs = { from: deployer, @@ -24,22 +23,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const bri = await deploy('BaseRegistrarImplementation', deployArgs) if (!bri.newlyDeployed) return - - const registrar = await ethers.getContract('BaseRegistrarImplementation') - - const tx1 = await registrar.transferOwnership(owner, { from: deployer }) - console.log( - `Transferring ownership of registrar to owner (tx: ${tx1.hash})...`, - ) - await tx1.wait() - - const tx2 = await root - .connect(await ethers.getSigner(owner)) - .setSubnodeOwner('0x' + keccak256('eth'), registrar.address) - console.log( - `Setting owner of eth node to registrar on root (tx: ${tx2.hash})...`, - ) - await tx2.wait() } func.id = 'registrar' diff --git a/deploy/ethregistrar/00_setup_base_registrar.ts b/deploy/ethregistrar/00_setup_base_registrar.ts new file mode 100644 index 00000000..0bb558ff --- /dev/null +++ b/deploy/ethregistrar/00_setup_base_registrar.ts @@ -0,0 +1,40 @@ +import namehash from 'eth-ens-namehash' +import { ethers } from 'hardhat' +import { DeployFunction } from 'hardhat-deploy/types' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { keccak256 } from 'js-sha3' + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments, network } = hre + const { deployer, owner } = await getNamedAccounts() + + if (!network.tags.use_root) { + return true + } + + const root = await ethers.getContract('Root') + const registrar = await ethers.getContract('BaseRegistrarImplementation') + + console.log('Running base registrar setup') + + const tx1 = await registrar.transferOwnership(owner, { from: deployer }) + console.log( + `Transferring ownership of registrar to owner (tx: ${tx1.hash})...`, + ) + await tx1.wait() + + const tx2 = await root + .connect(await ethers.getSigner(owner)) + .setSubnodeOwner('0x' + keccak256('eth'), registrar.address) + console.log( + `Setting owner of eth node to registrar on root (tx: ${tx2.hash})...`, + ) + await tx2.wait() +} + +func.id = 'setupRegistrar' +func.tags = ['setupRegistrar'] +//Runs after the root is setup +func.dependencies = ['setupRoot'] + +export default func diff --git a/deploy/ethregistrar/02_deploy_legacy_eth_registrar_controller.ts b/deploy/ethregistrar/02_deploy_legacy_eth_registrar_controller.ts index d88a87d1..e55e4a35 100644 --- a/deploy/ethregistrar/02_deploy_legacy_eth_registrar_controller.ts +++ b/deploy/ethregistrar/02_deploy_legacy_eth_registrar_controller.ts @@ -59,6 +59,7 @@ func.dependencies = [ 'registry', 'wrapper', 'LegacyPublicResolver', + 'ExponentialPremiumPriceOracle', 'ReverseRegistrar', ] diff --git a/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts b/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts index 15eec816..4db8768b 100644 --- a/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts +++ b/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts @@ -77,25 +77,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const artifact = await deployments.getArtifact('IETHRegistrarController') const interfaceId = computeInterfaceId(new Interface(artifact.abi)) - const provider = new ethers.providers.StaticJsonRpcProvider( - ethers.provider.connection.url, - { - ...ethers.provider.network, - ensAddress: (await ethers.getContract('ENSRegistry')).address, - }, - ) - const resolver = await provider.getResolver('eth') - if (resolver === null) { - registrar.setResolver(ethOwnedResolver.address) + + const resolver = await registry.resolver(ethers.utils.namehash('eth')) + if (resolver === ethers.constants.AddressZero) { console.log( `No resolver set for .eth; not setting interface ${interfaceId} for ETH Registrar Controller`, ) return } - const resolverContract = await ethers.getContractAt( - 'PublicResolver', - resolver.address, - ) + const resolverContract = await ethers.getContractAt('OwnedResolver', resolver) const tx3 = await resolverContract.setInterface( ethers.utils.namehash('eth'), interfaceId, diff --git a/deploy/ethregistrar/04_deploy_bulk_renewal.ts b/deploy/ethregistrar/04_deploy_bulk_renewal.ts index 8b09fb33..8fafecc1 100644 --- a/deploy/ethregistrar/04_deploy_bulk_renewal.ts +++ b/deploy/ethregistrar/04_deploy_bulk_renewal.ts @@ -37,17 +37,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ensAddress: registry.address, }, ) - const resolver = await provider.getResolver('eth') - if (resolver === null) { + + const resolver = await registry.resolver(ethers.utils.namehash('eth')) + if (resolver === ethers.constants.AddressZero) { console.log( - 'No resolver set for .eth; not setting interface for BulkRenewal', + `No resolver set for .eth; not setting interface ${interfaceId} for BulkRenewal`, ) return } - const resolverContract = await ethers.getContractAt( - 'PublicResolver', - resolver.address, - ) + const resolverContract = await ethers.getContractAt('OwnedResolver', resolver) const tx = await resolverContract.setInterface( ethers.utils.namehash('eth'), interfaceId, diff --git a/deploy/registry/00_deploy_registry.ts b/deploy/registry/00_deploy_registry.ts index c8c4fc13..ddab55dd 100644 --- a/deploy/registry/00_deploy_registry.ts +++ b/deploy/registry/00_deploy_registry.ts @@ -12,8 +12,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployer, owner } = await getNamedAccounts() if (network.tags.legacy) { + console.log(deployer) + console.log(owner) const contract = await deploy('LegacyENSRegistry', { - from: deployer, + from: owner, args: [], log: true, contract: await deployments.getArtifact('ENSRegistry'), @@ -22,7 +24,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const legacyRegistry = await ethers.getContract('LegacyENSRegistry') const rootTx = await legacyRegistry - .connect(await ethers.getSigner(deployer)) + .connect(await ethers.getSigner(owner)) .setOwner(ZERO_HASH, owner) console.log(`Setting owner of root node to owner (tx: ${rootTx.hash})`) await rootTx.wait() diff --git a/deploy/resolvers/00_deploy_eth_owned_resolver.ts b/deploy/resolvers/00_deploy_eth_owned_resolver.ts index 31abf228..1a318784 100644 --- a/deploy/resolvers/00_deploy_eth_owned_resolver.ts +++ b/deploy/resolvers/00_deploy_eth_owned_resolver.ts @@ -1,10 +1,11 @@ import { DeployFunction } from 'hardhat-deploy/types' import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { ethers } from 'hardhat' const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { getNamedAccounts, deployments } = hre const { deploy } = deployments - const { deployer } = await getNamedAccounts() + const { deployer, owner } = await getNamedAccounts() const deployArgs = { from: deployer, @@ -12,11 +13,25 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { log: true, } const ethOwnedResolver = await deploy('OwnedResolver', deployArgs) + + if (!ethOwnedResolver.newlyDeployed) return + + const registry = await ethers.getContract('ENSRegistry', owner) + const registrar = await ethers.getContract( + 'BaseRegistrarImplementation', + owner, + ) + + const tx = await registrar.setResolver(ethOwnedResolver.address) + await tx.wait() + + const resolver = await registry.resolver(ethers.utils.namehash('eth')) + console.log(`set resolver for .eth to ${resolver}`) if (!ethOwnedResolver.newlyDeployed) return } -func.id = 'owned-resolver' -func.tags = ['resolvers', 'OwnedResolver'] -func.dependencies = [] +func.id = 'eth-owned-resolver' +func.tags = ['resolvers', 'OwnedResolver', 'EthOwnedResolver'] +func.dependencies = ['Registry'] export default func diff --git a/deploy/root/00_deploy_root.ts b/deploy/root/00_deploy_root.ts index 959b8e8d..6b4ebf6d 100644 --- a/deploy/root/00_deploy_root.ts +++ b/deploy/root/00_deploy_root.ts @@ -2,9 +2,6 @@ import { ethers } from 'hardhat' import { DeployFunction } from 'hardhat-deploy/types' import { HardhatRuntimeEnvironment } from 'hardhat/types' -const ZERO_HASH = - '0x0000000000000000000000000000000000000000000000000000000000000000' - const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { getNamedAccounts, deployments, network } = hre const { deploy } = deployments @@ -22,42 +19,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { log: true, }) - const root = await ethers.getContract('Root') - - const tx1 = await registry.setOwner(ZERO_HASH, root.address) - console.log( - `Setting owner of root node to root contract (tx: ${tx1.hash})...`, - ) - await tx1.wait() - - const rootOwner = await root.owner() - - switch (rootOwner) { - case deployer: - const tx2 = await root - .connect(await ethers.getSigner(deployer)) - .transferOwnership(owner) - console.log( - `Transferring root ownership to final owner (tx: ${tx2.hash})...`, - ) - await tx2.wait() - case owner: - if (!(await root.controllers(owner))) { - const tx2 = await root - .connect(await ethers.getSigner(owner)) - .setController(owner, true) - console.log( - `Setting final owner as controller on root contract (tx: ${tx2.hash})...`, - ) - await tx2.wait() - } - break - default: - console.log( - `WARNING: Root is owned by ${rootOwner}; cannot transfer to owner account`, - ) - } - return true } diff --git a/deploy/root/00_setup_root.ts b/deploy/root/00_setup_root.ts new file mode 100644 index 00000000..e5a46b7a --- /dev/null +++ b/deploy/root/00_setup_root.ts @@ -0,0 +1,62 @@ +import { ethers } from 'hardhat' +import { DeployFunction } from 'hardhat-deploy/types' +import { HardhatRuntimeEnvironment } from 'hardhat/types' + +const ZERO_HASH = + '0x0000000000000000000000000000000000000000000000000000000000000000' + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments, network } = hre + const { deployer, owner } = await getNamedAccounts() + + if (!network.tags.use_root) { + return true + } + + console.log('Running root setup') + + const registry = await ethers.getContract('ENSRegistry') + const root = await ethers.getContract('Root') + + const tx1 = await registry.setOwner(ZERO_HASH, root.address) + console.log( + `Setting owner of root node to root contract (tx: ${tx1.hash})...`, + ) + await tx1.wait() + + const rootOwner = await root.owner() + + switch (rootOwner) { + case deployer: + const tx2 = await root + .connect(await ethers.getSigner(deployer)) + .transferOwnership(owner) + console.log( + `Transferring root ownership to final owner (tx: ${tx2.hash})...`, + ) + await tx2.wait() + case owner: + if (!(await root.controllers(owner))) { + const tx2 = await root + .connect(await ethers.getSigner(owner)) + .setController(owner, true) + console.log( + `Setting final owner as controller on root contract (tx: ${tx2.hash})...`, + ) + await tx2.wait() + } + break + default: + console.log( + `WARNING: Root is owned by ${rootOwner}; cannot transfer to owner account`, + ) + } + + return true +} + +func.id = 'setupRoot' +func.tags = ['setupRoot'] +func.dependencies = ['Root'] + +export default func diff --git a/deploy/wrapper/00_deploy_static_metadata_service.ts b/deploy/wrapper/00_deploy_static_metadata_service.ts index 8adb5fcc..776475ef 100644 --- a/deploy/wrapper/00_deploy_static_metadata_service.ts +++ b/deploy/wrapper/00_deploy_static_metadata_service.ts @@ -24,6 +24,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.id = 'metadata' func.tags = ['wrapper', 'StaticMetadataService'] -func.dependencies = [] +// technically not a dep, but we want to make sure it's deployed first for the consistent address +func.dependencies = ['BaseRegistrarImplementation'] export default func diff --git a/deploy/wrapper/01_deploy_name_wrapper.ts b/deploy/wrapper/01_deploy_name_wrapper.ts index 5cda7a18..fd4701ea 100644 --- a/deploy/wrapper/01_deploy_name_wrapper.ts +++ b/deploy/wrapper/01_deploy_name_wrapper.ts @@ -25,7 +25,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const deployArgs = { from: deployer, - args: [registry.address, registrar.address, metadata.address], + args: [ + registry.address, + '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', + metadata.address, + ], log: true, } @@ -52,21 +56,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const artifact = await deployments.getArtifact('INameWrapper') const interfaceId = computeInterfaceId(new Interface(artifact.abi)) - const providerWithEns = new ethers.providers.StaticJsonRpcProvider( - ethers.provider.connection.url, - { ...ethers.provider.network, ensAddress: registry.address }, - ) - const resolver = await providerWithEns.getResolver('eth') - if (resolver === null) { + const resolver = await registry.resolver(ethers.utils.namehash('eth')) + if (resolver === ethers.constants.AddressZero) { console.log( `No resolver set for .eth; not setting interface ${interfaceId} for NameWrapper`, ) return } - const resolverContract = await ethers.getContractAt( - 'PublicResolver', - resolver.address, - ) + const resolverContract = await ethers.getContractAt('OwnedResolver', resolver) const tx3 = await resolverContract.setInterface( ethers.utils.namehash('eth'), interfaceId, @@ -81,10 +78,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.id = 'name-wrapper' func.tags = ['wrapper', 'NameWrapper'] func.dependencies = [ - 'BaseRegistrarImplementation', 'StaticMetadataService', 'registry', 'ReverseRegistrar', + 'OwnedResolver', ] export default func diff --git a/deployments/sepolia/.chainId b/deployments/sepolia/.chainId new file mode 100644 index 00000000..bd8d1cd4 --- /dev/null +++ b/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/deployments/sepolia/.migrations.json b/deployments/sepolia/.migrations.json new file mode 100644 index 00000000..d8520a51 --- /dev/null +++ b/deployments/sepolia/.migrations.json @@ -0,0 +1,8 @@ +{ + "ens": 1686901718, + "root": 1686901730, + "setupRoot": 1686901813, + "legacy-resolver": 1688028337, + "legacy-controller": 1688029384, + "bulk-renewal": 1689657854 +} \ No newline at end of file diff --git a/deployments/sepolia/BaseRegistrarImplementation.json b/deployments/sepolia/BaseRegistrarImplementation.json new file mode 100644 index 00000000..548db388 --- /dev/null +++ b/deployments/sepolia/BaseRegistrarImplementation.json @@ -0,0 +1,1013 @@ +{ + "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_baseNode", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "ControllerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "ControllerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRenewed", + "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": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "GRACE_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "addController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "available", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseNode", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "controllers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ens", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "nameExpires", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "reclaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "register", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "registerOnly", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "removeController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "renew", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x7e4f7ebf750eff3786b9818c656f6191667ae56c38bd88ad115ddb1a689259f5", + "receipt": { + "to": null, + "from": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "contractAddress": "0xa2c122be93b0074270ebee7f6b7292c7deb45047", + "transactionIndex": "0x43", + "gasUsed": "0x1d57c1", + "logsBloom": "0x00000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000800800000000000040000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000000000000000020000000000000000000000000000000000", + "blockHash": "0xd4980c5c474966fe6d384da6bb26b9a50fcd84471359e9f2eed4b31cd4868ddd", + "transactionHash": "0x7e4f7ebf750eff3786b9818c656f6191667ae56c38bd88ad115ddb1a689259f5", + "logs": [ + { + "address": "0xa2c122be93b0074270ebee7f6b7292c7deb45047", + "blockHash": "0xd4980c5c474966fe6d384da6bb26b9a50fcd84471359e9f2eed4b31cd4868ddd", + "blockNumber": "0x3881eb", + "data": "0x", + "logIndex": "0x6b", + "removed": false, + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "transactionHash": "0x7e4f7ebf750eff3786b9818c656f6191667ae56c38bd88ad115ddb1a689259f5", + "transactionIndex": "0x43" + } + ], + "blockNumber": "0x3881eb", + "cumulativeGasUsed": "0xa884cd", + "status": "0x1" + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae" + ], + "numDeployments": 2, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_baseNode\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"ControllerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"ControllerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"name\":\"NameMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"name\":\"NameRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"name\":\"NameRenewed\",\"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\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GRACE_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"addController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"available\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseNode\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"controllers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"nameExpires\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"reclaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"register\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"registerOnly\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"removeController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"renew\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"Gets the owner of the specified token ID. Names become unowned when their registration expires.\",\"params\":{\"tokenId\":\"uint256 ID of the token to query the owner of\"},\"returns\":{\"_0\":\"address currently marked as the owner of the given token ID\"}},\"reclaim(uint256,address)\":{\"details\":\"Reclaim ownership of a name in ENS, if you own it in the registrar.\"},\"register(uint256,address,uint256)\":{\"details\":\"Register a name.\",\"params\":{\"duration\":\"Duration in seconds for the registration.\",\"id\":\"The token ID (keccak256 of the label).\",\"owner\":\"The address that should own the registration.\"}},\"registerOnly(uint256,address,uint256)\":{\"details\":\"Register a name, without modifying the registry.\",\"params\":{\"duration\":\"Duration in seconds for the registration.\",\"id\":\"The token ID (keccak256 of the label).\",\"owner\":\"The address that should own the registration.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenURI(uint256)\":{\"details\":\"See {IERC721Metadata-tokenURI}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ethregistrar/BaseRegistrarImplementation.sol\":\"BaseRegistrarImplementation\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC721.sol\\\";\\nimport \\\"./IERC721Receiver.sol\\\";\\nimport \\\"./extensions/IERC721Metadata.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/Strings.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\\n using Address for address;\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n // Mapping from token ID to owner address\\n mapping(uint256 => address) private _owners;\\n\\n // Mapping owner address to token count\\n mapping(address => uint256) private _balances;\\n\\n // Mapping from token ID to approved address\\n mapping(uint256 => address) private _tokenApprovals;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual override returns (uint256) {\\n require(owner != address(0), \\\"ERC721: address zero is not a valid owner\\\");\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\\n address owner = _ownerOf(tokenId);\\n require(owner != address(0), \\\"ERC721: invalid token ID\\\");\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireMinted(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual override {\\n address owner = ERC721.ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\\n _requireMinted(tokenId);\\n\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n //solhint-disable-next-line max-line-length\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n\\n _transfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) public virtual override {\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n _safeTransfer(from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _transfer(from, to, tokenId);\\n require(_checkOnERC721Received(from, to, tokenId, data), \\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `tokenId` exists.\\n *\\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\\n *\\n * Tokens start existing when they are minted (`_mint`),\\n * and stop existing when they are burned (`_burn`).\\n */\\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\\n return _ownerOf(tokenId) != address(0);\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Safely mints `tokenId` and transfers it to `to`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal virtual {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _mint(to, tokenId);\\n require(\\n _checkOnERC721Received(address(0), to, tokenId, data),\\n \\\"ERC721: transfer to non ERC721Receiver implementer\\\"\\n );\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal virtual {\\n require(to != address(0), \\\"ERC721: mint to the zero address\\\");\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n _beforeTokenTransfer(address(0), to, tokenId, 1);\\n\\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n unchecked {\\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\\n // Given that tokens are minted one by one, it is impossible in practice that\\n // this ever happens. Might change if we allow batch minting.\\n // The ERC fails to describe this case.\\n _balances[to] += 1;\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal virtual {\\n address owner = ERC721.ownerOf(tokenId);\\n\\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\\n\\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\\n owner = ERC721.ownerOf(tokenId);\\n\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // Cannot overflow, as that would require more tokens to be burned/transferred\\n // out than the owner initially received through minting and transferring in.\\n _balances[owner] -= 1;\\n }\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId, 1);\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 tokenId\\n ) internal virtual {\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n require(to != address(0), \\\"ERC721: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, tokenId, 1);\\n\\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n\\n // Clear approvals from the previous owner\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\\n // `from`'s balance is the number of token held, which is at least one before the current\\n // transfer.\\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\\n // all 2**256 token ids to be minted, which in practice is impossible.\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n }\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC721: approve to caller\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` has not been minted yet.\\n */\\n function _requireMinted(uint256 tokenId) internal view virtual {\\n require(_exists(tokenId), \\\"ERC721: invalid token ID\\\");\\n }\\n\\n /**\\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\\n * The call is not executed if the target address is not a contract.\\n *\\n * @param from address representing the previous owner of the given token ID\\n * @param to target address that will receive the tokens\\n * @param tokenId uint256 ID of the token to be transferred\\n * @param data bytes optional data to send along with the call\\n * @return bool whether the call correctly returned the expected magic value\\n */\\n function _checkOnERC721Received(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) private returns (bool) {\\n if (to.isContract()) {\\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\\n return retval == IERC721Receiver.onERC721Received.selector;\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n revert(\\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n } else {\\n /// @solidity memory-safe-assembly\\n assembly {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n } else {\\n return true;\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\\n * - When `from` is zero, the tokens will be minted for `to`.\\n * - When `to` is zero, ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256, /* firstTokenId */\\n uint256 batchSize\\n ) internal virtual {\\n if (batchSize > 1) {\\n if (from != address(0)) {\\n _balances[from] -= batchSize;\\n }\\n if (to != address(0)) {\\n _balances[to] += batchSize;\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\\n * - When `from` is zero, the tokens were minted for `to`.\\n * - When `to` is zero, ``from``'s tokens were burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 firstTokenId,\\n uint256 batchSize\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xd89f3585b211fc9e3408384a4c4efdc3a93b2f877a3821046fa01c219d35be1b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x75b829ff2f26c14355d1cba20e16fe7b29ca58eb5fef665ede48bc0f9c6c74b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/ethregistrar/BaseRegistrarImplementation.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable {\\n // A map of expiry times\\n mapping(uint256 => uint256) expiries;\\n // The ENS registry\\n ENS public ens;\\n // The namehash of the TLD this registrar owns (eg, .eth)\\n bytes32 public baseNode;\\n // A map of addresses that are authorised to register and renew names.\\n mapping(address => bool) public controllers;\\n uint256 public constant GRACE_PERIOD = 90 days;\\n bytes4 private constant INTERFACE_META_ID =\\n bytes4(keccak256(\\\"supportsInterface(bytes4)\\\"));\\n bytes4 private constant ERC721_ID =\\n bytes4(\\n keccak256(\\\"balanceOf(address)\\\") ^\\n keccak256(\\\"ownerOf(uint256)\\\") ^\\n keccak256(\\\"approve(address,uint256)\\\") ^\\n keccak256(\\\"getApproved(uint256)\\\") ^\\n keccak256(\\\"setApprovalForAll(address,bool)\\\") ^\\n keccak256(\\\"isApprovedForAll(address,address)\\\") ^\\n keccak256(\\\"transferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256,bytes)\\\")\\n );\\n bytes4 private constant RECLAIM_ID =\\n bytes4(keccak256(\\\"reclaim(uint256,address)\\\"));\\n\\n /**\\n * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);\\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187\\n * @dev Returns whether the given spender can transfer a given token ID\\n * @param spender address of the spender to query\\n * @param tokenId uint256 ID of the token to be transferred\\n * @return bool whether the msg.sender is approved for the given token ID,\\n * is an operator of the owner, or is the owner of the token\\n */\\n function _isApprovedOrOwner(\\n address spender,\\n uint256 tokenId\\n ) internal view override returns (bool) {\\n address owner = ownerOf(tokenId);\\n return (spender == owner ||\\n getApproved(tokenId) == spender ||\\n isApprovedForAll(owner, spender));\\n }\\n\\n constructor(ENS _ens, bytes32 _baseNode) ERC721(\\\"\\\", \\\"\\\") {\\n ens = _ens;\\n baseNode = _baseNode;\\n }\\n\\n modifier live() {\\n require(ens.owner(baseNode) == address(this));\\n _;\\n }\\n\\n modifier onlyController() {\\n require(controllers[msg.sender]);\\n _;\\n }\\n\\n /**\\n * @dev Gets the owner of the specified token ID. Names become unowned\\n * when their registration expires.\\n * @param tokenId uint256 ID of the token to query the owner of\\n * @return address currently marked as the owner of the given token ID\\n */\\n function ownerOf(\\n uint256 tokenId\\n ) public view override(IERC721, ERC721) returns (address) {\\n require(expiries[tokenId] > block.timestamp);\\n return super.ownerOf(tokenId);\\n }\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external override onlyOwner {\\n controllers[controller] = true;\\n emit ControllerAdded(controller);\\n }\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external override onlyOwner {\\n controllers[controller] = false;\\n emit ControllerRemoved(controller);\\n }\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external override onlyOwner {\\n ens.setResolver(baseNode, resolver);\\n }\\n\\n // Returns the expiration timestamp of the specified id.\\n function nameExpires(uint256 id) external view override returns (uint256) {\\n return expiries[id];\\n }\\n\\n // Returns true iff the specified name is available for registration.\\n function available(uint256 id) public view override returns (bool) {\\n // Not available if it's registered here or in its grace period.\\n return expiries[id] + GRACE_PERIOD < block.timestamp;\\n }\\n\\n /**\\n * @dev Register a name.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external override returns (uint256) {\\n return _register(id, owner, duration, true);\\n }\\n\\n /**\\n * @dev Register a name, without modifying the registry.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function registerOnly(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256) {\\n return _register(id, owner, duration, false);\\n }\\n\\n function _register(\\n uint256 id,\\n address owner,\\n uint256 duration,\\n bool updateRegistry\\n ) internal live onlyController returns (uint256) {\\n require(available(id));\\n require(\\n block.timestamp + duration + GRACE_PERIOD >\\n block.timestamp + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] = block.timestamp + duration;\\n if (_exists(id)) {\\n // Name was previously owned, and expired\\n _burn(id);\\n }\\n _mint(owner, id);\\n if (updateRegistry) {\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n emit NameRegistered(id, owner, block.timestamp + duration);\\n\\n return block.timestamp + duration;\\n }\\n\\n function renew(\\n uint256 id,\\n uint256 duration\\n ) external override live onlyController returns (uint256) {\\n require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period\\n require(\\n expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] += duration;\\n emit NameRenewed(id, expiries[id]);\\n return expiries[id];\\n }\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external override live {\\n require(_isApprovedOrOwner(msg.sender, id));\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view override(ERC721, IERC165) returns (bool) {\\n return\\n interfaceID == INTERFACE_META_ID ||\\n interfaceID == ERC721_ID ||\\n interfaceID == RECLAIM_ID;\\n }\\n}\\n\",\"keccak256\":\"0xaee6eb36aead449d397b86a02e9c63bc46e3ef378d0a62bfd68beaae1150c9d0\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506040516200232138038062002321833981016040819052620000349162000109565b60408051602080820183526000808352835191820190935282815290916200005d8382620001ea565b5060016200006c8282620001ea565b5050506200008962000083620000b360201b60201c565b620000b7565b600880546001600160a01b0319166001600160a01b039390931692909217909155600955620002b6565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080604083850312156200011d57600080fd5b82516001600160a01b03811681146200013557600080fd5b6020939093015192949293505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200017057607f821691505b6020821081036200019157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001e557600081815260208120601f850160051c81016020861015620001c05750805b601f850160051c820191505b81811015620001e157828155600101620001cc565b5050505b505050565b81516001600160401b0381111562000206576200020662000145565b6200021e816200021784546200015b565b8462000197565b602080601f8311600181146200025657600084156200023d5750858301515b600019600386901b1c1916600185901b178555620001e1565b600085815260208120601f198616915b82811015620002875788860151825594840194600190910190840162000266565b5085821015620002a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61205b80620002c66000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806395d89b4111610104578063c87b56dd116100a2578063e985e9c511610071578063e985e9c5146103e0578063f2fde38b1461041c578063f6a74ed71461042f578063fca247ac1461044257600080fd5b8063c87b56dd14610381578063d6e4fa8614610394578063da8c229e146103b4578063ddf7fcb0146103d757600080fd5b8063a7fc7a07116100de578063a7fc7a071461033e578063b88d4fde14610351578063c1a287e214610364578063c475abff1461036e57600080fd5b806395d89b411461031057806396e494e814610318578063a22cb4651461032b57600080fd5b80633f15457f116101715780636352211e1161014b5780636352211e146102d157806370a08231146102e4578063715018a6146102f75780638da5cb5b146102ff57600080fd5b80633f15457f1461029857806342842e0e146102ab5780634e543b26146102be57600080fd5b8063095ea7b3116101ad578063095ea7b31461023c5780630e297b451461025157806323b872dd1461027257806328ed4f6c1461028557600080fd5b806301ffc9a7146101d457806306fdde03146101fc578063081812fc14610211575b600080fd5b6101e76101e2366004611be9565b610455565b60405190151581526020015b60405180910390f35b6102046104f2565b6040516101f39190611c56565b61022461021f366004611c69565b610584565b6040516001600160a01b0390911681526020016101f3565b61024f61024a366004611c97565b6105ab565b005b61026461025f366004611cc3565b6106e1565b6040519081526020016101f3565b61024f610280366004611cfb565b6106f8565b61024f610293366004611d2b565b61077f565b600854610224906001600160a01b031681565b61024f6102b9366004611cfb565b610898565b61024f6102cc366004611d5b565b6108b3565b6102246102df366004611c69565b610941565b6102646102f2366004611d5b565b610964565b61024f6109fe565b6006546001600160a01b0316610224565b610204610a12565b6101e7610326366004611c69565b610a21565b61024f610339366004611d78565b610a47565b61024f61034c366004611d5b565b610a56565b61024f61035f366004611dc1565b610aaa565b6102646276a70081565b61026461037c366004611ea1565b610b38565b61020461038f366004611c69565b610cc9565b6102646103a2366004611c69565b60009081526007602052604090205490565b6101e76103c2366004611d5b565b600a6020526000908152604090205460ff1681565b61026460095481565b6101e76103ee366004611ec3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61024f61042a366004611d5b565b610d3d565b61024f61043d366004611d5b565b610dcd565b610264610450366004611cc3565b610e1e565b60006001600160e01b031982167f01ffc9a70000000000000000000000000000000000000000000000000000000014806104b857506001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000145b806104ec57506001600160e01b031982167f28ed4f6c00000000000000000000000000000000000000000000000000000000145b92915050565b60606000805461050190611ef1565b80601f016020809104026020016040519081016040528092919081815260200182805461052d90611ef1565b801561057a5780601f1061054f5761010080835404028352916020019161057a565b820191906000526020600020905b81548152906001019060200180831161055d57829003601f168201915b5050505050905090565b600061058f82610e2d565b506000908152600460205260409020546001600160a01b031690565b60006105b682610e91565b9050806001600160a01b0316836001600160a01b0316036106445760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610660575061066081336103ee565b6106d25760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161063b565b6106dc8383610ef6565b505050565b60006106f08484846000610f71565b949350505050565b6107023382611181565b6107745760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f76656400000000000000000000000000000000000000606482015260840161063b565b6106dc8383836111fc565b6008546009546040516302571be360e01b8152600481019190915230916001600160a01b0316906302571be390602401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611f2b565b6001600160a01b03161461080357600080fd5b61080d3383611181565b61081657600080fd5b6008546009546040516306ab592360e01b81526004810191909152602481018490526001600160a01b038381166044830152909116906306ab5923906064016020604051808303816000875af1158015610874573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190611f48565b6106dc83838360405180602001604052806000815250610aaa565b6108bb61140f565b6008546009546040517f1896f70a00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b03838116602483015290911690631896f70a90604401600060405180830381600087803b15801561092657600080fd5b505af115801561093a573d6000803e3d6000fd5b5050505050565b600081815260076020526040812054421061095b57600080fd5b6104ec82610e91565b60006001600160a01b0382166109e25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e65720000000000000000000000000000000000000000000000606482015260840161063b565b506001600160a01b031660009081526003602052604090205490565b610a0661140f565b610a106000611469565b565b60606001805461050190611ef1565b6000818152600760205260408120544290610a40906276a70090611f77565b1092915050565b610a523383836114c8565b5050565b610a5e61140f565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517f0a8bb31534c0ed46f380cb867bd5c803a189ced9a764e30b3a4991a9901d74749190a250565b610ab43383611181565b610b265760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f76656400000000000000000000000000000000000000606482015260840161063b565b610b3284848484611596565b50505050565b6008546009546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be390602401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190611f2b565b6001600160a01b031614610bc157600080fd5b336000908152600a602052604090205460ff16610bdd57600080fd5b6000838152600760205260409020544290610bfc906276a70090611f77565b1015610c0757600080fd5b610c146276a70083611f77565b6000848152600760205260409020546276a70090610c33908590611f77565b610c3d9190611f77565b11610c4757600080fd5b60008381526007602052604081208054849290610c65908490611f77565b90915550506000838152600760205260409081902054905184917f9b87a00e30f1ac65d898f070f8a3488fe60517182d0a2098e1b4b93a54aa9bd691610cad91815260200190565b60405180910390a2505060009081526007602052604090205490565b6060610cd482610e2d565b6000610ceb60408051602081019091526000815290565b90506000815111610d0b5760405180602001604052806000815250610d36565b80610d158461161f565b604051602001610d26929190611f8a565b6040516020818303038152906040525b9392505050565b610d4561140f565b6001600160a01b038116610dc15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161063b565b610dca81611469565b50565b610dd561140f565b6001600160a01b0381166000818152600a6020526040808220805460ff19169055517f33d83959be2573f5453b12eb9d43b3499bc57d96bd2f067ba44803c859e811139190a250565b60006106f08484846001610f71565b6000818152600260205260409020546001600160a01b0316610dca5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604482015260640161063b565b6000818152600260205260408120546001600160a01b0316806104ec5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604482015260640161063b565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190610f3882610e91565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6008546009546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be390602401602060405180830381865afa158015610fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe79190611f2b565b6001600160a01b031614610ffa57600080fd5b336000908152600a602052604090205460ff1661101657600080fd5b61101f85610a21565b61102857600080fd5b6110356276a70042611f77565b6276a7006110438542611f77565b61104d9190611f77565b1161105757600080fd5b6110618342611f77565b6000868152600760209081526040808320939093556002905220546001600160a01b03161561109357611093856116bf565b61109d848661176f565b8115611127576008546009546040516306ab592360e01b81526004810191909152602481018790526001600160a01b038681166044830152909116906306ab5923906064016020604051808303816000875af1158015611101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111259190611f48565b505b6001600160a01b038416857fb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d961115d8642611f77565b60405190815260200160405180910390a36111788342611f77565b95945050505050565b60008061118d83610941565b9050806001600160a01b0316846001600160a01b031614806111c85750836001600160a01b03166111bd84610584565b6001600160a01b0316145b806106f057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff166106f0565b826001600160a01b031661120f82610e91565b6001600160a01b0316146112735760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161063b565b6001600160a01b0382166112ee5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161063b565b6112fb8383836001611915565b826001600160a01b031661130e82610e91565b6001600160a01b0316146113725760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161063b565b6000818152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6006546001600160a01b03163314610a105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161063b565b600680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036115295760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161063b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6115a18484846111fc565b6115ad8484848461199d565b610b325760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161063b565b6060600061162c83611af1565b600101905060008167ffffffffffffffff81111561164c5761164c611dab565b6040519080825280601f01601f191660200182016040528015611676576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461168057509392505050565b60006116ca82610e91565b90506116da816000846001611915565b6116e382610e91565b6000838152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b0382166117c55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161063b565b6000818152600260205260409020546001600160a01b03161561182a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161063b565b611838600083836001611915565b6000818152600260205260409020546001600160a01b03161561189d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161063b565b6001600160a01b0382166000818152600360209081526040808320805460010190558483526002909152808220805473ffffffffffffffffffffffffffffffffffffffff19168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001811115610b32576001600160a01b0384161561195b576001600160a01b03841660009081526003602052604081208054839290611955908490611fb9565b90915550505b6001600160a01b03831615610b32576001600160a01b03831660009081526003602052604081208054839290611992908490611f77565b909155505050505050565b60006001600160a01b0384163b15611ae957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906119e1903390899088908890600401611fcc565b6020604051808303816000875af1925050508015611a1c575060408051601f3d908101601f19168201909252611a1991810190612008565b60015b611acf573d808015611a4a576040519150601f19603f3d011682016040523d82523d6000602084013e611a4f565b606091505b508051600003611ac75760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161063b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506106f0565b5060016106f0565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611b3a577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611b66576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611b8457662386f26fc10000830492506010015b6305f5e1008310611b9c576305f5e100830492506008015b6127108310611bb057612710830492506004015b60648310611bc2576064830492506002015b600a83106104ec5760010192915050565b6001600160e01b031981168114610dca57600080fd5b600060208284031215611bfb57600080fd5b8135610d3681611bd3565b60005b83811015611c21578181015183820152602001611c09565b50506000910152565b60008151808452611c42816020860160208601611c06565b601f01601f19169290920160200192915050565b602081526000610d366020830184611c2a565b600060208284031215611c7b57600080fd5b5035919050565b6001600160a01b0381168114610dca57600080fd5b60008060408385031215611caa57600080fd5b8235611cb581611c82565b946020939093013593505050565b600080600060608486031215611cd857600080fd5b833592506020840135611cea81611c82565b929592945050506040919091013590565b600080600060608486031215611d1057600080fd5b8335611d1b81611c82565b92506020840135611cea81611c82565b60008060408385031215611d3e57600080fd5b823591506020830135611d5081611c82565b809150509250929050565b600060208284031215611d6d57600080fd5b8135610d3681611c82565b60008060408385031215611d8b57600080fd5b8235611d9681611c82565b915060208301358015158114611d5057600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611dd757600080fd5b8435611de281611c82565b93506020850135611df281611c82565b925060408501359150606085013567ffffffffffffffff80821115611e1657600080fd5b818701915087601f830112611e2a57600080fd5b813581811115611e3c57611e3c611dab565b604051601f8201601f19908116603f01168101908382118183101715611e6457611e64611dab565b816040528281528a6020848701011115611e7d57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611eb457600080fd5b50508035926020909101359150565b60008060408385031215611ed657600080fd5b8235611ee181611c82565b91506020830135611d5081611c82565b600181811c90821680611f0557607f821691505b602082108103611f2557634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611f3d57600080fd5b8151610d3681611c82565b600060208284031215611f5a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104ec576104ec611f61565b60008351611f9c818460208801611c06565b835190830190611fb0818360208801611c06565b01949350505050565b818103818111156104ec576104ec611f61565b60006001600160a01b03808716835280861660208401525083604083015260806060830152611ffe6080830184611c2a565b9695505050505050565b60006020828403121561201a57600080fd5b8151610d3681611bd356fea2646970667358221220c630ba8f4bccefef0d24d6342b73a5a1b846097a660dac3679e4fd4b37d7872e64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c806395d89b4111610104578063c87b56dd116100a2578063e985e9c511610071578063e985e9c5146103e0578063f2fde38b1461041c578063f6a74ed71461042f578063fca247ac1461044257600080fd5b8063c87b56dd14610381578063d6e4fa8614610394578063da8c229e146103b4578063ddf7fcb0146103d757600080fd5b8063a7fc7a07116100de578063a7fc7a071461033e578063b88d4fde14610351578063c1a287e214610364578063c475abff1461036e57600080fd5b806395d89b411461031057806396e494e814610318578063a22cb4651461032b57600080fd5b80633f15457f116101715780636352211e1161014b5780636352211e146102d157806370a08231146102e4578063715018a6146102f75780638da5cb5b146102ff57600080fd5b80633f15457f1461029857806342842e0e146102ab5780634e543b26146102be57600080fd5b8063095ea7b3116101ad578063095ea7b31461023c5780630e297b451461025157806323b872dd1461027257806328ed4f6c1461028557600080fd5b806301ffc9a7146101d457806306fdde03146101fc578063081812fc14610211575b600080fd5b6101e76101e2366004611be9565b610455565b60405190151581526020015b60405180910390f35b6102046104f2565b6040516101f39190611c56565b61022461021f366004611c69565b610584565b6040516001600160a01b0390911681526020016101f3565b61024f61024a366004611c97565b6105ab565b005b61026461025f366004611cc3565b6106e1565b6040519081526020016101f3565b61024f610280366004611cfb565b6106f8565b61024f610293366004611d2b565b61077f565b600854610224906001600160a01b031681565b61024f6102b9366004611cfb565b610898565b61024f6102cc366004611d5b565b6108b3565b6102246102df366004611c69565b610941565b6102646102f2366004611d5b565b610964565b61024f6109fe565b6006546001600160a01b0316610224565b610204610a12565b6101e7610326366004611c69565b610a21565b61024f610339366004611d78565b610a47565b61024f61034c366004611d5b565b610a56565b61024f61035f366004611dc1565b610aaa565b6102646276a70081565b61026461037c366004611ea1565b610b38565b61020461038f366004611c69565b610cc9565b6102646103a2366004611c69565b60009081526007602052604090205490565b6101e76103c2366004611d5b565b600a6020526000908152604090205460ff1681565b61026460095481565b6101e76103ee366004611ec3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61024f61042a366004611d5b565b610d3d565b61024f61043d366004611d5b565b610dcd565b610264610450366004611cc3565b610e1e565b60006001600160e01b031982167f01ffc9a70000000000000000000000000000000000000000000000000000000014806104b857506001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000145b806104ec57506001600160e01b031982167f28ed4f6c00000000000000000000000000000000000000000000000000000000145b92915050565b60606000805461050190611ef1565b80601f016020809104026020016040519081016040528092919081815260200182805461052d90611ef1565b801561057a5780601f1061054f5761010080835404028352916020019161057a565b820191906000526020600020905b81548152906001019060200180831161055d57829003601f168201915b5050505050905090565b600061058f82610e2d565b506000908152600460205260409020546001600160a01b031690565b60006105b682610e91565b9050806001600160a01b0316836001600160a01b0316036106445760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610660575061066081336103ee565b6106d25760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161063b565b6106dc8383610ef6565b505050565b60006106f08484846000610f71565b949350505050565b6107023382611181565b6107745760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f76656400000000000000000000000000000000000000606482015260840161063b565b6106dc8383836111fc565b6008546009546040516302571be360e01b8152600481019190915230916001600160a01b0316906302571be390602401602060405180830381865afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611f2b565b6001600160a01b03161461080357600080fd5b61080d3383611181565b61081657600080fd5b6008546009546040516306ab592360e01b81526004810191909152602481018490526001600160a01b038381166044830152909116906306ab5923906064016020604051808303816000875af1158015610874573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190611f48565b6106dc83838360405180602001604052806000815250610aaa565b6108bb61140f565b6008546009546040517f1896f70a00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b03838116602483015290911690631896f70a90604401600060405180830381600087803b15801561092657600080fd5b505af115801561093a573d6000803e3d6000fd5b5050505050565b600081815260076020526040812054421061095b57600080fd5b6104ec82610e91565b60006001600160a01b0382166109e25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e65720000000000000000000000000000000000000000000000606482015260840161063b565b506001600160a01b031660009081526003602052604090205490565b610a0661140f565b610a106000611469565b565b60606001805461050190611ef1565b6000818152600760205260408120544290610a40906276a70090611f77565b1092915050565b610a523383836114c8565b5050565b610a5e61140f565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517f0a8bb31534c0ed46f380cb867bd5c803a189ced9a764e30b3a4991a9901d74749190a250565b610ab43383611181565b610b265760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206f7220617070726f76656400000000000000000000000000000000000000606482015260840161063b565b610b3284848484611596565b50505050565b6008546009546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be390602401602060405180830381865afa158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae9190611f2b565b6001600160a01b031614610bc157600080fd5b336000908152600a602052604090205460ff16610bdd57600080fd5b6000838152600760205260409020544290610bfc906276a70090611f77565b1015610c0757600080fd5b610c146276a70083611f77565b6000848152600760205260409020546276a70090610c33908590611f77565b610c3d9190611f77565b11610c4757600080fd5b60008381526007602052604081208054849290610c65908490611f77565b90915550506000838152600760205260409081902054905184917f9b87a00e30f1ac65d898f070f8a3488fe60517182d0a2098e1b4b93a54aa9bd691610cad91815260200190565b60405180910390a2505060009081526007602052604090205490565b6060610cd482610e2d565b6000610ceb60408051602081019091526000815290565b90506000815111610d0b5760405180602001604052806000815250610d36565b80610d158461161f565b604051602001610d26929190611f8a565b6040516020818303038152906040525b9392505050565b610d4561140f565b6001600160a01b038116610dc15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161063b565b610dca81611469565b50565b610dd561140f565b6001600160a01b0381166000818152600a6020526040808220805460ff19169055517f33d83959be2573f5453b12eb9d43b3499bc57d96bd2f067ba44803c859e811139190a250565b60006106f08484846001610f71565b6000818152600260205260409020546001600160a01b0316610dca5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604482015260640161063b565b6000818152600260205260408120546001600160a01b0316806104ec5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e2049440000000000000000604482015260640161063b565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190610f3882610e91565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6008546009546040516302571be360e01b8152600481019190915260009130916001600160a01b03909116906302571be390602401602060405180830381865afa158015610fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe79190611f2b565b6001600160a01b031614610ffa57600080fd5b336000908152600a602052604090205460ff1661101657600080fd5b61101f85610a21565b61102857600080fd5b6110356276a70042611f77565b6276a7006110438542611f77565b61104d9190611f77565b1161105757600080fd5b6110618342611f77565b6000868152600760209081526040808320939093556002905220546001600160a01b03161561109357611093856116bf565b61109d848661176f565b8115611127576008546009546040516306ab592360e01b81526004810191909152602481018790526001600160a01b038681166044830152909116906306ab5923906064016020604051808303816000875af1158015611101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111259190611f48565b505b6001600160a01b038416857fb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d961115d8642611f77565b60405190815260200160405180910390a36111788342611f77565b95945050505050565b60008061118d83610941565b9050806001600160a01b0316846001600160a01b031614806111c85750836001600160a01b03166111bd84610584565b6001600160a01b0316145b806106f057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff166106f0565b826001600160a01b031661120f82610e91565b6001600160a01b0316146112735760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161063b565b6001600160a01b0382166112ee5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161063b565b6112fb8383836001611915565b826001600160a01b031661130e82610e91565b6001600160a01b0316146113725760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161063b565b6000818152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6006546001600160a01b03163314610a105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161063b565b600680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036115295760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161063b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6115a18484846111fc565b6115ad8484848461199d565b610b325760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161063b565b6060600061162c83611af1565b600101905060008167ffffffffffffffff81111561164c5761164c611dab565b6040519080825280601f01601f191660200182016040528015611676576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461168057509392505050565b60006116ca82610e91565b90506116da816000846001611915565b6116e382610e91565b6000838152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b0382166117c55760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161063b565b6000818152600260205260409020546001600160a01b03161561182a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161063b565b611838600083836001611915565b6000818152600260205260409020546001600160a01b03161561189d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161063b565b6001600160a01b0382166000818152600360209081526040808320805460010190558483526002909152808220805473ffffffffffffffffffffffffffffffffffffffff19168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001811115610b32576001600160a01b0384161561195b576001600160a01b03841660009081526003602052604081208054839290611955908490611fb9565b90915550505b6001600160a01b03831615610b32576001600160a01b03831660009081526003602052604081208054839290611992908490611f77565b909155505050505050565b60006001600160a01b0384163b15611ae957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906119e1903390899088908890600401611fcc565b6020604051808303816000875af1925050508015611a1c575060408051601f3d908101601f19168201909252611a1991810190612008565b60015b611acf573d808015611a4a576040519150601f19603f3d011682016040523d82523d6000602084013e611a4f565b606091505b508051600003611ac75760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161063b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506106f0565b5060016106f0565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611b3a577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611b66576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611b8457662386f26fc10000830492506010015b6305f5e1008310611b9c576305f5e100830492506008015b6127108310611bb057612710830492506004015b60648310611bc2576064830492506002015b600a83106104ec5760010192915050565b6001600160e01b031981168114610dca57600080fd5b600060208284031215611bfb57600080fd5b8135610d3681611bd3565b60005b83811015611c21578181015183820152602001611c09565b50506000910152565b60008151808452611c42816020860160208601611c06565b601f01601f19169290920160200192915050565b602081526000610d366020830184611c2a565b600060208284031215611c7b57600080fd5b5035919050565b6001600160a01b0381168114610dca57600080fd5b60008060408385031215611caa57600080fd5b8235611cb581611c82565b946020939093013593505050565b600080600060608486031215611cd857600080fd5b833592506020840135611cea81611c82565b929592945050506040919091013590565b600080600060608486031215611d1057600080fd5b8335611d1b81611c82565b92506020840135611cea81611c82565b60008060408385031215611d3e57600080fd5b823591506020830135611d5081611c82565b809150509250929050565b600060208284031215611d6d57600080fd5b8135610d3681611c82565b60008060408385031215611d8b57600080fd5b8235611d9681611c82565b915060208301358015158114611d5057600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611dd757600080fd5b8435611de281611c82565b93506020850135611df281611c82565b925060408501359150606085013567ffffffffffffffff80821115611e1657600080fd5b818701915087601f830112611e2a57600080fd5b813581811115611e3c57611e3c611dab565b604051601f8201601f19908116603f01168101908382118183101715611e6457611e64611dab565b816040528281528a6020848701011115611e7d57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611eb457600080fd5b50508035926020909101359150565b60008060408385031215611ed657600080fd5b8235611ee181611c82565b91506020830135611d5081611c82565b600181811c90821680611f0557607f821691505b602082108103611f2557634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611f3d57600080fd5b8151610d3681611c82565b600060208284031215611f5a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104ec576104ec611f61565b60008351611f9c818460208801611c06565b835190830190611fb0818360208801611c06565b01949350505050565b818103818111156104ec576104ec611f61565b60006001600160a01b03808716835280861660208401525083604083015260806060830152611ffe6080830184611c2a565b9695505050505050565b60006020828403121561201a57600080fd5b8151610d3681611bd356fea2646970667358221220c630ba8f4bccefef0d24d6342b73a5a1b846097a660dac3679e4fd4b37d7872e64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "approve(address,uint256)": { + "details": "See {IERC721-approve}." + }, + "balanceOf(address)": { + "details": "See {IERC721-balanceOf}." + }, + "getApproved(uint256)": { + "details": "See {IERC721-getApproved}." + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC721-isApprovedForAll}." + }, + "name()": { + "details": "See {IERC721Metadata-name}." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "ownerOf(uint256)": { + "details": "Gets the owner of the specified token ID. Names become unowned when their registration expires.", + "params": { + "tokenId": "uint256 ID of the token to query the owner of" + }, + "returns": { + "_0": "address currently marked as the owner of the given token ID" + } + }, + "reclaim(uint256,address)": { + "details": "Reclaim ownership of a name in ENS, if you own it in the registrar." + }, + "register(uint256,address,uint256)": { + "details": "Register a name.", + "params": { + "duration": "Duration in seconds for the registration.", + "id": "The token ID (keccak256 of the label).", + "owner": "The address that should own the registration." + } + }, + "registerOnly(uint256,address,uint256)": { + "details": "Register a name, without modifying the registry.", + "params": { + "duration": "Duration in seconds for the registration.", + "id": "The token ID (keccak256 of the label).", + "owner": "The address that should own the registration." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "safeTransferFrom(address,address,uint256)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,bytes)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC721-setApprovalForAll}." + }, + "symbol()": { + "details": "See {IERC721Metadata-symbol}." + }, + "tokenURI(uint256)": { + "details": "See {IERC721Metadata-tokenURI}." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC721-transferFrom}." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1443, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 1445, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 1449, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_owners", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1453, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 1457, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_tokenApprovals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1463, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_operatorApprovals", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 444, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "_owner", + "offset": 0, + "slot": "6", + "type": "t_address" + }, + { + "astId": 10741, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "expiries", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 10744, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "ens", + "offset": 0, + "slot": "8", + "type": "t_contract(ENS)14086" + }, + { + "astId": 10746, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "baseNode", + "offset": 0, + "slot": "9", + "type": "t_bytes32" + }, + { + "astId": 10750, + "contract": "contracts/ethregistrar/BaseRegistrarImplementation.sol:BaseRegistrarImplementation", + "label": "controllers", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_address,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(ENS)14086": { + "encoding": "inplace", + "label": "contract ENS", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/DummyOracle.json b/deployments/sepolia/DummyOracle.json new file mode 100644 index 00000000..47a3a914 --- /dev/null +++ b/deployments/sepolia/DummyOracle.json @@ -0,0 +1,95 @@ +{ + "address": "0x10E7e7D64d7dA687f7DcF8443Df58A0415329b15", + "abi": [ + { + "inputs": [ + { + "internalType": "int256", + "name": "_value", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "latestAnswer", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "_value", + "type": "int256" + } + ], + "name": "set", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xa34a20651d778cbb32a1af23257d589a65e378c7a1e5c2fba7304d15966991ba", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x10E7e7D64d7dA687f7DcF8443Df58A0415329b15", + "transactionIndex": 151, + "gasUsed": "114029", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa00d7f57cf9d2a122b629ef47904b56ccb2f087fadd90de9e234bef0775b32cf", + "transactionHash": "0xa34a20651d778cbb32a1af23257d589a65e378c7a1e5c2fba7304d15966991ba", + "logs": [], + "blockNumber": 3790176, + "cumulativeGasUsed": "29971655", + "status": 1, + "byzantium": true + }, + "args": [ + "160000000000" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"_value\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"_value\",\"type\":\"int256\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ethregistrar/DummyOracle.sol\":\"DummyOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"contracts/ethregistrar/DummyOracle.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ncontract DummyOracle {\\n int256 value;\\n\\n constructor(int256 _value) public {\\n set(_value);\\n }\\n\\n function set(int256 _value) public {\\n value = _value;\\n }\\n\\n function latestAnswer() public view returns (int256) {\\n return value;\\n }\\n}\\n\",\"keccak256\":\"0x8f0d88c42c074c3fb80710f7639cb455a582fa96629e26a974dd6a19c15678ff\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161011138038061011183398101604081905261002f9161003e565b61003881600055565b50610057565b60006020828403121561005057600080fd5b5051919050565b60ac806100656000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806350d25bcd146037578063e5c19b2d14604c575b600080fd5b60005460405190815260200160405180910390f35b605c6057366004605e565b600055565b005b600060208284031215606f57600080fd5b503591905056fea2646970667358221220c9677f45270b9ac03675a2089e9811608e10c406f30909f69dc2348311f7468264736f6c63430008110033", + "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c806350d25bcd146037578063e5c19b2d14604c575b600080fd5b60005460405190815260200160405180910390f35b605c6057366004605e565b600055565b005b600060208284031215606f57600080fd5b503591905056fea2646970667358221220c9677f45270b9ac03675a2089e9811608e10c406f30909f69dc2348311f7468264736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 11471, + "contract": "contracts/ethregistrar/DummyOracle.sol:DummyOracle", + "label": "value", + "offset": 0, + "slot": "0", + "type": "t_int256" + } + ], + "types": { + "t_int256": { + "encoding": "inplace", + "label": "int256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/ENSRegistry.json b/deployments/sepolia/ENSRegistry.json new file mode 100644 index 00000000..ccbec448 --- /dev/null +++ b/deployments/sepolia/ENSRegistry.json @@ -0,0 +1,420 @@ +{ + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_old", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "NewResolver", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "NewTTL", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "old", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "recordExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "resolver", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setSubnodeOwner", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setSubnodeRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setTTL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "ttl", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x3a2e7874ae2b5a081b44ea944f46fed95dfdf1dec6939f4b71081c9e9ffa43a5", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "transactionIndex": 72, + "gasUsed": "785195", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x30130fc8a318c57156306acaf6c5b016fdb6b9dfed00560a92dd360ec346a964", + "transactionHash": "0x3a2e7874ae2b5a081b44ea944f46fed95dfdf1dec6939f4b71081c9e9ffa43a5", + "logs": [], + "blockNumber": 3702728, + "cumulativeGasUsed": "7336236", + "status": 1, + "byzantium": true + }, + "args": [ + "0x94f523b8261B815b87EFfCf4d18E6aBeF18d6e4b" + ], + "numDeployments": 1, + "bytecode": "0x608060405234801561001057600080fd5b50604051610d2e380380610d2e83398101604081905261002f91610089565b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054336001600160a01b031991821617909155600280549091166001600160a01b03929092169190911790556100b9565b60006020828403121561009b57600080fd5b81516001600160a01b03811681146100b257600080fd5b9392505050565b610c66806100c86000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c80635b0fc9c31161008c578063b83f866311610066578063b83f8663146101d5578063cf408823146101e8578063e985e9c5146101fb578063f79fe5381461024757600080fd5b80635b0fc9c31461019c5780635ef2c7f0146101af578063a22cb465146101c257600080fd5b806314ab9038116100bd57806314ab90381461014857806316a25cbd1461015d5780631896f70a1461018957600080fd5b80630178b8bf146100e457806302571be31461011457806306ab592314610127575b600080fd5b6100f76100f2366004610a07565b610272565b6040516001600160a01b0390911681526020015b60405180910390f35b6100f7610122366004610a07565b61033b565b61013a610135366004610a38565b6103aa565b60405190815260200161010b565b61015b610156366004610a87565b61047a565b005b61017061016b366004610a07565b610561565b60405167ffffffffffffffff909116815260200161010b565b61015b610197366004610ab7565b61062b565b61015b6101aa366004610ab7565b6106fd565b61015b6101bd366004610adc565b61079f565b61015b6101d0366004610b3b565b6107c1565b6002546100f7906001600160a01b031681565b61015b6101f6366004610b6e565b61082d565b610237610209366004610bc1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b604051901515815260200161010b565b610237610255366004610a07565b6000908152602081905260409020546001600160a01b0316151590565b6000818152602081905260408120546001600160a01b031661031b576002546040517f0178b8bf000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0390911690630178b8bf906024015b602060405180830381865afa1580156102f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103159190610bef565b92915050565b6000828152602081905260409020600101546001600160a01b0316610315565b6000818152602081905260408120546001600160a01b03166103a1576002546040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906302571be3906024016102d4565b61031582610848565b60008381526020819052604081205484906001600160a01b0316338114806103f557506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6103fe57600080fd5b604080516020808201899052818301889052825180830384018152606090920190925280519101206104308186610870565b6040516001600160a01b0386168152869088907fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829060200160405180910390a39695505050505050565b60008281526020819052604090205482906001600160a01b0316338114806104c557506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6104ce57600080fd5b60405167ffffffffffffffff8416815284907f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa689060200160405180910390a25050600091825260208290526040909120600101805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000818152602081905260408120546001600160a01b0316610603576002546040517f16a25cbd000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906316a25cbd90602401602060405180830381865afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103159190610c13565b600082815260208190526040902060010154600160a01b900467ffffffffffffffff16610315565b60008281526020819052604090205482906001600160a01b03163381148061067657506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61067f57600080fd5b6040516001600160a01b038416815284907f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a09060200160405180910390a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b60008281526020819052604090205482906001600160a01b03163381148061074857506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61075157600080fd5b61075b8484610870565b6040516001600160a01b038416815284907fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d2669060200160405180910390a250505050565b60006107ac8686866103aa565b90506107b98184846108c0565b505050505050565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61083784846106fd565b6108428483836108c0565b50505050565b6000818152602081905260408120546001600160a01b03163081036103155750600092915050565b806001600160a01b0381166108825750305b6000838152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316179055505050565b505050565b6000838152602081905260409020600101546001600160a01b038381169116146109535760008381526020818152604091829020600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616908117909155915191825284917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0910160405180910390a25b60008381526020819052604090206001015467ffffffffffffffff828116600160a01b90920416146108bb576000838152602081815260409182902060010180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16600160a01b67ffffffffffffffff861690810291909117909155915191825284917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68910160405180910390a2505050565b600060208284031215610a1957600080fd5b5035919050565b6001600160a01b0381168114610a3557600080fd5b50565b600080600060608486031215610a4d57600080fd5b83359250602084013591506040840135610a6681610a20565b809150509250925092565b67ffffffffffffffff81168114610a3557600080fd5b60008060408385031215610a9a57600080fd5b823591506020830135610aac81610a71565b809150509250929050565b60008060408385031215610aca57600080fd5b823591506020830135610aac81610a20565b600080600080600060a08688031215610af457600080fd5b85359450602086013593506040860135610b0d81610a20565b92506060860135610b1d81610a20565b91506080860135610b2d81610a71565b809150509295509295909350565b60008060408385031215610b4e57600080fd5b8235610b5981610a20565b915060208301358015158114610aac57600080fd5b60008060008060808587031215610b8457600080fd5b843593506020850135610b9681610a20565b92506040850135610ba681610a20565b91506060850135610bb681610a71565b939692955090935050565b60008060408385031215610bd457600080fd5b8235610bdf81610a20565b91506020830135610aac81610a20565b600060208284031215610c0157600080fd5b8151610c0c81610a20565b9392505050565b600060208284031215610c2557600080fd5b8151610c0c81610a7156fea26469706673582212200ca228106ebfbcf2a8f9809dd6a6e8feb568201ac730c6e7305d2a35fd19942e64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80635b0fc9c31161008c578063b83f866311610066578063b83f8663146101d5578063cf408823146101e8578063e985e9c5146101fb578063f79fe5381461024757600080fd5b80635b0fc9c31461019c5780635ef2c7f0146101af578063a22cb465146101c257600080fd5b806314ab9038116100bd57806314ab90381461014857806316a25cbd1461015d5780631896f70a1461018957600080fd5b80630178b8bf146100e457806302571be31461011457806306ab592314610127575b600080fd5b6100f76100f2366004610a07565b610272565b6040516001600160a01b0390911681526020015b60405180910390f35b6100f7610122366004610a07565b61033b565b61013a610135366004610a38565b6103aa565b60405190815260200161010b565b61015b610156366004610a87565b61047a565b005b61017061016b366004610a07565b610561565b60405167ffffffffffffffff909116815260200161010b565b61015b610197366004610ab7565b61062b565b61015b6101aa366004610ab7565b6106fd565b61015b6101bd366004610adc565b61079f565b61015b6101d0366004610b3b565b6107c1565b6002546100f7906001600160a01b031681565b61015b6101f6366004610b6e565b61082d565b610237610209366004610bc1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b604051901515815260200161010b565b610237610255366004610a07565b6000908152602081905260409020546001600160a01b0316151590565b6000818152602081905260408120546001600160a01b031661031b576002546040517f0178b8bf000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0390911690630178b8bf906024015b602060405180830381865afa1580156102f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103159190610bef565b92915050565b6000828152602081905260409020600101546001600160a01b0316610315565b6000818152602081905260408120546001600160a01b03166103a1576002546040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906302571be3906024016102d4565b61031582610848565b60008381526020819052604081205484906001600160a01b0316338114806103f557506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6103fe57600080fd5b604080516020808201899052818301889052825180830384018152606090920190925280519101206104308186610870565b6040516001600160a01b0386168152869088907fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829060200160405180910390a39695505050505050565b60008281526020819052604090205482906001600160a01b0316338114806104c557506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6104ce57600080fd5b60405167ffffffffffffffff8416815284907f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa689060200160405180910390a25050600091825260208290526040909120600101805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000818152602081905260408120546001600160a01b0316610603576002546040517f16a25cbd000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b03909116906316a25cbd90602401602060405180830381865afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103159190610c13565b600082815260208190526040902060010154600160a01b900467ffffffffffffffff16610315565b60008281526020819052604090205482906001600160a01b03163381148061067657506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61067f57600080fd5b6040516001600160a01b038416815284907f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a09060200160405180910390a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b60008281526020819052604090205482906001600160a01b03163381148061074857506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61075157600080fd5b61075b8484610870565b6040516001600160a01b038416815284907fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d2669060200160405180910390a250505050565b60006107ac8686866103aa565b90506107b98184846108c0565b505050505050565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61083784846106fd565b6108428483836108c0565b50505050565b6000818152602081905260408120546001600160a01b03163081036103155750600092915050565b806001600160a01b0381166108825750305b6000838152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316179055505050565b505050565b6000838152602081905260409020600101546001600160a01b038381169116146109535760008381526020818152604091829020600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616908117909155915191825284917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0910160405180910390a25b60008381526020819052604090206001015467ffffffffffffffff828116600160a01b90920416146108bb576000838152602081815260409182902060010180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16600160a01b67ffffffffffffffff861690810291909117909155915191825284917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68910160405180910390a2505050565b600060208284031215610a1957600080fd5b5035919050565b6001600160a01b0381168114610a3557600080fd5b50565b600080600060608486031215610a4d57600080fd5b83359250602084013591506040840135610a6681610a20565b809150509250925092565b67ffffffffffffffff81168114610a3557600080fd5b60008060408385031215610a9a57600080fd5b823591506020830135610aac81610a71565b809150509250929050565b60008060408385031215610aca57600080fd5b823591506020830135610aac81610a20565b600080600080600060a08688031215610af457600080fd5b85359450602086013593506040860135610b0d81610a20565b92506060860135610b1d81610a20565b91506080860135610b2d81610a71565b809150509295509295909350565b60008060408385031215610b4e57600080fd5b8235610b5981610a20565b915060208301358015158114610aac57600080fd5b60008060008060808587031215610b8457600080fd5b843593506020850135610b9681610a20565b92506040850135610ba681610a20565b91506060850135610bb681610a71565b939692955090935050565b60008060408385031215610bd457600080fd5b8235610bdf81610a20565b91506020830135610aac81610a20565b600060208284031215610c0157600080fd5b8151610c0c81610a20565b9392505050565b600060208284031215610c2557600080fd5b8151610c0c81610a7156fea26469706673582212200ca228106ebfbcf2a8f9809dd6a6e8feb568201ac730c6e7305d2a35fd19942e64736f6c63430008110033" +} \ No newline at end of file diff --git a/deployments/sepolia/ETHRegistrarController.json b/deployments/sepolia/ETHRegistrarController.json new file mode 100644 index 00000000..5972307e --- /dev/null +++ b/deployments/sepolia/ETHRegistrarController.json @@ -0,0 +1,750 @@ +{ + "address": "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72", + "abi": [ + { + "inputs": [ + { + "internalType": "contract BaseRegistrarImplementation", + "name": "_base", + "type": "address" + }, + { + "internalType": "contract IPriceOracle", + "name": "_prices", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minCommitmentAge", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxCommitmentAge", + "type": "uint256" + }, + { + "internalType": "contract ReverseRegistrar", + "name": "_reverseRegistrar", + "type": "address" + }, + { + "internalType": "contract INameWrapper", + "name": "_nameWrapper", + "type": "address" + }, + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "CommitmentTooNew", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "CommitmentTooOld", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "DurationTooShort", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientValue", + "type": "error" + }, + { + "inputs": [], + "name": "MaxCommitmentAgeTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "MaxCommitmentAgeTooLow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "NameNotAvailable", + "type": "error" + }, + { + "inputs": [], + "name": "ResolverRequiredWhenDataSupplied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "UnexpiredCommitmentExists", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseCost", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cost", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRenewed", + "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": [], + "name": "MIN_REGISTRATION_DURATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "available", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "commit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "commitments", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + }, + { + "internalType": "bool", + "name": "reverseRecord", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "ownerControlledFuses", + "type": "uint16" + } + ], + "name": "makeCommitment", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "maxCommitmentAge", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minCommitmentAge", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nameWrapper", + "outputs": [ + { + "internalType": "contract INameWrapper", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prices", + "outputs": [ + { + "internalType": "contract IPriceOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + }, + { + "internalType": "bool", + "name": "reverseRecord", + "type": "bool" + }, + { + "internalType": "uint16", + "name": "ownerControlledFuses", + "type": "uint16" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "renew", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "rentPrice", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + } + ], + "internalType": "struct IPriceOracle.Price", + "name": "price", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reverseRegistrar", + "outputs": [ + { + "internalType": "contract ReverseRegistrar", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "valid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x842b96cea2171ff612001f026b252a880b2c23332c1f6112ec692fb9c6fbccc2", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72", + "transactionIndex": 72, + "gasUsed": "1771825", + "logsBloom": "0x00000000000002000000000000000000000000000000200000800000000000000000000000000000000000000000000000000002000010000000000000000000000000000000000000000000008000000001000000000000000008000080000000000000020000000000100000000800000002000000000000000000000002400000210000000000000000000000000000000000000010200000000000004000002000000000040008000019000000000000000000000000008000040000000000000000000000000000000000005040000000000000000400000000000020000000000000000000000020000100000000000000001000000000000000000000", + "blockHash": "0x12d41439f68bb1d4eb1b323ce22c9257f85f214ec6a4ff53e7c68d2a5c4664e2", + "transactionHash": "0x842b96cea2171ff612001f026b252a880b2c23332c1f6112ec692fb9c6fbccc2", + "logs": [ + { + "transactionIndex": 72, + "blockNumber": 3790244, + "transactionHash": "0x842b96cea2171ff612001f026b252a880b2c23332c1f6112ec692fb9c6fbccc2", + "address": "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 97, + "blockHash": "0x12d41439f68bb1d4eb1b323ce22c9257f85f214ec6a4ff53e7c68d2a5c4664e2" + }, + { + "transactionIndex": 72, + "blockNumber": 3790244, + "transactionHash": "0x842b96cea2171ff612001f026b252a880b2c23332c1f6112ec692fb9c6fbccc2", + "address": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "topics": [ + "0x6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e92", + "0x000000000000000000000000fed6a969aaa60e4961fcd3ebf1a2e8913ac65b72", + "0x7661589aea842197032e762e8f0a927a61f732c0235a27b33ddcdf27c050c519" + ], + "data": "0x", + "logIndex": 98, + "blockHash": "0x12d41439f68bb1d4eb1b323ce22c9257f85f214ec6a4ff53e7c68d2a5c4664e2" + }, + { + "transactionIndex": 72, + "blockNumber": 3790244, + "transactionHash": "0x842b96cea2171ff612001f026b252a880b2c23332c1f6112ec692fb9c6fbccc2", + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "topics": [ + "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", + "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2", + "0xbfb76a16c3870a1757f8cacff8a15cce937fbb7fd09a9877dea0457abe6ebd31" + ], + "data": "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "logIndex": 99, + "blockHash": "0x12d41439f68bb1d4eb1b323ce22c9257f85f214ec6a4ff53e7c68d2a5c4664e2" + } + ], + "blockNumber": 3790244, + "cumulativeGasUsed": "13921997", + "status": 1, + "byzantium": true + }, + "args": [ + "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "0x6810dbce73c67506f785a225f818b30d8f209aab", + 60, + 86400, + "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "0x0635513f179D50A207757E05759CbD106d7dFcE8", + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract BaseRegistrarImplementation\",\"name\":\"_base\",\"type\":\"address\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"_prices\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minCommitmentAge\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxCommitmentAge\",\"type\":\"uint256\"},{\"internalType\":\"contract ReverseRegistrar\",\"name\":\"_reverseRegistrar\",\"type\":\"address\"},{\"internalType\":\"contract INameWrapper\",\"name\":\"_nameWrapper\",\"type\":\"address\"},{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"}],\"name\":\"CommitmentTooNew\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"}],\"name\":\"CommitmentTooOld\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"DurationTooShort\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientValue\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxCommitmentAgeTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxCommitmentAgeTooLow\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NameNotAvailable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ResolverRequiredWhenDataSupplied\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"}],\"name\":\"UnexpiredCommitmentExists\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"label\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"premium\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"name\":\"NameRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"label\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"name\":\"NameRenewed\",\"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\":[],\"name\":\"MIN_REGISTRATION_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"available\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"commitment\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"commitments\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"},{\"internalType\":\"bool\",\"name\":\"reverseRecord\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"ownerControlledFuses\",\"type\":\"uint16\"}],\"name\":\"makeCommitment\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxCommitmentAge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minCommitmentAge\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nameWrapper\",\"outputs\":[{\"internalType\":\"contract INameWrapper\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"prices\",\"outputs\":[{\"internalType\":\"contract IPriceOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"secret\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"},{\"internalType\":\"bool\",\"name\":\"reverseRecord\",\"type\":\"bool\"},{\"internalType\":\"uint16\",\"name\":\"ownerControlledFuses\",\"type\":\"uint16\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"renew\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"rentPrice\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"base\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"premium\",\"type\":\"uint256\"}],\"internalType\":\"struct IPriceOracle.Price\",\"name\":\"price\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reverseRegistrar\",\"outputs\":[{\"internalType\":\"contract ReverseRegistrar\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"valid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A registrar controller for registering and renewing names at fixed cost.\",\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"recoverFunds(address,address,uint256)\":{\"details\":\"The contract is Ownable and only the owner can call the recover function.\",\"params\":{\"_amount\":\"The amount of tokens to recover.\",\"_to\":\"The address to send the tokens to.\",\"_token\":\"The address of the ERC20 token to recover\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"recoverFunds(address,address,uint256)\":{\"notice\":\"Recover ERC20 tokens sent to the contract by mistake.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ethregistrar/ETHRegistrarController.sol\":\"ETHRegistrarController\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC721.sol\\\";\\nimport \\\"./IERC721Receiver.sol\\\";\\nimport \\\"./extensions/IERC721Metadata.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/Strings.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\\n using Address for address;\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n // Mapping from token ID to owner address\\n mapping(uint256 => address) private _owners;\\n\\n // Mapping owner address to token count\\n mapping(address => uint256) private _balances;\\n\\n // Mapping from token ID to approved address\\n mapping(uint256 => address) private _tokenApprovals;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual override returns (uint256) {\\n require(owner != address(0), \\\"ERC721: address zero is not a valid owner\\\");\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\\n address owner = _ownerOf(tokenId);\\n require(owner != address(0), \\\"ERC721: invalid token ID\\\");\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireMinted(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual override {\\n address owner = ERC721.ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\\n _requireMinted(tokenId);\\n\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n //solhint-disable-next-line max-line-length\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n\\n _transfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) public virtual override {\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n _safeTransfer(from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _transfer(from, to, tokenId);\\n require(_checkOnERC721Received(from, to, tokenId, data), \\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `tokenId` exists.\\n *\\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\\n *\\n * Tokens start existing when they are minted (`_mint`),\\n * and stop existing when they are burned (`_burn`).\\n */\\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\\n return _ownerOf(tokenId) != address(0);\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Safely mints `tokenId` and transfers it to `to`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal virtual {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _mint(to, tokenId);\\n require(\\n _checkOnERC721Received(address(0), to, tokenId, data),\\n \\\"ERC721: transfer to non ERC721Receiver implementer\\\"\\n );\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal virtual {\\n require(to != address(0), \\\"ERC721: mint to the zero address\\\");\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n _beforeTokenTransfer(address(0), to, tokenId, 1);\\n\\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n unchecked {\\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\\n // Given that tokens are minted one by one, it is impossible in practice that\\n // this ever happens. Might change if we allow batch minting.\\n // The ERC fails to describe this case.\\n _balances[to] += 1;\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal virtual {\\n address owner = ERC721.ownerOf(tokenId);\\n\\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\\n\\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\\n owner = ERC721.ownerOf(tokenId);\\n\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // Cannot overflow, as that would require more tokens to be burned/transferred\\n // out than the owner initially received through minting and transferring in.\\n _balances[owner] -= 1;\\n }\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId, 1);\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 tokenId\\n ) internal virtual {\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n require(to != address(0), \\\"ERC721: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, tokenId, 1);\\n\\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n\\n // Clear approvals from the previous owner\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\\n // `from`'s balance is the number of token held, which is at least one before the current\\n // transfer.\\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\\n // all 2**256 token ids to be minted, which in practice is impossible.\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n }\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC721: approve to caller\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` has not been minted yet.\\n */\\n function _requireMinted(uint256 tokenId) internal view virtual {\\n require(_exists(tokenId), \\\"ERC721: invalid token ID\\\");\\n }\\n\\n /**\\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\\n * The call is not executed if the target address is not a contract.\\n *\\n * @param from address representing the previous owner of the given token ID\\n * @param to target address that will receive the tokens\\n * @param tokenId uint256 ID of the token to be transferred\\n * @param data bytes optional data to send along with the call\\n * @return bool whether the call correctly returned the expected magic value\\n */\\n function _checkOnERC721Received(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) private returns (bool) {\\n if (to.isContract()) {\\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\\n return retval == IERC721Receiver.onERC721Received.selector;\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n revert(\\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n } else {\\n /// @solidity memory-safe-assembly\\n assembly {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n } else {\\n return true;\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\\n * - When `from` is zero, the tokens will be minted for `to`.\\n * - When `to` is zero, ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256, /* firstTokenId */\\n uint256 batchSize\\n ) internal virtual {\\n if (batchSize > 1) {\\n if (from != address(0)) {\\n _balances[from] -= batchSize;\\n }\\n if (to != address(0)) {\\n _balances[to] += batchSize;\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\\n * - When `from` is zero, the tokens were minted for `to`.\\n * - When `to` is zero, ``from``'s tokens were burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 firstTokenId,\\n uint256 batchSize\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xd89f3585b211fc9e3408384a4c4efdc3a93b2f877a3821046fa01c219d35be1b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x75b829ff2f26c14355d1cba20e16fe7b29ca58eb5fef665ede48bc0f9c6c74b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/ethregistrar/BaseRegistrarImplementation.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable {\\n // A map of expiry times\\n mapping(uint256 => uint256) expiries;\\n // The ENS registry\\n ENS public ens;\\n // The namehash of the TLD this registrar owns (eg, .eth)\\n bytes32 public baseNode;\\n // A map of addresses that are authorised to register and renew names.\\n mapping(address => bool) public controllers;\\n uint256 public constant GRACE_PERIOD = 90 days;\\n bytes4 private constant INTERFACE_META_ID =\\n bytes4(keccak256(\\\"supportsInterface(bytes4)\\\"));\\n bytes4 private constant ERC721_ID =\\n bytes4(\\n keccak256(\\\"balanceOf(address)\\\") ^\\n keccak256(\\\"ownerOf(uint256)\\\") ^\\n keccak256(\\\"approve(address,uint256)\\\") ^\\n keccak256(\\\"getApproved(uint256)\\\") ^\\n keccak256(\\\"setApprovalForAll(address,bool)\\\") ^\\n keccak256(\\\"isApprovedForAll(address,address)\\\") ^\\n keccak256(\\\"transferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256,bytes)\\\")\\n );\\n bytes4 private constant RECLAIM_ID =\\n bytes4(keccak256(\\\"reclaim(uint256,address)\\\"));\\n\\n /**\\n * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);\\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187\\n * @dev Returns whether the given spender can transfer a given token ID\\n * @param spender address of the spender to query\\n * @param tokenId uint256 ID of the token to be transferred\\n * @return bool whether the msg.sender is approved for the given token ID,\\n * is an operator of the owner, or is the owner of the token\\n */\\n function _isApprovedOrOwner(\\n address spender,\\n uint256 tokenId\\n ) internal view override returns (bool) {\\n address owner = ownerOf(tokenId);\\n return (spender == owner ||\\n getApproved(tokenId) == spender ||\\n isApprovedForAll(owner, spender));\\n }\\n\\n constructor(ENS _ens, bytes32 _baseNode) ERC721(\\\"\\\", \\\"\\\") {\\n ens = _ens;\\n baseNode = _baseNode;\\n }\\n\\n modifier live() {\\n require(ens.owner(baseNode) == address(this));\\n _;\\n }\\n\\n modifier onlyController() {\\n require(controllers[msg.sender]);\\n _;\\n }\\n\\n /**\\n * @dev Gets the owner of the specified token ID. Names become unowned\\n * when their registration expires.\\n * @param tokenId uint256 ID of the token to query the owner of\\n * @return address currently marked as the owner of the given token ID\\n */\\n function ownerOf(\\n uint256 tokenId\\n ) public view override(IERC721, ERC721) returns (address) {\\n require(expiries[tokenId] > block.timestamp);\\n return super.ownerOf(tokenId);\\n }\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external override onlyOwner {\\n controllers[controller] = true;\\n emit ControllerAdded(controller);\\n }\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external override onlyOwner {\\n controllers[controller] = false;\\n emit ControllerRemoved(controller);\\n }\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external override onlyOwner {\\n ens.setResolver(baseNode, resolver);\\n }\\n\\n // Returns the expiration timestamp of the specified id.\\n function nameExpires(uint256 id) external view override returns (uint256) {\\n return expiries[id];\\n }\\n\\n // Returns true iff the specified name is available for registration.\\n function available(uint256 id) public view override returns (bool) {\\n // Not available if it's registered here or in its grace period.\\n return expiries[id] + GRACE_PERIOD < block.timestamp;\\n }\\n\\n /**\\n * @dev Register a name.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external override returns (uint256) {\\n return _register(id, owner, duration, true);\\n }\\n\\n /**\\n * @dev Register a name, without modifying the registry.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function registerOnly(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256) {\\n return _register(id, owner, duration, false);\\n }\\n\\n function _register(\\n uint256 id,\\n address owner,\\n uint256 duration,\\n bool updateRegistry\\n ) internal live onlyController returns (uint256) {\\n require(available(id));\\n require(\\n block.timestamp + duration + GRACE_PERIOD >\\n block.timestamp + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] = block.timestamp + duration;\\n if (_exists(id)) {\\n // Name was previously owned, and expired\\n _burn(id);\\n }\\n _mint(owner, id);\\n if (updateRegistry) {\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n emit NameRegistered(id, owner, block.timestamp + duration);\\n\\n return block.timestamp + duration;\\n }\\n\\n function renew(\\n uint256 id,\\n uint256 duration\\n ) external override live onlyController returns (uint256) {\\n require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period\\n require(\\n expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] += duration;\\n emit NameRenewed(id, expiries[id]);\\n return expiries[id];\\n }\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external override live {\\n require(_isApprovedOrOwner(msg.sender, id));\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view override(ERC721, IERC165) returns (bool) {\\n return\\n interfaceID == INTERFACE_META_ID ||\\n interfaceID == ERC721_ID ||\\n interfaceID == RECLAIM_ID;\\n }\\n}\\n\",\"keccak256\":\"0xaee6eb36aead449d397b86a02e9c63bc46e3ef378d0a62bfd68beaae1150c9d0\"},\"contracts/ethregistrar/ETHRegistrarController.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport {BaseRegistrarImplementation} from \\\"./BaseRegistrarImplementation.sol\\\";\\nimport {StringUtils} from \\\"./StringUtils.sol\\\";\\nimport {Resolver} from \\\"../resolvers/Resolver.sol\\\";\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {ReverseRegistrar} from \\\"../reverseRegistrar/ReverseRegistrar.sol\\\";\\nimport {ReverseClaimer} from \\\"../reverseRegistrar/ReverseClaimer.sol\\\";\\nimport {IETHRegistrarController, IPriceOracle} from \\\"./IETHRegistrarController.sol\\\";\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC165} from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {INameWrapper} from \\\"../wrapper/INameWrapper.sol\\\";\\nimport {ERC20Recoverable} from \\\"../utils/ERC20Recoverable.sol\\\";\\n\\nerror CommitmentTooNew(bytes32 commitment);\\nerror CommitmentTooOld(bytes32 commitment);\\nerror NameNotAvailable(string name);\\nerror DurationTooShort(uint256 duration);\\nerror ResolverRequiredWhenDataSupplied();\\nerror UnexpiredCommitmentExists(bytes32 commitment);\\nerror InsufficientValue();\\nerror Unauthorised(bytes32 node);\\nerror MaxCommitmentAgeTooLow();\\nerror MaxCommitmentAgeTooHigh();\\n\\n/**\\n * @dev A registrar controller for registering and renewing names at fixed cost.\\n */\\ncontract ETHRegistrarController is\\n Ownable,\\n IETHRegistrarController,\\n IERC165,\\n ERC20Recoverable,\\n ReverseClaimer\\n{\\n using StringUtils for *;\\n using Address for address;\\n\\n uint256 public constant MIN_REGISTRATION_DURATION = 28 days;\\n bytes32 private constant ETH_NODE =\\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\\n uint64 private constant MAX_EXPIRY = type(uint64).max;\\n BaseRegistrarImplementation immutable base;\\n IPriceOracle public immutable prices;\\n uint256 public immutable minCommitmentAge;\\n uint256 public immutable maxCommitmentAge;\\n ReverseRegistrar public immutable reverseRegistrar;\\n INameWrapper public immutable nameWrapper;\\n\\n mapping(bytes32 => uint256) public commitments;\\n\\n event NameRegistered(\\n string name,\\n bytes32 indexed label,\\n address indexed owner,\\n uint256 baseCost,\\n uint256 premium,\\n uint256 expires\\n );\\n event NameRenewed(\\n string name,\\n bytes32 indexed label,\\n uint256 cost,\\n uint256 expires\\n );\\n\\n constructor(\\n BaseRegistrarImplementation _base,\\n IPriceOracle _prices,\\n uint256 _minCommitmentAge,\\n uint256 _maxCommitmentAge,\\n ReverseRegistrar _reverseRegistrar,\\n INameWrapper _nameWrapper,\\n ENS _ens\\n ) ReverseClaimer(_ens, msg.sender) {\\n if (_maxCommitmentAge <= _minCommitmentAge) {\\n revert MaxCommitmentAgeTooLow();\\n }\\n\\n if (_maxCommitmentAge > block.timestamp) {\\n revert MaxCommitmentAgeTooHigh();\\n }\\n\\n base = _base;\\n prices = _prices;\\n minCommitmentAge = _minCommitmentAge;\\n maxCommitmentAge = _maxCommitmentAge;\\n reverseRegistrar = _reverseRegistrar;\\n nameWrapper = _nameWrapper;\\n }\\n\\n function rentPrice(\\n string memory name,\\n uint256 duration\\n ) public view override returns (IPriceOracle.Price memory price) {\\n bytes32 label = keccak256(bytes(name));\\n price = prices.price(name, base.nameExpires(uint256(label)), duration);\\n }\\n\\n function valid(string memory name) public pure returns (bool) {\\n return name.strlen() >= 3;\\n }\\n\\n function available(string memory name) public view override returns (bool) {\\n bytes32 label = keccak256(bytes(name));\\n return valid(name) && base.available(uint256(label));\\n }\\n\\n function makeCommitment(\\n string memory name,\\n address owner,\\n uint256 duration,\\n bytes32 secret,\\n address resolver,\\n bytes[] calldata data,\\n bool reverseRecord,\\n uint16 ownerControlledFuses\\n ) public pure override returns (bytes32) {\\n bytes32 label = keccak256(bytes(name));\\n if (data.length > 0 && resolver == address(0)) {\\n revert ResolverRequiredWhenDataSupplied();\\n }\\n return\\n keccak256(\\n abi.encode(\\n label,\\n owner,\\n duration,\\n secret,\\n resolver,\\n data,\\n reverseRecord,\\n ownerControlledFuses\\n )\\n );\\n }\\n\\n function commit(bytes32 commitment) public override {\\n if (commitments[commitment] + maxCommitmentAge >= block.timestamp) {\\n revert UnexpiredCommitmentExists(commitment);\\n }\\n commitments[commitment] = block.timestamp;\\n }\\n\\n function register(\\n string calldata name,\\n address owner,\\n uint256 duration,\\n bytes32 secret,\\n address resolver,\\n bytes[] calldata data,\\n bool reverseRecord,\\n uint16 ownerControlledFuses\\n ) public payable override {\\n IPriceOracle.Price memory price = rentPrice(name, duration);\\n if (msg.value < price.base + price.premium) {\\n revert InsufficientValue();\\n }\\n\\n _consumeCommitment(\\n name,\\n duration,\\n makeCommitment(\\n name,\\n owner,\\n duration,\\n secret,\\n resolver,\\n data,\\n reverseRecord,\\n ownerControlledFuses\\n )\\n );\\n\\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\\n name,\\n owner,\\n duration,\\n resolver,\\n ownerControlledFuses\\n );\\n\\n if (data.length > 0) {\\n _setRecords(resolver, keccak256(bytes(name)), data);\\n }\\n\\n if (reverseRecord) {\\n _setReverseRecord(name, resolver, msg.sender);\\n }\\n\\n emit NameRegistered(\\n name,\\n keccak256(bytes(name)),\\n owner,\\n price.base,\\n price.premium,\\n expires\\n );\\n\\n if (msg.value > (price.base + price.premium)) {\\n payable(msg.sender).transfer(\\n msg.value - (price.base + price.premium)\\n );\\n }\\n }\\n\\n function renew(\\n string calldata name,\\n uint256 duration\\n ) external payable override {\\n bytes32 labelhash = keccak256(bytes(name));\\n uint256 tokenId = uint256(labelhash);\\n IPriceOracle.Price memory price = rentPrice(name, duration);\\n if (msg.value < price.base) {\\n revert InsufficientValue();\\n }\\n uint256 expires = nameWrapper.renew(tokenId, duration);\\n\\n if (msg.value > price.base) {\\n payable(msg.sender).transfer(msg.value - price.base);\\n }\\n\\n emit NameRenewed(name, labelhash, msg.value, expires);\\n }\\n\\n function withdraw() public {\\n payable(owner()).transfer(address(this).balance);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) external pure returns (bool) {\\n return\\n interfaceID == type(IERC165).interfaceId ||\\n interfaceID == type(IETHRegistrarController).interfaceId;\\n }\\n\\n /* Internal functions */\\n\\n function _consumeCommitment(\\n string memory name,\\n uint256 duration,\\n bytes32 commitment\\n ) internal {\\n // Require an old enough commitment.\\n if (commitments[commitment] + minCommitmentAge > block.timestamp) {\\n revert CommitmentTooNew(commitment);\\n }\\n\\n // If the commitment is too old, or the name is registered, stop\\n if (commitments[commitment] + maxCommitmentAge <= block.timestamp) {\\n revert CommitmentTooOld(commitment);\\n }\\n if (!available(name)) {\\n revert NameNotAvailable(name);\\n }\\n\\n delete (commitments[commitment]);\\n\\n if (duration < MIN_REGISTRATION_DURATION) {\\n revert DurationTooShort(duration);\\n }\\n }\\n\\n function _setRecords(\\n address resolverAddress,\\n bytes32 label,\\n bytes[] calldata data\\n ) internal {\\n // use hardcoded .eth namehash\\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, label));\\n Resolver resolver = Resolver(resolverAddress);\\n resolver.multicallWithNodeCheck(nodehash, data);\\n }\\n\\n function _setReverseRecord(\\n string memory name,\\n address resolver,\\n address owner\\n ) internal {\\n reverseRegistrar.setNameForAddr(\\n msg.sender,\\n owner,\\n resolver,\\n string.concat(name, \\\".eth\\\")\\n );\\n }\\n}\\n\",\"keccak256\":\"0x2ba2cab655f9128ae5c803540b8712be9bdfee1a28b9623a06c02c2435d0ce8b\",\"license\":\"MIT\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/ethregistrar/IETHRegistrarController.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./IPriceOracle.sol\\\";\\n\\ninterface IETHRegistrarController {\\n function rentPrice(\\n string memory,\\n uint256\\n ) external view returns (IPriceOracle.Price memory);\\n\\n function available(string memory) external returns (bool);\\n\\n function makeCommitment(\\n string memory,\\n address,\\n uint256,\\n bytes32,\\n address,\\n bytes[] calldata,\\n bool,\\n uint16\\n ) external pure returns (bytes32);\\n\\n function commit(bytes32) external;\\n\\n function register(\\n string calldata,\\n address,\\n uint256,\\n bytes32,\\n address,\\n bytes[] calldata,\\n bool,\\n uint16\\n ) external payable;\\n\\n function renew(string calldata, uint256) external payable;\\n}\\n\",\"keccak256\":\"0x54575cc2e4245c0ba79e42a58086335ec0522f4cbeb8c92d71b886593c97060e\",\"license\":\"MIT\"},\"contracts/ethregistrar/IPriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\ninterface IPriceOracle {\\n struct Price {\\n uint256 base;\\n uint256 premium;\\n }\\n\\n /**\\n * @dev Returns the price to register or renew a name.\\n * @param name The name being registered or renewed.\\n * @param expires When the name presently expires (0 if this is a new registration).\\n * @param duration How long the name is being registered or extended for, in seconds.\\n * @return base premium tuple of base price + premium price\\n */\\n function price(\\n string calldata name,\\n uint256 expires,\\n uint256 duration\\n ) external view returns (Price calldata);\\n}\\n\",\"keccak256\":\"0x1ec537b4c7f9cc40363b39dcc7ade8c29bf94662e6b01d38e681487637bd577e\",\"license\":\"MIT\"},\"contracts/ethregistrar/StringUtils.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nlibrary StringUtils {\\n /**\\n * @dev Returns the length of a given string\\n *\\n * @param s The string to measure the length of\\n * @return The length of the input string\\n */\\n function strlen(string memory s) internal pure returns (uint256) {\\n uint256 len;\\n uint256 i = 0;\\n uint256 bytelength = bytes(s).length;\\n for (len = 0; i < bytelength; len++) {\\n bytes1 b = bytes(s)[i];\\n if (b < 0x80) {\\n i += 1;\\n } else if (b < 0xE0) {\\n i += 2;\\n } else if (b < 0xF0) {\\n i += 3;\\n } else if (b < 0xF8) {\\n i += 4;\\n } else if (b < 0xFC) {\\n i += 5;\\n } else {\\n i += 6;\\n }\\n }\\n return len;\\n }\\n}\\n\",\"keccak256\":\"0x4cc8363a850dc9130c433ee50e7c97e29a45ae5d9bd0808205ac7134b34f24e4\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/resolvers/Resolver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"./profiles/IABIResolver.sol\\\";\\nimport \\\"./profiles/IAddressResolver.sol\\\";\\nimport \\\"./profiles/IAddrResolver.sol\\\";\\nimport \\\"./profiles/IContentHashResolver.sol\\\";\\nimport \\\"./profiles/IDNSRecordResolver.sol\\\";\\nimport \\\"./profiles/IDNSZoneResolver.sol\\\";\\nimport \\\"./profiles/IInterfaceResolver.sol\\\";\\nimport \\\"./profiles/INameResolver.sol\\\";\\nimport \\\"./profiles/IPubkeyResolver.sol\\\";\\nimport \\\"./profiles/ITextResolver.sol\\\";\\nimport \\\"./profiles/IExtendedResolver.sol\\\";\\n\\n/**\\n * A generic resolver interface which includes all the functions including the ones deprecated\\n */\\ninterface Resolver is\\n IERC165,\\n IABIResolver,\\n IAddressResolver,\\n IAddrResolver,\\n IContentHashResolver,\\n IDNSRecordResolver,\\n IDNSZoneResolver,\\n IInterfaceResolver,\\n INameResolver,\\n IPubkeyResolver,\\n ITextResolver,\\n IExtendedResolver\\n{\\n /* Deprecated events */\\n event ContentChanged(bytes32 indexed node, bytes32 hash);\\n\\n function setApprovalForAll(address, bool) external;\\n\\n function approve(bytes32 node, address delegate, bool approved) external;\\n\\n function isApprovedForAll(address account, address operator) external;\\n\\n function isApprovedFor(\\n address owner,\\n bytes32 node,\\n address delegate\\n ) external;\\n\\n function setABI(\\n bytes32 node,\\n uint256 contentType,\\n bytes calldata data\\n ) external;\\n\\n function setAddr(bytes32 node, address addr) external;\\n\\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\\n\\n function setContenthash(bytes32 node, bytes calldata hash) external;\\n\\n function setDnsrr(bytes32 node, bytes calldata data) external;\\n\\n function setName(bytes32 node, string calldata _name) external;\\n\\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\\n\\n function setText(\\n bytes32 node,\\n string calldata key,\\n string calldata value\\n ) external;\\n\\n function setInterface(\\n bytes32 node,\\n bytes4 interfaceID,\\n address implementer\\n ) external;\\n\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(\\n bytes32 nodehash,\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n /* Deprecated functions */\\n function content(bytes32 node) external view returns (bytes32);\\n\\n function multihash(bytes32 node) external view returns (bytes memory);\\n\\n function setContent(bytes32 node, bytes32 hash) external;\\n\\n function setMultihash(bytes32 node, bytes calldata hash) external;\\n}\\n\",\"keccak256\":\"0xfc77ab6b7c59c3ebfe1c720bdebf9b08c2488ff7ac9501a9aa056c5d6d5b50c5\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IABIResolver {\\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0x85b373d02d19374fe570af407f459768285704bf7f30ab17c30eabfb5a10e4c3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the legacy (ETH-only) addr function.\\n */\\ninterface IAddrResolver {\\n event AddrChanged(bytes32 indexed node, address a);\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0x2ad7f2fc60ebe0f93745fe70247f6a854f66af732483fda2a3c5e055614445e8\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the new (multicoin) addr function.\\n */\\ninterface IAddressResolver {\\n event AddressChanged(\\n bytes32 indexed node,\\n uint256 coinType,\\n bytes newAddress\\n );\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x411447c1e90c51e09702815a85ec725ffbbe37cf96e8cc4d2a8bd4ad8a59d73e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IContentHashResolver {\\n event ContenthashChanged(bytes32 indexed node, bytes hash);\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xd95cd77684ba5752c428d7dceb4ecc6506ac94f4fbb910489637eb68dcd8e366\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSRecordResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSRecordResolver {\\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\\n event DNSRecordChanged(\\n bytes32 indexed node,\\n bytes name,\\n uint16 resource,\\n bytes record\\n );\\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xcfa52200edd337f2c6c5bf402352600584da033b21323603e53de33051a3e25d\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSZoneResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSZoneResolver {\\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\\n event DNSZonehashChanged(\\n bytes32 indexed node,\\n bytes lastzonehash,\\n bytes zonehash\\n );\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xca1b3a16e7005533f2800a3e66fcdccf7c574deac7913d8c810f40aec1d58dc0\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IExtendedResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ninterface IExtendedResolver {\\n function resolve(\\n bytes memory name,\\n bytes memory data\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x5d81521cfae7d9a4475d27533cd8ed0d3475d369eb0674fd90ffbdbdf292faa3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IInterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IInterfaceResolver {\\n event InterfaceChanged(\\n bytes32 indexed node,\\n bytes4 indexed interfaceID,\\n address implementer\\n );\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view returns (address);\\n}\\n\",\"keccak256\":\"0x390321fb58f7b927df9562450981e74b4be3907e7c09df321fd3b7409b63ae28\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/INameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface INameResolver {\\n event NameChanged(bytes32 indexed node, string name);\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(bytes32 node) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x9ec392b612447b1acbdc01114f2da2837a658d3f3157f60a99c5269f0b623346\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IPubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IPubkeyResolver {\\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\\n}\\n\",\"keccak256\":\"0x69748947093dd2fda9ddcebd0adf19a6d1e7600df1d4b1462a0417156caddca7\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ITextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface ITextResolver {\\n event TextChanged(\\n bytes32 indexed node,\\n string indexed indexedKey,\\n string key,\\n string value\\n );\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x7c5debb3c42cd9f5de2274ea7aa053f238608314b62db441c40e31cea2543fd5\",\"license\":\"MIT\"},\"contracts/reverseRegistrar/IReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface IReverseRegistrar {\\n function setDefaultResolver(address resolver) external;\\n\\n function claim(address owner) external returns (bytes32);\\n\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function setName(string memory name) external returns (bytes32);\\n\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) external returns (bytes32);\\n\\n function node(address addr) external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0x83adfcf6da72b1bcd1e3ac387afe5fc7fdf7f2ac28b7601544d2ca4b9d45d159\"},\"contracts/reverseRegistrar/ReverseClaimer.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IReverseRegistrar} from \\\"../reverseRegistrar/IReverseRegistrar.sol\\\";\\n\\ncontract ReverseClaimer {\\n bytes32 constant ADDR_REVERSE_NODE =\\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n constructor(ENS ens, address claimant) {\\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\\n ens.owner(ADDR_REVERSE_NODE)\\n );\\n reverseRegistrar.claim(claimant);\\n }\\n}\\n\",\"keccak256\":\"0x78a28627241535b595f6fff476a1fa7acc90c80684fe7784734920fc8af6fc22\",\"license\":\"MIT\"},\"contracts/reverseRegistrar/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IReverseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../root/Controllable.sol\\\";\\n\\nabstract contract NameResolver {\\n function setName(bytes32 node, string memory name) public virtual;\\n}\\n\\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\\n\\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n// namehash('addr.reverse')\\n\\ncontract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar {\\n ENS public immutable ens;\\n NameResolver public defaultResolver;\\n\\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\\n event DefaultResolverChanged(NameResolver indexed resolver);\\n\\n /**\\n * @dev Constructor\\n * @param ensAddr The address of the ENS registry.\\n */\\n constructor(ENS ensAddr) {\\n ens = ensAddr;\\n\\n // Assign ownership of the reverse record to our deployer\\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\\n ensAddr.owner(ADDR_REVERSE_NODE)\\n );\\n if (address(oldRegistrar) != address(0x0)) {\\n oldRegistrar.claim(msg.sender);\\n }\\n }\\n\\n modifier authorised(address addr) {\\n require(\\n addr == msg.sender ||\\n controllers[msg.sender] ||\\n ens.isApprovedForAll(addr, msg.sender) ||\\n ownsContract(addr),\\n \\\"ReverseRegistrar: Caller is not a controller or authorised by address or the address itself\\\"\\n );\\n _;\\n }\\n\\n function setDefaultResolver(address resolver) public override onlyOwner {\\n require(\\n address(resolver) != address(0),\\n \\\"ReverseRegistrar: Resolver address must not be 0\\\"\\n );\\n defaultResolver = NameResolver(resolver);\\n emit DefaultResolverChanged(NameResolver(resolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claim(address owner) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, address(defaultResolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param addr The reverse record to set\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The resolver of the reverse node\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) public override authorised(addr) returns (bytes32) {\\n bytes32 labelHash = sha3HexAddress(addr);\\n bytes32 reverseNode = keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, labelHash)\\n );\\n emit ReverseClaimed(addr, reverseNode);\\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0);\\n return reverseNode;\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, resolver);\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the calling account. First updates the resolver to the default reverse\\n * resolver if necessary.\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setName(string memory name) public override returns (bytes32) {\\n return\\n setNameForAddr(\\n msg.sender,\\n msg.sender,\\n address(defaultResolver),\\n name\\n );\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the account provided. Updates the resolver to a designated resolver\\n * Only callable by controllers and authorised users\\n * @param addr The reverse record to set\\n * @param owner The owner of the reverse node\\n * @param resolver The resolver of the reverse node\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) public override returns (bytes32) {\\n bytes32 node = claimForAddr(addr, owner, resolver);\\n NameResolver(resolver).setName(node, name);\\n return node;\\n }\\n\\n /**\\n * @dev Returns the node hash for a given account's reverse records.\\n * @param addr The address to hash\\n * @return The ENS node hash.\\n */\\n function node(address addr) public pure override returns (bytes32) {\\n return\\n keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\\n );\\n }\\n\\n /**\\n * @dev An optimised function to compute the sha3 of the lower-case\\n * hexadecimal representation of an Ethereum address.\\n * @param addr The address to hash\\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\\n * input address.\\n */\\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\\n assembly {\\n for {\\n let i := 40\\n } gt(i, 0) {\\n\\n } {\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n }\\n\\n ret := keccak256(0, 40)\\n }\\n }\\n\\n function ownsContract(address addr) internal view returns (bool) {\\n try Ownable(addr).owner() returns (address owner) {\\n return owner == msg.sender;\\n } catch {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd57d28e5791b4b44650a00f5ef6c725af53698ec33faeeaa3591f0dbd939559a\"},\"contracts/root/Controllable.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool enabled);\\n\\n modifier onlyController() {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n\\n function setController(address controller, bool enabled) public onlyOwner {\\n controllers[controller] = enabled;\\n emit ControllerChanged(controller, enabled);\\n }\\n}\\n\",\"keccak256\":\"0xb19b8c0fafe9ca2b4bf8aaafee486fa31437672e1e1977bdf84bfe03464969db\"},\"contracts/utils/ERC20Recoverable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.\\n */\\n\\ncontract ERC20Recoverable is Ownable {\\n /**\\n @notice Recover ERC20 tokens sent to the contract by mistake.\\n @dev The contract is Ownable and only the owner can call the recover function.\\n @param _to The address to send the tokens to.\\n@param _token The address of the ERC20 token to recover\\n @param _amount The amount of tokens to recover.\\n */\\n function recoverFunds(\\n address _token,\\n address _to,\\n uint256 _amount\\n ) external onlyOwner {\\n IERC20(_token).transfer(_to, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x793a38091e1f81499a29ddba82c2b2f3cdd07071b81a832886e8e02a45ff352a\",\"license\":\"MIT\"},\"contracts/wrapper/IMetadataService.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface IMetadataService {\\n function uri(uint256) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xb3f1cf6df01ed7b15e5f2318f6823afbdb586ca38c2124c67955c645647ae9a2\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"./IMetadataService.sol\\\";\\nimport \\\"./INameWrapperUpgrade.sol\\\";\\n\\nuint32 constant CANNOT_UNWRAP = 1;\\nuint32 constant CANNOT_BURN_FUSES = 2;\\nuint32 constant CANNOT_TRANSFER = 4;\\nuint32 constant CANNOT_SET_RESOLVER = 8;\\nuint32 constant CANNOT_SET_TTL = 16;\\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\\nuint32 constant CANNOT_APPROVE = 64;\\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\\nuint32 constant IS_DOT_ETH = 1 << 17;\\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\\n// all fuses apart from IS_DOT_ETH\\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\\n\\ninterface INameWrapper is IERC1155 {\\n event NameWrapped(\\n bytes32 indexed node,\\n bytes name,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n );\\n\\n event NameUnwrapped(bytes32 indexed node, address owner);\\n\\n event FusesSet(bytes32 indexed node, uint32 fuses);\\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\\n\\n function ens() external view returns (ENS);\\n\\n function registrar() external view returns (IBaseRegistrar);\\n\\n function metadataService() external view returns (IMetadataService);\\n\\n function names(bytes32) external view returns (bytes memory);\\n\\n function name() external view returns (string memory);\\n\\n function upgradeContract() external view returns (INameWrapperUpgrade);\\n\\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\\n\\n function wrap(\\n bytes calldata name,\\n address wrappedOwner,\\n address resolver\\n ) external;\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) external returns (uint64 expires);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint16 ownerControlledFuses\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration\\n ) external returns (uint256 expires);\\n\\n function unwrap(bytes32 node, bytes32 label, address owner) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function upgrade(bytes calldata name, bytes calldata extraData) external;\\n\\n function setFuses(\\n bytes32 node,\\n uint16 ownerControlledFuses\\n ) external returns (uint32 newFuses);\\n\\n function setChildFuses(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint32 fuses,\\n uint64 expiry\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n string calldata label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n string calldata label,\\n address newOwner,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function extendExpiry(\\n bytes32 node,\\n bytes32 labelhash,\\n uint64 expiry\\n ) external returns (uint64);\\n\\n function canModifyName(\\n bytes32 node,\\n address addr\\n ) external view returns (bool);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function ownerOf(uint256 id) external view returns (address owner);\\n\\n function approve(address to, uint256 tokenId) external;\\n\\n function getApproved(uint256 tokenId) external view returns (address);\\n\\n function getData(\\n uint256 id\\n ) external view returns (address, uint32, uint64);\\n\\n function setMetadataService(IMetadataService _metadataService) external;\\n\\n function uri(uint256 tokenId) external view returns (string memory);\\n\\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\\n\\n function allFusesBurned(\\n bytes32 node,\\n uint32 fuseMask\\n ) external view returns (bool);\\n\\n function isWrapped(bytes32) external view returns (bool);\\n\\n function isWrapped(bytes32, bytes32) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x70310eb67146d7290731c31841399640ac3b6a949eadc6598bc150123d185c57\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapperUpgrade.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface INameWrapperUpgrade {\\n function wrapFromUpgrade(\\n bytes calldata name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address approved,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x42e0cec6cd9d1a62d51d45b678f69d3e4ad5555e659b197e41257b308346bb8a\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101406040523480156200001257600080fd5b506040516200215038038062002150833981016040819052620000359162000222565b80336200004281620001b9565b6040516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260048201526000906001600160a01b038416906302571be390602401602060405180830381865afa158015620000aa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000d09190620002b6565b604051630f41a04d60e11b81526001600160a01b03848116600483015291925090821690631e83409a906024016020604051808303816000875af11580156200011d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001439190620002dd565b5050505084841162000168576040516307cb550760e31b815260040160405180910390fd5b428411156200018a57604051630b4319e560e21b815260040160405180910390fd5b506001600160a01b0395861660805293851660a05260c09290925260e0528216610100521661012052620002f7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200021f57600080fd5b50565b600080600080600080600060e0888a0312156200023e57600080fd5b87516200024b8162000209565b60208901519097506200025e8162000209565b8096505060408801519450606088015193506080880151620002808162000209565b60a0890151909350620002938162000209565b60c0890151909250620002a68162000209565b8091505092959891949750929550565b600060208284031215620002c957600080fd5b8151620002d68162000209565b9392505050565b600060208284031215620002f057600080fd5b5051919050565b60805160a05160c05160e0516101005161012051611dd16200037f60003960008181610375015281816107e00152610bd501526000818161023801526111e00152600081816103dc01528181610db301526110070152600081816103030152610f9001526000818161041001526109fa015260008181610a2f0152610d220152611dd16000f3fe60806040526004361061015f5760003560e01c80638d839ffe116100c0578063aeb8ce9b11610074578063d3419bf311610059578063d3419bf3146103fe578063f14fcbc814610432578063f2fde38b1461045257600080fd5b8063aeb8ce9b146103aa578063ce1e09c0146103ca57600080fd5b80639791c097116100a55780639791c09714610343578063a8e5fbc014610363578063acf1a8411461039757600080fd5b80638d839ffe146102f15780638da5cb5b1461032557600080fd5b806374694a2b11610117578063839df945116100fc578063839df9451461027257806383e7f6ff1461029f5780638a95b09f146102da57600080fd5b806374694a2b14610213578063808698531461022657600080fd5b80635d3590d5116101485780635d3590d5146101b057806365a69dcf146101d0578063715018a6146101fe57600080fd5b806301ffc9a7146101645780633ccfd60b14610199575b600080fd5b34801561017057600080fd5b5061018461017f366004611421565b610472565b60405190151581526020015b60405180910390f35b3480156101a557600080fd5b506101ae61050b565b005b3480156101bc57600080fd5b506101ae6101cb36600461147f565b610548565b3480156101dc57600080fd5b506101f06101eb3660046115ec565b6105e2565b604051908152602001610190565b34801561020a57600080fd5b506101ae610680565b6101ae6102213660046116ef565b610694565b34801561023257600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610190565b34801561027e57600080fd5b506101f061028d3660046117b9565b60016020526000908152604090205481565b3480156102ab57600080fd5b506102bf6102ba3660046117d2565b6109b0565b60408051825181526020928301519281019290925201610190565b3480156102e657600080fd5b506101f06224ea0081565b3480156102fd57600080fd5b506101f07f000000000000000000000000000000000000000000000000000000000000000081565b34801561033157600080fd5b506000546001600160a01b031661025a565b34801561034f57600080fd5b5061018461035e366004611817565b610b03565b34801561036f57600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b6101ae6103a536600461184c565b610b18565b3480156103b657600080fd5b506101846103c5366004611817565b610cd9565b3480156103d657600080fd5b506101f07f000000000000000000000000000000000000000000000000000000000000000081565b34801561040a57600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043e57600080fd5b506101ae61044d3660046117b9565b610d9c565b34801561045e57600080fd5b506101ae61046d366004611898565b610e2a565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061050557507fffffffff0000000000000000000000000000000000000000000000000000000082167f612e8c0900000000000000000000000000000000000000000000000000000000145b92915050565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610545573d6000803e3d6000fd5b50565b610550610eb7565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156105b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dc91906118b3565b50505050565b885160208a0120600090841580159061060257506001600160a01b038716155b15610639576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808a8a8a8a8a8a8a8a60405160200161065a9998979695949392919061198b565b604051602081830303815290604052805190602001209150509998505050505050505050565b610688610eb7565b6106926000610f11565b565b60006106d78b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92506109b0915050565b602081015181519192506106ea91611a03565b34101561070a5760405163044044a560e21b815260040160405180910390fd5b6107ad8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050896107a88e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d8d8d8d8d8d6105e2565b610f79565b6040517fa40149820000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a40149829061081f908f908f908f908f908e908b90600401611a16565b6020604051808303816000875af115801561083e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108629190611a60565b9050841561088d5761088d878d8d60405161087e929190611a79565b604051809103902088886110fb565b83156108d6576108d68c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92503391506111de9050565b896001600160a01b03168c8c6040516108f0929190611a79565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278e8e8660000151876020015187604051610937959493929190611a89565b60405180910390a3602082015182516109509190611a03565b3411156109a2576020820151825133916108fc9161096e9190611a03565b6109789034611aba565b6040518115909202916000818181858888f193505050501580156109a0573d6000803e3d6000fd5b505b505050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116916350e9a7159187917f00000000000000000000000000000000000000000000000000000000000000009091169063d6e4fa8690602401602060405180830381865afa158015610a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190611a60565b866040518463ffffffff1660e01b8152600401610abb93929190611b1d565b6040805180830381865afa158015610ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afb9190611b42565b949350505050565b60006003610b1083611292565b101592915050565b60008383604051610b2a929190611a79565b604080519182900382206020601f870181900481028401810190925285835292508291600091610b77919088908890819084018382808284376000920191909152508892506109b0915050565b8051909150341015610b9c5760405163044044a560e21b815260040160405180910390fd5b6040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101839052602481018590526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af1158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190611a60565b8251909150341115610c9257815133906108fc90610c689034611aba565b6040518115909202916000818181858888f19350505050158015610c90573d6000803e3d6000fd5b505b837f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae88883485604051610cc89493929190611b91565b60405180910390a250505050505050565b80516020820120600090610cec83610b03565b8015610d9557506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906396e494e890602401602060405180830381865afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9591906118b3565b9392505050565b6000818152600160205260409020544290610dd8907f000000000000000000000000000000000000000000000000000000000000000090611a03565b10610e17576040517f0a059d71000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b6000908152600160205260409020429055565b610e32610eb7565b6001600160a01b038116610eae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610e0e565b61054581610f11565b6000546001600160a01b031633146106925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e0e565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600160205260409020544290610fb5907f000000000000000000000000000000000000000000000000000000000000000090611a03565b1115610ff0576040517f5320bcf900000000000000000000000000000000000000000000000000000000815260048101829052602401610e0e565b600081815260016020526040902054429061102c907f000000000000000000000000000000000000000000000000000000000000000090611a03565b11611066576040517fcb7690d700000000000000000000000000000000000000000000000000000000815260048101829052602401610e0e565b61106f83610cd9565b6110a757826040517f477707e8000000000000000000000000000000000000000000000000000000008152600401610e0e9190611bb8565b6000818152600160205260408120556224ea008210156110f6576040517f9a71997b00000000000000000000000000000000000000000000000000000000815260048101839052602401610e0e565b505050565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb0000000000000000000000000000000000000000000000000000000090925285906001600160a01b0382169063e32954eb9061118e90859088908890606401611bcb565b6000604051808303816000875af11580156111ad573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d59190810190611bee565b50505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637a806d6b338385876040516020016112219190611ced565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161124f9493929190611d2e565b6020604051808303816000875af115801561126e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dc9190611a60565b8051600090819081905b808210156114185760008583815181106112b8576112b8611d6c565b01602001516001600160f81b03191690507f8000000000000000000000000000000000000000000000000000000000000000811015611303576112fc600184611a03565b9250611405565b7fe0000000000000000000000000000000000000000000000000000000000000006001600160f81b031982161015611340576112fc600284611a03565b7ff0000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561137d576112fc600384611a03565b7ff8000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156113ba576112fc600484611a03565b7ffc000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156113f7576112fc600584611a03565b611402600684611a03565b92505b508261141081611d82565b93505061129c565b50909392505050565b60006020828403121561143357600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9557600080fd5b80356001600160a01b038116811461147a57600080fd5b919050565b60008060006060848603121561149457600080fd5b61149d84611463565b92506114ab60208501611463565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114fa576114fa6114bb565b604052919050565b600067ffffffffffffffff82111561151c5761151c6114bb565b50601f01601f191660200190565b600082601f83011261153b57600080fd5b813561154e61154982611502565b6114d1565b81815284602083860101111561156357600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f84011261159257600080fd5b50813567ffffffffffffffff8111156115aa57600080fd5b6020830191508360208260051b85010111156115c557600080fd5b9250929050565b801515811461054557600080fd5b803561ffff8116811461147a57600080fd5b60008060008060008060008060006101008a8c03121561160b57600080fd5b893567ffffffffffffffff8082111561162357600080fd5b61162f8d838e0161152a565b9a5061163d60208d01611463565b995060408c0135985060608c0135975061165960808d01611463565b965060a08c013591508082111561166f57600080fd5b5061167c8c828d01611580565b90955093505060c08a0135611690816115cc565b915061169e60e08b016115da565b90509295985092959850929598565b60008083601f8401126116bf57600080fd5b50813567ffffffffffffffff8111156116d757600080fd5b6020830191508360208285010111156115c557600080fd5b6000806000806000806000806000806101008b8d03121561170f57600080fd5b8a3567ffffffffffffffff8082111561172757600080fd5b6117338e838f016116ad565b909c509a508a915061174760208e01611463565b995060408d0135985060608d0135975061176360808e01611463565b965060a08d013591508082111561177957600080fd5b506117868d828e01611580565b90955093505060c08b013561179a816115cc565b91506117a860e08c016115da565b90509295989b9194979a5092959850565b6000602082840312156117cb57600080fd5b5035919050565b600080604083850312156117e557600080fd5b823567ffffffffffffffff8111156117fc57600080fd5b6118088582860161152a565b95602094909401359450505050565b60006020828403121561182957600080fd5b813567ffffffffffffffff81111561184057600080fd5b610afb8482850161152a565b60008060006040848603121561186157600080fd5b833567ffffffffffffffff81111561187857600080fd5b611884868287016116ad565b909790965060209590950135949350505050565b6000602082840312156118aa57600080fd5b610d9582611463565b6000602082840312156118c557600080fd5b8151610d95816115cc565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b8781101561197e5782840389528135601e1988360301811261193457600080fd5b8701858101903567ffffffffffffffff81111561195057600080fd5b80360382131561195f57600080fd5b61196a8682846118d0565b9a87019a9550505090840190600101611913565b5091979650505050505050565b60006101008b83526001600160a01b03808c1660208501528a60408501528960608501528089166080850152508060a08401526119cb81840187896118f9565b94151560c0840152505061ffff9190911660e090910152979650505050505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610505576105056119ed565b60a081526000611a2a60a08301888a6118d0565b90506001600160a01b03808716602084015285604084015280851660608401525061ffff83166080830152979650505050505050565b600060208284031215611a7257600080fd5b5051919050565b8183823760009101908152919050565b608081526000611a9d6080830187896118d0565b602083019590955250604081019290925260609091015292915050565b81810381811115610505576105056119ed565b60005b83811015611ae8578181015183820152602001611ad0565b50506000910152565b60008151808452611b09816020860160208601611acd565b601f01601f19169290920160200192915050565b606081526000611b306060830186611af1565b60208301949094525060400152919050565b600060408284031215611b5457600080fd5b6040516040810181811067ffffffffffffffff82111715611b7757611b776114bb565b604052825181526020928301519281019290925250919050565b606081526000611ba56060830186886118d0565b6020830194909452506040015292915050565b602081526000610d956020830184611af1565b838152604060208201526000611be56040830184866118f9565b95945050505050565b60006020808385031215611c0157600080fd5b825167ffffffffffffffff80821115611c1957600080fd5b818501915085601f830112611c2d57600080fd5b815181811115611c3f57611c3f6114bb565b8060051b611c4e8582016114d1565b9182528381018501918581019089841115611c6857600080fd5b86860192505b83831015611ce057825185811115611c865760008081fd5b8601603f81018b13611c985760008081fd5b878101516040611caa61154983611502565b8281528d82848601011115611cbf5760008081fd5b611cce838c8301848701611acd565b85525050509186019190860190611c6e565b9998505050505050505050565b60008251611cff818460208701611acd565b7f2e65746800000000000000000000000000000000000000000000000000000000920191825250600401919050565b60006001600160a01b038087168352808616602084015280851660408401525060806060830152611d626080830184611af1565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201611d9457611d946119ed565b506001019056fea26469706673582212207ae2447e86de3ca2bc735ab92d80b5b18a28129026feb199229bbdaf93ed05d564736f6c63430008110033", + "deployedBytecode": "0x60806040526004361061015f5760003560e01c80638d839ffe116100c0578063aeb8ce9b11610074578063d3419bf311610059578063d3419bf3146103fe578063f14fcbc814610432578063f2fde38b1461045257600080fd5b8063aeb8ce9b146103aa578063ce1e09c0146103ca57600080fd5b80639791c097116100a55780639791c09714610343578063a8e5fbc014610363578063acf1a8411461039757600080fd5b80638d839ffe146102f15780638da5cb5b1461032557600080fd5b806374694a2b11610117578063839df945116100fc578063839df9451461027257806383e7f6ff1461029f5780638a95b09f146102da57600080fd5b806374694a2b14610213578063808698531461022657600080fd5b80635d3590d5116101485780635d3590d5146101b057806365a69dcf146101d0578063715018a6146101fe57600080fd5b806301ffc9a7146101645780633ccfd60b14610199575b600080fd5b34801561017057600080fd5b5061018461017f366004611421565b610472565b60405190151581526020015b60405180910390f35b3480156101a557600080fd5b506101ae61050b565b005b3480156101bc57600080fd5b506101ae6101cb36600461147f565b610548565b3480156101dc57600080fd5b506101f06101eb3660046115ec565b6105e2565b604051908152602001610190565b34801561020a57600080fd5b506101ae610680565b6101ae6102213660046116ef565b610694565b34801561023257600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610190565b34801561027e57600080fd5b506101f061028d3660046117b9565b60016020526000908152604090205481565b3480156102ab57600080fd5b506102bf6102ba3660046117d2565b6109b0565b60408051825181526020928301519281019290925201610190565b3480156102e657600080fd5b506101f06224ea0081565b3480156102fd57600080fd5b506101f07f000000000000000000000000000000000000000000000000000000000000000081565b34801561033157600080fd5b506000546001600160a01b031661025a565b34801561034f57600080fd5b5061018461035e366004611817565b610b03565b34801561036f57600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b6101ae6103a536600461184c565b610b18565b3480156103b657600080fd5b506101846103c5366004611817565b610cd9565b3480156103d657600080fd5b506101f07f000000000000000000000000000000000000000000000000000000000000000081565b34801561040a57600080fd5b5061025a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043e57600080fd5b506101ae61044d3660046117b9565b610d9c565b34801561045e57600080fd5b506101ae61046d366004611898565b610e2a565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061050557507fffffffff0000000000000000000000000000000000000000000000000000000082167f612e8c0900000000000000000000000000000000000000000000000000000000145b92915050565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610545573d6000803e3d6000fd5b50565b610550610eb7565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156105b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dc91906118b3565b50505050565b885160208a0120600090841580159061060257506001600160a01b038716155b15610639576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808a8a8a8a8a8a8a8a60405160200161065a9998979695949392919061198b565b604051602081830303815290604052805190602001209150509998505050505050505050565b610688610eb7565b6106926000610f11565b565b60006106d78b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92506109b0915050565b602081015181519192506106ea91611a03565b34101561070a5760405163044044a560e21b815260040160405180910390fd5b6107ad8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050896107a88e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d8d8d8d8d8d6105e2565b610f79565b6040517fa40149820000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a40149829061081f908f908f908f908f908e908b90600401611a16565b6020604051808303816000875af115801561083e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108629190611a60565b9050841561088d5761088d878d8d60405161087e929190611a79565b604051809103902088886110fb565b83156108d6576108d68c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92503391506111de9050565b896001600160a01b03168c8c6040516108f0929190611a79565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278e8e8660000151876020015187604051610937959493929190611a89565b60405180910390a3602082015182516109509190611a03565b3411156109a2576020820151825133916108fc9161096e9190611a03565b6109789034611aba565b6040518115909202916000818181858888f193505050501580156109a0573d6000803e3d6000fd5b505b505050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116916350e9a7159187917f00000000000000000000000000000000000000000000000000000000000000009091169063d6e4fa8690602401602060405180830381865afa158015610a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190611a60565b866040518463ffffffff1660e01b8152600401610abb93929190611b1d565b6040805180830381865afa158015610ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afb9190611b42565b949350505050565b60006003610b1083611292565b101592915050565b60008383604051610b2a929190611a79565b604080519182900382206020601f870181900481028401810190925285835292508291600091610b77919088908890819084018382808284376000920191909152508892506109b0915050565b8051909150341015610b9c5760405163044044a560e21b815260040160405180910390fd5b6040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101839052602481018590526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af1158015610c26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4a9190611a60565b8251909150341115610c9257815133906108fc90610c689034611aba565b6040518115909202916000818181858888f19350505050158015610c90573d6000803e3d6000fd5b505b837f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae88883485604051610cc89493929190611b91565b60405180910390a250505050505050565b80516020820120600090610cec83610b03565b8015610d9557506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906396e494e890602401602060405180830381865afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9591906118b3565b9392505050565b6000818152600160205260409020544290610dd8907f000000000000000000000000000000000000000000000000000000000000000090611a03565b10610e17576040517f0a059d71000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b6000908152600160205260409020429055565b610e32610eb7565b6001600160a01b038116610eae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610e0e565b61054581610f11565b6000546001600160a01b031633146106925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e0e565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600160205260409020544290610fb5907f000000000000000000000000000000000000000000000000000000000000000090611a03565b1115610ff0576040517f5320bcf900000000000000000000000000000000000000000000000000000000815260048101829052602401610e0e565b600081815260016020526040902054429061102c907f000000000000000000000000000000000000000000000000000000000000000090611a03565b11611066576040517fcb7690d700000000000000000000000000000000000000000000000000000000815260048101829052602401610e0e565b61106f83610cd9565b6110a757826040517f477707e8000000000000000000000000000000000000000000000000000000008152600401610e0e9190611bb8565b6000818152600160205260408120556224ea008210156110f6576040517f9a71997b00000000000000000000000000000000000000000000000000000000815260048101839052602401610e0e565b505050565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb0000000000000000000000000000000000000000000000000000000090925285906001600160a01b0382169063e32954eb9061118e90859088908890606401611bcb565b6000604051808303816000875af11580156111ad573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d59190810190611bee565b50505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637a806d6b338385876040516020016112219190611ced565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161124f9493929190611d2e565b6020604051808303816000875af115801561126e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dc9190611a60565b8051600090819081905b808210156114185760008583815181106112b8576112b8611d6c565b01602001516001600160f81b03191690507f8000000000000000000000000000000000000000000000000000000000000000811015611303576112fc600184611a03565b9250611405565b7fe0000000000000000000000000000000000000000000000000000000000000006001600160f81b031982161015611340576112fc600284611a03565b7ff0000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561137d576112fc600384611a03565b7ff8000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156113ba576112fc600484611a03565b7ffc000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156113f7576112fc600584611a03565b611402600684611a03565b92505b508261141081611d82565b93505061129c565b50909392505050565b60006020828403121561143357600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d9557600080fd5b80356001600160a01b038116811461147a57600080fd5b919050565b60008060006060848603121561149457600080fd5b61149d84611463565b92506114ab60208501611463565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114fa576114fa6114bb565b604052919050565b600067ffffffffffffffff82111561151c5761151c6114bb565b50601f01601f191660200190565b600082601f83011261153b57600080fd5b813561154e61154982611502565b6114d1565b81815284602083860101111561156357600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f84011261159257600080fd5b50813567ffffffffffffffff8111156115aa57600080fd5b6020830191508360208260051b85010111156115c557600080fd5b9250929050565b801515811461054557600080fd5b803561ffff8116811461147a57600080fd5b60008060008060008060008060006101008a8c03121561160b57600080fd5b893567ffffffffffffffff8082111561162357600080fd5b61162f8d838e0161152a565b9a5061163d60208d01611463565b995060408c0135985060608c0135975061165960808d01611463565b965060a08c013591508082111561166f57600080fd5b5061167c8c828d01611580565b90955093505060c08a0135611690816115cc565b915061169e60e08b016115da565b90509295985092959850929598565b60008083601f8401126116bf57600080fd5b50813567ffffffffffffffff8111156116d757600080fd5b6020830191508360208285010111156115c557600080fd5b6000806000806000806000806000806101008b8d03121561170f57600080fd5b8a3567ffffffffffffffff8082111561172757600080fd5b6117338e838f016116ad565b909c509a508a915061174760208e01611463565b995060408d0135985060608d0135975061176360808e01611463565b965060a08d013591508082111561177957600080fd5b506117868d828e01611580565b90955093505060c08b013561179a816115cc565b91506117a860e08c016115da565b90509295989b9194979a5092959850565b6000602082840312156117cb57600080fd5b5035919050565b600080604083850312156117e557600080fd5b823567ffffffffffffffff8111156117fc57600080fd5b6118088582860161152a565b95602094909401359450505050565b60006020828403121561182957600080fd5b813567ffffffffffffffff81111561184057600080fd5b610afb8482850161152a565b60008060006040848603121561186157600080fd5b833567ffffffffffffffff81111561187857600080fd5b611884868287016116ad565b909790965060209590950135949350505050565b6000602082840312156118aa57600080fd5b610d9582611463565b6000602082840312156118c557600080fd5b8151610d95816115cc565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006020808501808196508560051b810191508460005b8781101561197e5782840389528135601e1988360301811261193457600080fd5b8701858101903567ffffffffffffffff81111561195057600080fd5b80360382131561195f57600080fd5b61196a8682846118d0565b9a87019a9550505090840190600101611913565b5091979650505050505050565b60006101008b83526001600160a01b03808c1660208501528a60408501528960608501528089166080850152508060a08401526119cb81840187896118f9565b94151560c0840152505061ffff9190911660e090910152979650505050505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610505576105056119ed565b60a081526000611a2a60a08301888a6118d0565b90506001600160a01b03808716602084015285604084015280851660608401525061ffff83166080830152979650505050505050565b600060208284031215611a7257600080fd5b5051919050565b8183823760009101908152919050565b608081526000611a9d6080830187896118d0565b602083019590955250604081019290925260609091015292915050565b81810381811115610505576105056119ed565b60005b83811015611ae8578181015183820152602001611ad0565b50506000910152565b60008151808452611b09816020860160208601611acd565b601f01601f19169290920160200192915050565b606081526000611b306060830186611af1565b60208301949094525060400152919050565b600060408284031215611b5457600080fd5b6040516040810181811067ffffffffffffffff82111715611b7757611b776114bb565b604052825181526020928301519281019290925250919050565b606081526000611ba56060830186886118d0565b6020830194909452506040015292915050565b602081526000610d956020830184611af1565b838152604060208201526000611be56040830184866118f9565b95945050505050565b60006020808385031215611c0157600080fd5b825167ffffffffffffffff80821115611c1957600080fd5b818501915085601f830112611c2d57600080fd5b815181811115611c3f57611c3f6114bb565b8060051b611c4e8582016114d1565b9182528381018501918581019089841115611c6857600080fd5b86860192505b83831015611ce057825185811115611c865760008081fd5b8601603f81018b13611c985760008081fd5b878101516040611caa61154983611502565b8281528d82848601011115611cbf5760008081fd5b611cce838c8301848701611acd565b85525050509186019190860190611c6e565b9998505050505050505050565b60008251611cff818460208701611acd565b7f2e65746800000000000000000000000000000000000000000000000000000000920191825250600401919050565b60006001600160a01b038087168352808616602084015280851660408401525060806060830152611d626080830184611af1565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201611d9457611d946119ed565b506001019056fea26469706673582212207ae2447e86de3ca2bc735ab92d80b5b18a28129026feb199229bbdaf93ed05d564736f6c63430008110033", + "devdoc": { + "details": "A registrar controller for registering and renewing names at fixed cost.", + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "recoverFunds(address,address,uint256)": { + "details": "The contract is Ownable and only the owner can call the recover function.", + "params": { + "_amount": "The amount of tokens to recover.", + "_to": "The address to send the tokens to.", + "_token": "The address of the ERC20 token to recover" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "recoverFunds(address,address,uint256)": { + "notice": "Recover ERC20 tokens sent to the contract by mistake." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/ethregistrar/ETHRegistrarController.sol:ETHRegistrarController", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 11608, + "contract": "contracts/ethregistrar/ETHRegistrarController.sol:ETHRegistrarController", + "label": "commitments", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/ExponentialPremiumPriceOracle.json b/deployments/sepolia/ExponentialPremiumPriceOracle.json new file mode 100644 index 00000000..b80c7ee5 --- /dev/null +++ b/deployments/sepolia/ExponentialPremiumPriceOracle.json @@ -0,0 +1,303 @@ +{ + "address": "0x6810dbce73c67506f785a225f818b30d8f209aab", + "abi": [ + { + "inputs": [ + { + "internalType": "contract AggregatorInterface", + "name": "_usdOracle", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_rentPrices", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_startPremium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalDays", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "prices", + "type": "uint256[]" + } + ], + "name": "RentPriceChanged", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startPremium", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "elapsed", + "type": "uint256" + } + ], + "name": "decayedPremium", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "expires", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "premium", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "expires", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "price", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "base", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "premium", + "type": "uint256" + } + ], + "internalType": "struct IPriceOracle.Price", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price1Letter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price2Letter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price3Letter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price4Letter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price5Letter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "usdOracle", + "outputs": [ + { + "internalType": "contract AggregatorInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x623bf8e77831e366f128c93fd7c508a128c64da99bb76f496139c09e6eb8210f", + "receipt": { + "to": null, + "from": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "contractAddress": "0x6810dbce73c67506f785a225f818b30d8f209aab", + "transactionIndex": "0x66", + "gasUsed": "0xc6f1e", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x760ebf479b57149e76a8a17ea5edefd07cf57a6635ffec6730e0846fbb047138", + "transactionHash": "0x99ed028d68f268c7b1340446f1c1d83669af4588ce81c0c8fd52f1f0d59318bc", + "logs": [], + "blockNumber": "0x39d572", + "cumulativeGasUsed": "0x978204", + "status": "0x1" + }, + "args": [ + "0x10E7e7D64d7dA687f7DcF8443Df58A0415329b15", + [ + 0, + 0, + "20294266869609", + "5073566717402", + "158548959919" + ], + "100000000000000000000000000", + 21 + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract AggregatorInterface\",\"name\":\"_usdOracle\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_rentPrices\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_startPremium\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalDays\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"prices\",\"type\":\"uint256[]\"}],\"name\":\"RentPriceChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"startPremium\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"elapsed\",\"type\":\"uint256\"}],\"name\":\"decayedPremium\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"premium\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"price\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"base\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"premium\",\"type\":\"uint256\"}],\"internalType\":\"struct IPriceOracle.Price\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price1Letter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price2Letter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price3Letter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price4Letter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"price5Letter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usdOracle\",\"outputs\":[{\"internalType\":\"contract AggregatorInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"decayedPremium(uint256,uint256)\":{\"details\":\"Returns the premium price at current time elapsed\",\"params\":{\"elapsed\":\"time past since expiry\",\"startPremium\":\"starting price\"}},\"premium(string,uint256,uint256)\":{\"details\":\"Returns the pricing premium in wei.\"},\"price(string,uint256,uint256)\":{\"details\":\"Returns the price to register or renew a name.\",\"params\":{\"duration\":\"How long the name is being registered or extended for, in seconds.\",\"expires\":\"When the name presently expires (0 if this is a new registration).\",\"name\":\"The name being registered or renewed.\"},\"returns\":{\"_0\":\"base premium tuple of base price + premium price\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ethregistrar/ExponentialPremiumPriceOracle.sol\":\"ExponentialPremiumPriceOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/ethregistrar/ExponentialPremiumPriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./StablePriceOracle.sol\\\";\\n\\ncontract ExponentialPremiumPriceOracle is StablePriceOracle {\\n uint256 constant GRACE_PERIOD = 90 days;\\n uint256 immutable startPremium;\\n uint256 immutable endValue;\\n\\n constructor(\\n AggregatorInterface _usdOracle,\\n uint256[] memory _rentPrices,\\n uint256 _startPremium,\\n uint256 totalDays\\n ) StablePriceOracle(_usdOracle, _rentPrices) {\\n startPremium = _startPremium;\\n endValue = _startPremium >> totalDays;\\n }\\n\\n uint256 constant PRECISION = 1e18;\\n uint256 constant bit1 = 999989423469314432; // 0.5 ^ 1/65536 * (10 ** 18)\\n uint256 constant bit2 = 999978847050491904; // 0.5 ^ 2/65536 * (10 ** 18)\\n uint256 constant bit3 = 999957694548431104;\\n uint256 constant bit4 = 999915390886613504;\\n uint256 constant bit5 = 999830788931929088;\\n uint256 constant bit6 = 999661606496243712;\\n uint256 constant bit7 = 999323327502650752;\\n uint256 constant bit8 = 998647112890970240;\\n uint256 constant bit9 = 997296056085470080;\\n uint256 constant bit10 = 994599423483633152;\\n uint256 constant bit11 = 989228013193975424;\\n uint256 constant bit12 = 978572062087700096;\\n uint256 constant bit13 = 957603280698573696;\\n uint256 constant bit14 = 917004043204671232;\\n uint256 constant bit15 = 840896415253714560;\\n uint256 constant bit16 = 707106781186547584;\\n\\n /**\\n * @dev Returns the pricing premium in internal base units.\\n */\\n function _premium(\\n string memory,\\n uint256 expires,\\n uint256\\n ) internal view override returns (uint256) {\\n expires = expires + GRACE_PERIOD;\\n if (expires > block.timestamp) {\\n return 0;\\n }\\n\\n uint256 elapsed = block.timestamp - expires;\\n uint256 premium = decayedPremium(startPremium, elapsed);\\n if (premium >= endValue) {\\n return premium - endValue;\\n }\\n return 0;\\n }\\n\\n /**\\n * @dev Returns the premium price at current time elapsed\\n * @param startPremium starting price\\n * @param elapsed time past since expiry\\n */\\n function decayedPremium(\\n uint256 startPremium,\\n uint256 elapsed\\n ) public pure returns (uint256) {\\n uint256 daysPast = (elapsed * PRECISION) / 1 days;\\n uint256 intDays = daysPast / PRECISION;\\n uint256 premium = startPremium >> intDays;\\n uint256 partDay = (daysPast - intDays * PRECISION);\\n uint256 fraction = (partDay * (2 ** 16)) / PRECISION;\\n uint256 totalPremium = addFractionalPremium(fraction, premium);\\n return totalPremium;\\n }\\n\\n function addFractionalPremium(\\n uint256 fraction,\\n uint256 premium\\n ) internal pure returns (uint256) {\\n if (fraction & (1 << 0) != 0) {\\n premium = (premium * bit1) / PRECISION;\\n }\\n if (fraction & (1 << 1) != 0) {\\n premium = (premium * bit2) / PRECISION;\\n }\\n if (fraction & (1 << 2) != 0) {\\n premium = (premium * bit3) / PRECISION;\\n }\\n if (fraction & (1 << 3) != 0) {\\n premium = (premium * bit4) / PRECISION;\\n }\\n if (fraction & (1 << 4) != 0) {\\n premium = (premium * bit5) / PRECISION;\\n }\\n if (fraction & (1 << 5) != 0) {\\n premium = (premium * bit6) / PRECISION;\\n }\\n if (fraction & (1 << 6) != 0) {\\n premium = (premium * bit7) / PRECISION;\\n }\\n if (fraction & (1 << 7) != 0) {\\n premium = (premium * bit8) / PRECISION;\\n }\\n if (fraction & (1 << 8) != 0) {\\n premium = (premium * bit9) / PRECISION;\\n }\\n if (fraction & (1 << 9) != 0) {\\n premium = (premium * bit10) / PRECISION;\\n }\\n if (fraction & (1 << 10) != 0) {\\n premium = (premium * bit11) / PRECISION;\\n }\\n if (fraction & (1 << 11) != 0) {\\n premium = (premium * bit12) / PRECISION;\\n }\\n if (fraction & (1 << 12) != 0) {\\n premium = (premium * bit13) / PRECISION;\\n }\\n if (fraction & (1 << 13) != 0) {\\n premium = (premium * bit14) / PRECISION;\\n }\\n if (fraction & (1 << 14) != 0) {\\n premium = (premium * bit15) / PRECISION;\\n }\\n if (fraction & (1 << 15) != 0) {\\n premium = (premium * bit16) / PRECISION;\\n }\\n return premium;\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x09149a39e7660d65873e5160971cf0904630b266cbec4f02721dad0aad28320b\",\"license\":\"MIT\"},\"contracts/ethregistrar/IPriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\ninterface IPriceOracle {\\n struct Price {\\n uint256 base;\\n uint256 premium;\\n }\\n\\n /**\\n * @dev Returns the price to register or renew a name.\\n * @param name The name being registered or renewed.\\n * @param expires When the name presently expires (0 if this is a new registration).\\n * @param duration How long the name is being registered or extended for, in seconds.\\n * @return base premium tuple of base price + premium price\\n */\\n function price(\\n string calldata name,\\n uint256 expires,\\n uint256 duration\\n ) external view returns (Price calldata);\\n}\\n\",\"keccak256\":\"0x1ec537b4c7f9cc40363b39dcc7ade8c29bf94662e6b01d38e681487637bd577e\",\"license\":\"MIT\"},\"contracts/ethregistrar/StablePriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./IPriceOracle.sol\\\";\\nimport \\\"./StringUtils.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\ninterface AggregatorInterface {\\n function latestAnswer() external view returns (int256);\\n}\\n\\n// StablePriceOracle sets a price in USD, based on an oracle.\\ncontract StablePriceOracle is IPriceOracle {\\n using StringUtils for *;\\n\\n // Rent in base price units by length\\n uint256 public immutable price1Letter;\\n uint256 public immutable price2Letter;\\n uint256 public immutable price3Letter;\\n uint256 public immutable price4Letter;\\n uint256 public immutable price5Letter;\\n\\n // Oracle address\\n AggregatorInterface public immutable usdOracle;\\n\\n event RentPriceChanged(uint256[] prices);\\n\\n constructor(AggregatorInterface _usdOracle, uint256[] memory _rentPrices) {\\n usdOracle = _usdOracle;\\n price1Letter = _rentPrices[0];\\n price2Letter = _rentPrices[1];\\n price3Letter = _rentPrices[2];\\n price4Letter = _rentPrices[3];\\n price5Letter = _rentPrices[4];\\n }\\n\\n function price(\\n string calldata name,\\n uint256 expires,\\n uint256 duration\\n ) external view override returns (IPriceOracle.Price memory) {\\n uint256 len = name.strlen();\\n uint256 basePrice;\\n\\n if (len >= 5) {\\n basePrice = price5Letter * duration;\\n } else if (len == 4) {\\n basePrice = price4Letter * duration;\\n } else if (len == 3) {\\n basePrice = price3Letter * duration;\\n } else if (len == 2) {\\n basePrice = price2Letter * duration;\\n } else {\\n basePrice = price1Letter * duration;\\n }\\n\\n return\\n IPriceOracle.Price({\\n base: attoUSDToWei(basePrice),\\n premium: attoUSDToWei(_premium(name, expires, duration))\\n });\\n }\\n\\n /**\\n * @dev Returns the pricing premium in wei.\\n */\\n function premium(\\n string calldata name,\\n uint256 expires,\\n uint256 duration\\n ) external view returns (uint256) {\\n return attoUSDToWei(_premium(name, expires, duration));\\n }\\n\\n /**\\n * @dev Returns the pricing premium in internal base units.\\n */\\n function _premium(\\n string memory name,\\n uint256 expires,\\n uint256 duration\\n ) internal view virtual returns (uint256) {\\n return 0;\\n }\\n\\n function attoUSDToWei(uint256 amount) internal view returns (uint256) {\\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\\n return (amount * 1e8) / ethPrice;\\n }\\n\\n function weiToAttoUSD(uint256 amount) internal view returns (uint256) {\\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\\n return (amount * ethPrice) / 1e8;\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual returns (bool) {\\n return\\n interfaceID == type(IERC165).interfaceId ||\\n interfaceID == type(IPriceOracle).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x23a3d1eb3021080f20eb5f6af941b2d29a5d252a0a6119ba74f595da9c1ae1d6\",\"license\":\"MIT\"},\"contracts/ethregistrar/StringUtils.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nlibrary StringUtils {\\n /**\\n * @dev Returns the length of a given string\\n *\\n * @param s The string to measure the length of\\n * @return The length of the input string\\n */\\n function strlen(string memory s) internal pure returns (uint256) {\\n uint256 len;\\n uint256 i = 0;\\n uint256 bytelength = bytes(s).length;\\n for (len = 0; i < bytelength; len++) {\\n bytes1 b = bytes(s)[i];\\n if (b < 0x80) {\\n i += 1;\\n } else if (b < 0xE0) {\\n i += 2;\\n } else if (b < 0xF0) {\\n i += 3;\\n } else if (b < 0xF8) {\\n i += 4;\\n } else if (b < 0xFC) {\\n i += 5;\\n } else {\\n i += 6;\\n }\\n }\\n return len;\\n }\\n}\\n\",\"keccak256\":\"0x4cc8363a850dc9130c433ee50e7c97e29a45ae5d9bd0808205ac7134b34f24e4\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620010863803806200108683398101604081905262000035916200012c565b6001600160a01b0384166101205282518490849081906000906200005d576200005d62000227565b6020026020010151608081815250508060018151811062000082576200008262000227565b602002602001015160a0818152505080600281518110620000a757620000a762000227565b602002602001015160c0818152505080600381518110620000cc57620000cc62000227565b602002602001015160e0818152505080600481518110620000f157620000f162000227565b60209081029190910101516101005250506101408290521c61016052506200023d9050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156200014357600080fd5b84516001600160a01b03811681146200015b57600080fd5b602086810151919550906001600160401b03808211156200017b57600080fd5b818801915088601f8301126200019057600080fd5b815181811115620001a557620001a562000116565b8060051b604051601f19603f83011681018181108582111715620001cd57620001cd62000116565b60405291825284820192508381018501918b831115620001ec57600080fd5b938501935b828510156200020c57845184529385019392850192620001f1565b60408b01516060909b0151999c909b50975050505050505050565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610db3620002d3600039600081816108590152610883015260006108300152600081816101c7015261074b01526000818161015301526102d401526000818161023a015261030d01526000818161018d015261033f015260008181610213015261037101526000818160f0015261039b0152610db36000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a200e15311610076578063c8a4271f1161005b578063c8a4271f146101c2578063cd5d2c741461020e578063d820ed421461023557600080fd5b8063a200e15314610188578063a34e3596146101af57600080fd5b806350e9a715116100a757806350e9a7151461012057806359b6b86c1461014e57806359e1777c1461017557600080fd5b806301ffc9a7146100c35780632c0fd74c146100eb575b600080fd5b6100d66100d1366004610bdd565b61025c565b60405190151581526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100e2565b61013361012e366004610c1f565b61026d565b604080518251815260209283015192810192909252016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b610112610183366004610c9e565b610433565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101126101bd366004610c1f565b6104ce565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60006102678261051f565b92915050565b604080518082019091526000808252602082015260006102c286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105b792505050565b90506000600582106102ff576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b90506103c2565b81600403610331576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b81600303610363576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b81600203610395576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b6103bf847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b90505b60405180604001604052806103d683610746565b81526020016104266104218a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92508b91506107fa9050565b610746565b9052979650505050505050565b6000806201518061044c670de0b6b3a764000085610cd6565b6104569190610ced565b9050600061046c670de0b6b3a764000083610ced565b905084811c6000610485670de0b6b3a764000084610cd6565b61048f9085610d0f565b90506000670de0b6b3a76400006104a98362010000610cd6565b6104b39190610ced565b905060006104c182856108bd565b9998505050505050505050565b600061051661042186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506107fa9050565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061026757507fffffffff0000000000000000000000000000000000000000000000000000000082167f50e9a715000000000000000000000000000000000000000000000000000000001492915050565b8051600090819081905b8082101561073d5760008583815181106105dd576105dd610d22565b01602001516001600160f81b03191690507f800000000000000000000000000000000000000000000000000000000000000081101561062857610621600184610d38565b925061072a565b7fe0000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561066557610621600284610d38565b7ff0000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156106a257610621600384610d38565b7ff8000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156106df57610621600484610d38565b7ffc000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561071c57610621600584610d38565b610727600684610d38565b92505b508261073581610d4b565b9350506105c1565b50909392505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190610d64565b9050806107e9846305f5e100610cd6565b6107f39190610ced565b9392505050565b60006108096276a70084610d38565b92504283111561081b575060006107f3565b60006108278442610d0f565b905060006108557f000000000000000000000000000000000000000000000000000000000000000083610433565b90507f000000000000000000000000000000000000000000000000000000000000000081106108b1576108a87f000000000000000000000000000000000000000000000000000000000000000082610d0f565b925050506107f3565b50600095945050505050565b600060018316156108f057670de0b6b3a76400006108e3670de0ad151d09418084610cd6565b6108ed9190610ced565b91505b600283161561092157670de0b6b3a7640000610914670de0a3769959680084610cd6565b61091e9190610ced565b91505b600483161561095257670de0b6b3a7640000610945670de09039a5fa510084610cd6565b61094f9190610ced565b91505b600883161561098357670de0b6b3a7640000610976670de069c00f3e120084610cd6565b6109809190610ced565b91505b60108316156109b457670de0b6b3a76400006109a7670de01cce21c9440084610cd6565b6109b19190610ced565b91505b60208316156109e557670de0b6b3a76400006109d8670ddf82ef46ce100084610cd6565b6109e29190610ced565b91505b6040831615610a1657670de0b6b3a7640000610a09670dde4f458f8e8d8084610cd6565b610a139190610ced565b91505b6080831615610a4757670de0b6b3a7640000610a3a670ddbe84213d5f08084610cd6565b610a449190610ced565b91505b610100831615610a7957670de0b6b3a7640000610a6c670dd71b7aa6df5b8084610cd6565b610a769190610ced565b91505b610200831615610aab57670de0b6b3a7640000610a9e670dcd86e7f28cde0084610cd6565b610aa89190610ced565b91505b610400831615610add57670de0b6b3a7640000610ad0670dba71a3084ad68084610cd6565b610ada9190610ced565b91505b610800831615610b0f57670de0b6b3a7640000610b02670d94961b13dbde8084610cd6565b610b0c9190610ced565b91505b611000831615610b4157670de0b6b3a7640000610b34670d4a171c35c9838084610cd6565b610b3e9190610ced565b91505b612000831615610b7357670de0b6b3a7640000610b66670cb9da519ccfb70084610cd6565b610b709190610ced565b91505b614000831615610ba557670de0b6b3a7640000610b98670bab76d59c18d68084610cd6565b610ba29190610ced565b91505b618000831615610bd757670de0b6b3a7640000610bca6709d025defee4df8084610cd6565b610bd49190610ced565b91505b50919050565b600060208284031215610bef57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146107f357600080fd5b60008060008060608587031215610c3557600080fd5b843567ffffffffffffffff80821115610c4d57600080fd5b818701915087601f830112610c6157600080fd5b813581811115610c7057600080fd5b886020828501011115610c8257600080fd5b6020928301999098509187013596604001359550909350505050565b60008060408385031215610cb157600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761026757610267610cc0565b600082610d0a57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561026757610267610cc0565b634e487b7160e01b600052603260045260246000fd5b8082018082111561026757610267610cc0565b600060018201610d5d57610d5d610cc0565b5060010190565b600060208284031215610d7657600080fd5b505191905056fea264697066735822122095ea709e43eb75c836bb5d49037267e7991bd32558f18152c7cebb8e85e3f2f064736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a200e15311610076578063c8a4271f1161005b578063c8a4271f146101c2578063cd5d2c741461020e578063d820ed421461023557600080fd5b8063a200e15314610188578063a34e3596146101af57600080fd5b806350e9a715116100a757806350e9a7151461012057806359b6b86c1461014e57806359e1777c1461017557600080fd5b806301ffc9a7146100c35780632c0fd74c146100eb575b600080fd5b6100d66100d1366004610bdd565b61025c565b60405190151581526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100e2565b61013361012e366004610c1f565b61026d565b604080518251815260209283015192810192909252016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b610112610183366004610c9e565b610433565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101126101bd366004610c1f565b6104ce565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60006102678261051f565b92915050565b604080518082019091526000808252602082015260006102c286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105b792505050565b90506000600582106102ff576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b90506103c2565b81600403610331576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b81600303610363576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b81600203610395576102f8847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b6103bf847f0000000000000000000000000000000000000000000000000000000000000000610cd6565b90505b60405180604001604052806103d683610746565b81526020016104266104218a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92508b91506107fa9050565b610746565b9052979650505050505050565b6000806201518061044c670de0b6b3a764000085610cd6565b6104569190610ced565b9050600061046c670de0b6b3a764000083610ced565b905084811c6000610485670de0b6b3a764000084610cd6565b61048f9085610d0f565b90506000670de0b6b3a76400006104a98362010000610cd6565b6104b39190610ced565b905060006104c182856108bd565b9998505050505050505050565b600061051661042186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506107fa9050565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061026757507fffffffff0000000000000000000000000000000000000000000000000000000082167f50e9a715000000000000000000000000000000000000000000000000000000001492915050565b8051600090819081905b8082101561073d5760008583815181106105dd576105dd610d22565b01602001516001600160f81b03191690507f800000000000000000000000000000000000000000000000000000000000000081101561062857610621600184610d38565b925061072a565b7fe0000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561066557610621600284610d38565b7ff0000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156106a257610621600384610d38565b7ff8000000000000000000000000000000000000000000000000000000000000006001600160f81b0319821610156106df57610621600484610d38565b7ffc000000000000000000000000000000000000000000000000000000000000006001600160f81b03198216101561071c57610621600584610d38565b610727600684610d38565b92505b508261073581610d4b565b9350506105c1565b50909392505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190610d64565b9050806107e9846305f5e100610cd6565b6107f39190610ced565b9392505050565b60006108096276a70084610d38565b92504283111561081b575060006107f3565b60006108278442610d0f565b905060006108557f000000000000000000000000000000000000000000000000000000000000000083610433565b90507f000000000000000000000000000000000000000000000000000000000000000081106108b1576108a87f000000000000000000000000000000000000000000000000000000000000000082610d0f565b925050506107f3565b50600095945050505050565b600060018316156108f057670de0b6b3a76400006108e3670de0ad151d09418084610cd6565b6108ed9190610ced565b91505b600283161561092157670de0b6b3a7640000610914670de0a3769959680084610cd6565b61091e9190610ced565b91505b600483161561095257670de0b6b3a7640000610945670de09039a5fa510084610cd6565b61094f9190610ced565b91505b600883161561098357670de0b6b3a7640000610976670de069c00f3e120084610cd6565b6109809190610ced565b91505b60108316156109b457670de0b6b3a76400006109a7670de01cce21c9440084610cd6565b6109b19190610ced565b91505b60208316156109e557670de0b6b3a76400006109d8670ddf82ef46ce100084610cd6565b6109e29190610ced565b91505b6040831615610a1657670de0b6b3a7640000610a09670dde4f458f8e8d8084610cd6565b610a139190610ced565b91505b6080831615610a4757670de0b6b3a7640000610a3a670ddbe84213d5f08084610cd6565b610a449190610ced565b91505b610100831615610a7957670de0b6b3a7640000610a6c670dd71b7aa6df5b8084610cd6565b610a769190610ced565b91505b610200831615610aab57670de0b6b3a7640000610a9e670dcd86e7f28cde0084610cd6565b610aa89190610ced565b91505b610400831615610add57670de0b6b3a7640000610ad0670dba71a3084ad68084610cd6565b610ada9190610ced565b91505b610800831615610b0f57670de0b6b3a7640000610b02670d94961b13dbde8084610cd6565b610b0c9190610ced565b91505b611000831615610b4157670de0b6b3a7640000610b34670d4a171c35c9838084610cd6565b610b3e9190610ced565b91505b612000831615610b7357670de0b6b3a7640000610b66670cb9da519ccfb70084610cd6565b610b709190610ced565b91505b614000831615610ba557670de0b6b3a7640000610b98670bab76d59c18d68084610cd6565b610ba29190610ced565b91505b618000831615610bd757670de0b6b3a7640000610bca6709d025defee4df8084610cd6565b610bd49190610ced565b91505b50919050565b600060208284031215610bef57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146107f357600080fd5b60008060008060608587031215610c3557600080fd5b843567ffffffffffffffff80821115610c4d57600080fd5b818701915087601f830112610c6157600080fd5b813581811115610c7057600080fd5b886020828501011115610c8257600080fd5b6020928301999098509187013596604001359550909350505050565b60008060408385031215610cb157600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761026757610267610cc0565b600082610d0a57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561026757610267610cc0565b634e487b7160e01b600052603260045260246000fd5b8082018082111561026757610267610cc0565b600060018201610d5d57610d5d610cc0565b5060010190565b600060208284031215610d7657600080fd5b505191905056fea264697066735822122095ea709e43eb75c836bb5d49037267e7991bd32558f18152c7cebb8e85e3f2f064736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "decayedPremium(uint256,uint256)": { + "details": "Returns the premium price at current time elapsed", + "params": { + "elapsed": "time past since expiry", + "startPremium": "starting price" + } + }, + "premium(string,uint256,uint256)": { + "details": "Returns the pricing premium in wei." + }, + "price(string,uint256,uint256)": { + "details": "Returns the price to register or renew a name.", + "params": { + "duration": "How long the name is being registered or extended for, in seconds.", + "expires": "When the name presently expires (0 if this is a new registration).", + "name": "The name being registered or renewed." + }, + "returns": { + "_0": "base premium tuple of base price + premium price" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sepolia/LegacyENSRegistry.json b/deployments/sepolia/LegacyENSRegistry.json new file mode 100644 index 00000000..cf482c6b --- /dev/null +++ b/deployments/sepolia/LegacyENSRegistry.json @@ -0,0 +1,399 @@ +{ + "address": "0x94f523b8261B815b87EFfCf4d18E6aBeF18d6e4b", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "NewResolver", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "NewTTL", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "recordExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "resolver", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setSubnodeOwner", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setSubnodeRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setTTL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "ttl", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x7cdead963bc81e17a784cee8b5d278b01ab75722732a72b24c2783453a1314c5", + "receipt": { + "to": null, + "from": "0x0F32b753aFc8ABad9Ca6fE589F707755f4df2353", + "contractAddress": "0x94f523b8261B815b87EFfCf4d18E6aBeF18d6e4b", + "transactionIndex": 103, + "gasUsed": "643649", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x073960db096940bde9583ce199eb65a828bed004f92fc3c5bd1159515456f5a5", + "transactionHash": "0x7cdead963bc81e17a784cee8b5d278b01ab75722732a72b24c2783453a1314c5", + "logs": [], + "blockNumber": 3702721, + "cumulativeGasUsed": "9966264", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "bytecode": "0x608060405234801561001057600080fd5b5060008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb580546001600160a01b03191633179055610a43806100596000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80635b0fc9c311610081578063cf4088231161005b578063cf40882314610204578063e985e9c514610217578063f79fe5381461026357600080fd5b80635b0fc9c3146101cb5780635ef2c7f0146101de578063a22cb465146101f157600080fd5b806314ab9038116100b257806314ab90381461015657806316a25cbd1461016b5780631896f70a146101b857600080fd5b80630178b8bf146100d957806302571be31461012257806306ab592314610135575b600080fd5b6101056100e7366004610832565b6000908152602081905260409020600101546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b610105610130366004610832565b61028e565b610148610143366004610867565b6102bc565b604051908152602001610119565b6101696101643660046108b4565b6103bc565b005b61019f610179366004610832565b600090815260208190526040902060010154600160a01b900467ffffffffffffffff1690565b60405167ffffffffffffffff9091168152602001610119565b6101696101c63660046108e0565b6104a3565b6101696101d93660046108e0565b610575565b6101696101ec366004610903565b610641565b6101696101ff36600461095a565b610663565b610169610212366004610996565b6106cf565b6102536102253660046109e3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6040519015158152602001610119565b610253610271366004610832565b6000908152602081905260409020546001600160a01b0316151590565b6000818152602081905260408120546001600160a01b03163081036102b65750600092915050565b92915050565b60008381526020819052604081205484906001600160a01b03163381148061030757506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61031057600080fd5b604080516020810188905290810186905260009060600160408051601f1981840301815291815281516020928301206000818152928390529120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03881617905590506040516001600160a01b0386168152869088907fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829060200160405180910390a39695505050505050565b60008281526020819052604090205482906001600160a01b03163381148061040757506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61041057600080fd5b60405167ffffffffffffffff8416815284907f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa689060200160405180910390a25050600091825260208290526040909120600101805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60008281526020819052604090205482906001600160a01b0316338114806104ee57506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6104f757600080fd5b6040516001600160a01b038416815284907f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a09060200160405180910390a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b60008281526020819052604090205482906001600160a01b0316338114806105c057506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6105c957600080fd5b6000848152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385161790556040516001600160a01b038416815284907fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d2669060200160405180910390a250505050565b600061064e8686866102bc565b905061065b8184846106ea565b505050505050565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6106d98484610575565b6106e48483836106ea565b50505050565b6000838152602081905260409020600101546001600160a01b0383811691161461077d5760008381526020818152604091829020600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616908117909155915191825284917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0910160405180910390a25b60008381526020819052604090206001015467ffffffffffffffff828116600160a01b909204161461082d576000838152602081815260409182902060010180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16600160a01b67ffffffffffffffff861690810291909117909155915191825284917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68910160405180910390a25b505050565b60006020828403121561084457600080fd5b5035919050565b80356001600160a01b038116811461086257600080fd5b919050565b60008060006060848603121561087c57600080fd5b83359250602084013591506108936040850161084b565b90509250925092565b803567ffffffffffffffff8116811461086257600080fd5b600080604083850312156108c757600080fd5b823591506108d76020840161089c565b90509250929050565b600080604083850312156108f357600080fd5b823591506108d76020840161084b565b600080600080600060a0868803121561091b57600080fd5b85359450602086013593506109326040870161084b565b92506109406060870161084b565b915061094e6080870161089c565b90509295509295909350565b6000806040838503121561096d57600080fd5b6109768361084b565b91506020830135801515811461098b57600080fd5b809150509250929050565b600080600080608085870312156109ac57600080fd5b843593506109bc6020860161084b565b92506109ca6040860161084b565b91506109d86060860161089c565b905092959194509250565b600080604083850312156109f657600080fd5b6109ff8361084b565b91506108d76020840161084b56fea2646970667358221220d84b48b092515b90ab37b81060fd4db1dbc781903a719013c152ed8151eacd2c64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c80635b0fc9c311610081578063cf4088231161005b578063cf40882314610204578063e985e9c514610217578063f79fe5381461026357600080fd5b80635b0fc9c3146101cb5780635ef2c7f0146101de578063a22cb465146101f157600080fd5b806314ab9038116100b257806314ab90381461015657806316a25cbd1461016b5780631896f70a146101b857600080fd5b80630178b8bf146100d957806302571be31461012257806306ab592314610135575b600080fd5b6101056100e7366004610832565b6000908152602081905260409020600101546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b610105610130366004610832565b61028e565b610148610143366004610867565b6102bc565b604051908152602001610119565b6101696101643660046108b4565b6103bc565b005b61019f610179366004610832565b600090815260208190526040902060010154600160a01b900467ffffffffffffffff1690565b60405167ffffffffffffffff9091168152602001610119565b6101696101c63660046108e0565b6104a3565b6101696101d93660046108e0565b610575565b6101696101ec366004610903565b610641565b6101696101ff36600461095a565b610663565b610169610212366004610996565b6106cf565b6102536102253660046109e3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6040519015158152602001610119565b610253610271366004610832565b6000908152602081905260409020546001600160a01b0316151590565b6000818152602081905260408120546001600160a01b03163081036102b65750600092915050565b92915050565b60008381526020819052604081205484906001600160a01b03163381148061030757506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61031057600080fd5b604080516020810188905290810186905260009060600160408051601f1981840301815291815281516020928301206000818152928390529120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03881617905590506040516001600160a01b0386168152869088907fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829060200160405180910390a39695505050505050565b60008281526020819052604090205482906001600160a01b03163381148061040757506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b61041057600080fd5b60405167ffffffffffffffff8416815284907f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa689060200160405180910390a25050600091825260208290526040909120600101805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60008281526020819052604090205482906001600160a01b0316338114806104ee57506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6104f757600080fd5b6040516001600160a01b038416815284907f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a09060200160405180910390a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b60008281526020819052604090205482906001600160a01b0316338114806105c057506001600160a01b038116600090815260016020908152604080832033845290915290205460ff165b6105c957600080fd5b6000848152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385161790556040516001600160a01b038416815284907fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d2669060200160405180910390a250505050565b600061064e8686866102bc565b905061065b8184846106ea565b505050505050565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6106d98484610575565b6106e48483836106ea565b50505050565b6000838152602081905260409020600101546001600160a01b0383811691161461077d5760008381526020818152604091829020600101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038616908117909155915191825284917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0910160405180910390a25b60008381526020819052604090206001015467ffffffffffffffff828116600160a01b909204161461082d576000838152602081815260409182902060010180547fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff16600160a01b67ffffffffffffffff861690810291909117909155915191825284917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68910160405180910390a25b505050565b60006020828403121561084457600080fd5b5035919050565b80356001600160a01b038116811461086257600080fd5b919050565b60008060006060848603121561087c57600080fd5b83359250602084013591506108936040850161084b565b90509250925092565b803567ffffffffffffffff8116811461086257600080fd5b600080604083850312156108c757600080fd5b823591506108d76020840161089c565b90509250929050565b600080604083850312156108f357600080fd5b823591506108d76020840161084b565b600080600080600060a0868803121561091b57600080fd5b85359450602086013593506109326040870161084b565b92506109406060870161084b565b915061094e6080870161089c565b90509295509295909350565b6000806040838503121561096d57600080fd5b6109768361084b565b91506020830135801515811461098b57600080fd5b809150509250929050565b600080600080608085870312156109ac57600080fd5b843593506109bc6020860161084b565b92506109ca6040860161084b565b91506109d86060860161089c565b905092959194509250565b600080604083850312156109f657600080fd5b6109ff8361084b565b91506108d76020840161084b56fea2646970667358221220d84b48b092515b90ab37b81060fd4db1dbc781903a719013c152ed8151eacd2c64736f6c63430008110033" +} \ No newline at end of file diff --git a/deployments/sepolia/LegacyETHRegistrarController.json b/deployments/sepolia/LegacyETHRegistrarController.json new file mode 100644 index 00000000..1f4a2f61 --- /dev/null +++ b/deployments/sepolia/LegacyETHRegistrarController.json @@ -0,0 +1,602 @@ +{ + "address": "0x7e02892cfc2Bfd53a75275451d73cF620e793fc0", + "abi": [ + { + "inputs": [ + { + "internalType": "contract BaseRegistrar", + "name": "_base", + "type": "address" + }, + { + "internalType": "contract PriceOracle", + "name": "_prices", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minCommitmentAge", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxCommitmentAge", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cost", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cost", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "name": "NameRenewed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "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" + }, + { + "constant": true, + "inputs": [], + "name": "MIN_REGISTRATION_DURATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "available", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + } + ], + "name": "commit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "commitments", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + } + ], + "name": "makeCommitment", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "makeCommitmentWithConfig", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxCommitmentAge", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "minCommitmentAge", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + } + ], + "name": "register", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "secret", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "registerWithConfig", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "renew", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "rentPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_minCommitmentAge", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxCommitmentAge", + "type": "uint256" + } + ], + "name": "setCommitmentAges", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract PriceOracle", + "name": "_prices", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "valid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x3d289ffcfda7cd24dc7a2a833e297323ab7e9aa4410f685ed7fd16f6a49ffdbc", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x7e02892cfc2Bfd53a75275451d73cF620e793fc0", + "transactionIndex": 99, + "gasUsed": "1854573", + "logsBloom": "0x00000000000000000000000000000000000000000000200080800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000008000000000000000000000000000040000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe06eafbfccaa921d3bac3c1eb96aac0de6512c199082ea45414e4900c16b5fa5", + "transactionHash": "0x3d289ffcfda7cd24dc7a2a833e297323ab7e9aa4410f685ed7fd16f6a49ffdbc", + "logs": [ + { + "transactionIndex": 99, + "blockNumber": 3790197, + "transactionHash": "0x3d289ffcfda7cd24dc7a2a833e297323ab7e9aa4410f685ed7fd16f6a49ffdbc", + "address": "0x7e02892cfc2Bfd53a75275451d73cF620e793fc0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 1147, + "blockHash": "0xe06eafbfccaa921d3bac3c1eb96aac0de6512c199082ea45414e4900c16b5fa5" + } + ], + "blockNumber": 3790197, + "cumulativeGasUsed": "15120176", + "status": 1, + "byzantium": true + }, + "args": [ + "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "0x6810dbce73c67506f785a225f818b30d8f209aab", + 60, + 86400 + ], + "numDeployments": 1, + "bytecode": "0x608060405234801561001057600080fd5b50604051611f8c380380611f8c8339818101604052608081101561003357600080fd5b5080516020820151604080840151606090940151600080546001600160a01b031916331780825592519495939491926001600160a01b0316917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a381811161009d57600080fd5b600180546001600160a01b039586166001600160a01b0319918216179091556002805494909516931692909217909255600391909155600455611ea7806100e56000396000f3fe60806040526004361061016a5760003560e01c80638d839ffe116100cb578063aeb8ce9b1161007f578063f2fde38b11610059578063f2fde38b1461075f578063f49826be1461079f578063f7a169631461086d5761016a565b8063aeb8ce9b1461066d578063ce1e09c014610720578063f14fcbc8146107355761016a565b80638f32d59b116100b05780638f32d59b146105355780639791c0971461054a578063acf1a841146105fd5761016a565b80638d839ffe146104e25780638da5cb5b146104f75761016a565b80637e3244791161012257806383e7f6ff1161010757806383e7f6ff1461038657806385f6d1551461043b5780638a95b09f146104cd5761016a565b80637e3244791461032c578063839df9451461035c5761016a565b80633d86c52f116101535780633d86c52f146101e6578063530e784f146102d7578063715018a6146103175761016a565b806301ffc9a71461016f5780633ccfd60b146101cf575b600080fd5b34801561017b57600080fd5b506101bb6004803603602081101561019257600080fd5b50357fffffffff0000000000000000000000000000000000000000000000000000000016610944565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e4610b63565b005b3480156101f257600080fd5b506102c5600480360360a081101561020957600080fd5b81019060208101813564010000000081111561022457600080fd5b82018360208201111561023657600080fd5b8035906020019184600183028401116401000000008311171561025857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff83358116945060208401359360408101358216935060600135169050610ba3565b60408051918252519081900360200190f35b3480156102e357600080fd5b506101e4600480360360208110156102fa57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610cdf565b34801561032357600080fd5b506101e4610d65565b34801561033857600080fd5b506101e46004803603604081101561034f57600080fd5b5080359060200135610de5565b34801561036857600080fd5b506102c56004803603602081101561037f57600080fd5b5035610e01565b34801561039257600080fd5b506102c5600480360360408110156103a957600080fd5b8101906020810181356401000000008111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460018302840111640100000000831117156103f857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610e13915050565b6101e46004803603608081101561045157600080fd5b81019060208101813564010000000081111561046c57600080fd5b82018360208201111561047e57600080fd5b803590602001918460018302840111640100000000831117156104a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060400135610fc3565b3480156104d957600080fd5b506102c561100e565b3480156104ee57600080fd5b506102c5611015565b34801561050357600080fd5b5061050c61101b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561054157600080fd5b506101bb611037565b34801561055657600080fd5b506101bb6004803603602081101561056d57600080fd5b81019060208101813564010000000081111561058857600080fd5b82018360208201111561059a57600080fd5b803590602001918460018302840111640100000000831117156105bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611055945050505050565b6101e46004803603604081101561061357600080fd5b81019060208101813564010000000081111561062e57600080fd5b82018360208201111561064057600080fd5b8035906020019184600183028401116401000000008311171561066257600080fd5b91935091503561106a565b34801561067957600080fd5b506101bb6004803603602081101561069057600080fd5b8101906020810181356401000000008111156106ab57600080fd5b8201836020820111156106bd57600080fd5b803590602001918460018302840111640100000000831117156106df57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611252945050505050565b34801561072c57600080fd5b506102c5611312565b34801561074157600080fd5b506101e46004803603602081101561075857600080fd5b5035611318565b34801561076b57600080fd5b506101e46004803603602081101561078257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661134a565b3480156107ab57600080fd5b506102c5600480360360608110156107c257600080fd5b8101906020810181356401000000008111156107dd57600080fd5b8201836020820111156107ef57600080fd5b8035906020019184600183028401116401000000008311171561081157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff8335169350505060200135611364565b6101e4600480360360c081101561088357600080fd5b81019060208101813564010000000081111561089e57600080fd5b8201836020820111156108b057600080fd5b803590602001918460018302840111640100000000831117156108d257600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff83358116945060208401359360408101359350606081013582169250608001351661137c565b604080517f737570706f727473496e74657266616365286279746573342900000000000000815290519081900360190190206000907fffffffff0000000000000000000000000000000000000000000000000000000083811691161480610ae75750604080517f72656e657728737472696e672c75696e743235362900000000000000000000008152905190819003601501812090806028611de38239604080519182900360280182207f636f6d6d697428627974657333322900000000000000000000000000000000008352905191829003600f01822090925090806026611e0b82396026019050604051809103902060405180807f617661696c61626c6528737472696e67290000000000000000000000000000008152506011019050604051809103902060405180807f72656e74507269636528737472696e672c75696e7432353629000000000000008152506019019050604051809103902018181818187bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b5d57506040518080611da36040913960408051918290030181209150806042611e31823960420190506040518091039020187bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b92915050565b610b6b611037565b610b7457600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610ba0573d6000803e3d6000fd5b50565b8451602086012060009073ffffffffffffffffffffffffffffffffffffffff8416158015610be5575073ffffffffffffffffffffffffffffffffffffffff8316155b15610c4857604080516020808201939093527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b1681830152605480820188905282518083039091018152607490910190915280519101209050610cd6565b73ffffffffffffffffffffffffffffffffffffffff8416610c6857600080fd5b604080516020808201939093527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089811b82168385015287811b8216605484015286901b166068820152607c80820188905282518083039091018152609c909101909152805191012090505b95945050505050565b610ce7611037565b610cf057600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907ff261845a790fe29bbd6631e2ca4a5bdc83e6eed7c3271d9590d97287e00e912390600090a250565b610d6d611037565b610d7657600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b610ded611037565b610df657600080fd5b600391909155600455565b60056020526000908152604090205481565b8151602080840191909120600254600154604080517fd6e4fa8600000000000000000000000000000000000000000000000000000000815260048101859052905160009573ffffffffffffffffffffffffffffffffffffffff948516946350e9a715948a9491169263d6e4fa8692602480840193919291829003018186803b158015610e9e57600080fd5b505afa158015610eb2573d6000803e3d6000fd5b505050506040513d6020811015610ec857600080fd5b50516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152602481018290526044810188905260606004820190815283516064830152835189928291608490910190602087019080838360005b83811015610f43578181015183820152602001610f2b565b50505050905090810190601f168015610f705780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015610f8f57600080fd5b505afa158015610fa3573d6000803e3d6000fd5b505050506040513d6020811015610fb957600080fd5b5051949350505050565b61100785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508893508792508691508061137c565b5050505050565b6224ea0081565b60035481565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60005473ffffffffffffffffffffffffffffffffffffffff16331490565b6000600361106283611a7c565b101592915050565b60006110ad84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869250610e13915050565b9050803410156110bc57600080fd5b6000848460405180838380828437604080519390910183900383206001547fc475abff00000000000000000000000000000000000000000000000000000000855260048501829052602485018b905291519097506000965073ffffffffffffffffffffffffffffffffffffffff909116945063c475abff93506044808401936020935082900301818787803b15801561115457600080fd5b505af1158015611168573d6000803e3d6000fd5b505050506040513d602081101561117e57600080fd5b50519050348310156111bb5760405133903485900380156108fc02916000818181858888f193505050501580156111b9573d6000803e3d6000fd5b505b817f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8787868560405180806020018481526020018381526020018281038252868682818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920182900397509095505050505050a2505050505050565b8051602082012060009061126583611055565b801561130b5750600154604080517f96e494e800000000000000000000000000000000000000000000000000000000815260048101849052905173ffffffffffffffffffffffffffffffffffffffff909216916396e494e891602480820192602092909190829003018186803b1580156112de57600080fd5b505afa1580156112f2573d6000803e3d6000fd5b505050506040513d602081101561130857600080fd5b50515b9392505050565b60045481565b6004546000828152600560205260409020544291011061133757600080fd5b6000908152600560205260409020429055565b611352611037565b61135b57600080fd5b610ba081611c68565b6000611374848484600080610ba3565b949350505050565b600061138b8787868686610ba3565b9050600061139a888784611d15565b885160208a012090915080600073ffffffffffffffffffffffffffffffffffffffff8716156118a257600154604080517ffca247ac00000000000000000000000000000000000000000000000000000000815260048101859052306024820152604481018c9052905173ffffffffffffffffffffffffffffffffffffffff9092169163fca247ac916064808201926020929091908290030181600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b505050506040513d602081101561146e57600080fd5b5051600154604080517fddf7fcb0000000000000000000000000000000000000000000000000000000008152905192935060009273ffffffffffffffffffffffffffffffffffffffff9092169163ddf7fcb091600480820192602092909190829003018186803b1580156114e157600080fd5b505afa1580156114f5573d6000803e3d6000fd5b505050506040513d602081101561150b57600080fd5b505160408051602081810193909352808201879052815180820383018152606082018084528151918501919091206001547f3f15457f00000000000000000000000000000000000000000000000000000000909252925192945073ffffffffffffffffffffffffffffffffffffffff1692633f15457f92606480840193829003018186803b15801561159c57600080fd5b505afa1580156115b0573d6000803e3d6000fd5b505050506040513d60208110156115c657600080fd5b5051604080517f1896f70a0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff8b8116602483015291519190921691631896f70a91604480830192600092919082900301818387803b15801561164057600080fd5b505af1158015611654573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff871615611714578773ffffffffffffffffffffffffffffffffffffffff1663d5fa2b0082896040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156116fb57600080fd5b505af115801561170f573d6000803e3d6000fd5b505050505b600154604080517f28ed4f6c0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8e81166024830152915191909216916328ed4f6c91604480830192600092919082900301818387803b15801561178f57600080fd5b505af11580156117a3573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd308d866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561188457600080fd5b505af1158015611898573d6000803e3d6000fd5b5050505050611975565b73ffffffffffffffffffffffffffffffffffffffff8616156118c357600080fd5b600154604080517ffca247ac0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff8d81166024830152604482018d90529151919092169163fca247ac9160648083019260209291908290030181600087803b15801561194657600080fd5b505af115801561195a573d6000803e3d6000fd5b505050506040513d602081101561197057600080fd5b505190505b8973ffffffffffffffffffffffffffffffffffffffff16837fca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f8d87856040518080602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156119fa5781810151838201526020016119e2565b50505050905090810190601f168015611a275780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a383341115611a6f5760405133903486900380156108fc02916000818181858888f19350505050158015611a6d573d6000803e3d6000fd5b505b5050505050505050505050565b8051600090819081905b80821015611c5f576000858381518110611a9c57fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f8000000000000000000000000000000000000000000000000000000000000000811015611af857600183019250611c53565b7fe0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611b4d57600283019250611c53565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611ba257600383019250611c53565b7ff8000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611bf757600483019250611c53565b7ffc000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611c4c57600583019250611c53565b6006830192505b50600190920191611a86565b50909392505050565b73ffffffffffffffffffffffffffffffffffffffff8116611c8857600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60035460008281526005602052604081205490914291011115611d3757600080fd5b60045460008381526005602052604090205442910111611d5657600080fd5b611d5f84611252565b611d6857600080fd5b6000828152600560205260408120819055611d838585610e13565b90506224ea00841015611d9557600080fd5b8034101561137457600080fdfe6d616b65436f6d6d69746d656e7457697468436f6e66696728737472696e672c616464726573732c627974657333322c616464726573732c6164647265737329726567697374657228737472696e672c616464726573732c75696e743235362c62797465733332296d616b65436f6d6d69746d656e7428737472696e672c616464726573732c6279746573333229726567697374657257697468436f6e66696728737472696e672c616464726573732c75696e743235362c627974657333322c616464726573732c6164647265737329a265627a7a7231582053a253c3d59287a7d8afcbca61f9a34825e2003361654c7f2350c82db76d3db764736f6c63430005110032", + "deployedBytecode": "0x60806040526004361061016a5760003560e01c80638d839ffe116100cb578063aeb8ce9b1161007f578063f2fde38b11610059578063f2fde38b1461075f578063f49826be1461079f578063f7a169631461086d5761016a565b8063aeb8ce9b1461066d578063ce1e09c014610720578063f14fcbc8146107355761016a565b80638f32d59b116100b05780638f32d59b146105355780639791c0971461054a578063acf1a841146105fd5761016a565b80638d839ffe146104e25780638da5cb5b146104f75761016a565b80637e3244791161012257806383e7f6ff1161010757806383e7f6ff1461038657806385f6d1551461043b5780638a95b09f146104cd5761016a565b80637e3244791461032c578063839df9451461035c5761016a565b80633d86c52f116101535780633d86c52f146101e6578063530e784f146102d7578063715018a6146103175761016a565b806301ffc9a71461016f5780633ccfd60b146101cf575b600080fd5b34801561017b57600080fd5b506101bb6004803603602081101561019257600080fd5b50357fffffffff0000000000000000000000000000000000000000000000000000000016610944565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e4610b63565b005b3480156101f257600080fd5b506102c5600480360360a081101561020957600080fd5b81019060208101813564010000000081111561022457600080fd5b82018360208201111561023657600080fd5b8035906020019184600183028401116401000000008311171561025857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff83358116945060208401359360408101358216935060600135169050610ba3565b60408051918252519081900360200190f35b3480156102e357600080fd5b506101e4600480360360208110156102fa57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610cdf565b34801561032357600080fd5b506101e4610d65565b34801561033857600080fd5b506101e46004803603604081101561034f57600080fd5b5080359060200135610de5565b34801561036857600080fd5b506102c56004803603602081101561037f57600080fd5b5035610e01565b34801561039257600080fd5b506102c5600480360360408110156103a957600080fd5b8101906020810181356401000000008111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460018302840111640100000000831117156103f857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610e13915050565b6101e46004803603608081101561045157600080fd5b81019060208101813564010000000081111561046c57600080fd5b82018360208201111561047e57600080fd5b803590602001918460018302840111640100000000831117156104a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060400135610fc3565b3480156104d957600080fd5b506102c561100e565b3480156104ee57600080fd5b506102c5611015565b34801561050357600080fd5b5061050c61101b565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561054157600080fd5b506101bb611037565b34801561055657600080fd5b506101bb6004803603602081101561056d57600080fd5b81019060208101813564010000000081111561058857600080fd5b82018360208201111561059a57600080fd5b803590602001918460018302840111640100000000831117156105bc57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611055945050505050565b6101e46004803603604081101561061357600080fd5b81019060208101813564010000000081111561062e57600080fd5b82018360208201111561064057600080fd5b8035906020019184600183028401116401000000008311171561066257600080fd5b91935091503561106a565b34801561067957600080fd5b506101bb6004803603602081101561069057600080fd5b8101906020810181356401000000008111156106ab57600080fd5b8201836020820111156106bd57600080fd5b803590602001918460018302840111640100000000831117156106df57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611252945050505050565b34801561072c57600080fd5b506102c5611312565b34801561074157600080fd5b506101e46004803603602081101561075857600080fd5b5035611318565b34801561076b57600080fd5b506101e46004803603602081101561078257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661134a565b3480156107ab57600080fd5b506102c5600480360360608110156107c257600080fd5b8101906020810181356401000000008111156107dd57600080fd5b8201836020820111156107ef57600080fd5b8035906020019184600183028401116401000000008311171561081157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff8335169350505060200135611364565b6101e4600480360360c081101561088357600080fd5b81019060208101813564010000000081111561089e57600080fd5b8201836020820111156108b057600080fd5b803590602001918460018302840111640100000000831117156108d257600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505073ffffffffffffffffffffffffffffffffffffffff83358116945060208401359360408101359350606081013582169250608001351661137c565b604080517f737570706f727473496e74657266616365286279746573342900000000000000815290519081900360190190206000907fffffffff0000000000000000000000000000000000000000000000000000000083811691161480610ae75750604080517f72656e657728737472696e672c75696e743235362900000000000000000000008152905190819003601501812090806028611de38239604080519182900360280182207f636f6d6d697428627974657333322900000000000000000000000000000000008352905191829003600f01822090925090806026611e0b82396026019050604051809103902060405180807f617661696c61626c6528737472696e67290000000000000000000000000000008152506011019050604051809103902060405180807f72656e74507269636528737472696e672c75696e7432353629000000000000008152506019019050604051809103902018181818187bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b5d57506040518080611da36040913960408051918290030181209150806042611e31823960420190506040518091039020187bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b92915050565b610b6b611037565b610b7457600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610ba0573d6000803e3d6000fd5b50565b8451602086012060009073ffffffffffffffffffffffffffffffffffffffff8416158015610be5575073ffffffffffffffffffffffffffffffffffffffff8316155b15610c4857604080516020808201939093527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089901b1681830152605480820188905282518083039091018152607490910190915280519101209050610cd6565b73ffffffffffffffffffffffffffffffffffffffff8416610c6857600080fd5b604080516020808201939093527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089811b82168385015287811b8216605484015286901b166068820152607c80820188905282518083039091018152609c909101909152805191012090505b95945050505050565b610ce7611037565b610cf057600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907ff261845a790fe29bbd6631e2ca4a5bdc83e6eed7c3271d9590d97287e00e912390600090a250565b610d6d611037565b610d7657600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b610ded611037565b610df657600080fd5b600391909155600455565b60056020526000908152604090205481565b8151602080840191909120600254600154604080517fd6e4fa8600000000000000000000000000000000000000000000000000000000815260048101859052905160009573ffffffffffffffffffffffffffffffffffffffff948516946350e9a715948a9491169263d6e4fa8692602480840193919291829003018186803b158015610e9e57600080fd5b505afa158015610eb2573d6000803e3d6000fd5b505050506040513d6020811015610ec857600080fd5b50516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152602481018290526044810188905260606004820190815283516064830152835189928291608490910190602087019080838360005b83811015610f43578181015183820152602001610f2b565b50505050905090810190601f168015610f705780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015610f8f57600080fd5b505afa158015610fa3573d6000803e3d6000fd5b505050506040513d6020811015610fb957600080fd5b5051949350505050565b61100785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508893508792508691508061137c565b5050505050565b6224ea0081565b60035481565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60005473ffffffffffffffffffffffffffffffffffffffff16331490565b6000600361106283611a7c565b101592915050565b60006110ad84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869250610e13915050565b9050803410156110bc57600080fd5b6000848460405180838380828437604080519390910183900383206001547fc475abff00000000000000000000000000000000000000000000000000000000855260048501829052602485018b905291519097506000965073ffffffffffffffffffffffffffffffffffffffff909116945063c475abff93506044808401936020935082900301818787803b15801561115457600080fd5b505af1158015611168573d6000803e3d6000fd5b505050506040513d602081101561117e57600080fd5b50519050348310156111bb5760405133903485900380156108fc02916000818181858888f193505050501580156111b9573d6000803e3d6000fd5b505b817f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8787868560405180806020018481526020018381526020018281038252868682818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920182900397509095505050505050a2505050505050565b8051602082012060009061126583611055565b801561130b5750600154604080517f96e494e800000000000000000000000000000000000000000000000000000000815260048101849052905173ffffffffffffffffffffffffffffffffffffffff909216916396e494e891602480820192602092909190829003018186803b1580156112de57600080fd5b505afa1580156112f2573d6000803e3d6000fd5b505050506040513d602081101561130857600080fd5b50515b9392505050565b60045481565b6004546000828152600560205260409020544291011061133757600080fd5b6000908152600560205260409020429055565b611352611037565b61135b57600080fd5b610ba081611c68565b6000611374848484600080610ba3565b949350505050565b600061138b8787868686610ba3565b9050600061139a888784611d15565b885160208a012090915080600073ffffffffffffffffffffffffffffffffffffffff8716156118a257600154604080517ffca247ac00000000000000000000000000000000000000000000000000000000815260048101859052306024820152604481018c9052905173ffffffffffffffffffffffffffffffffffffffff9092169163fca247ac916064808201926020929091908290030181600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b505050506040513d602081101561146e57600080fd5b5051600154604080517fddf7fcb0000000000000000000000000000000000000000000000000000000008152905192935060009273ffffffffffffffffffffffffffffffffffffffff9092169163ddf7fcb091600480820192602092909190829003018186803b1580156114e157600080fd5b505afa1580156114f5573d6000803e3d6000fd5b505050506040513d602081101561150b57600080fd5b505160408051602081810193909352808201879052815180820383018152606082018084528151918501919091206001547f3f15457f00000000000000000000000000000000000000000000000000000000909252925192945073ffffffffffffffffffffffffffffffffffffffff1692633f15457f92606480840193829003018186803b15801561159c57600080fd5b505afa1580156115b0573d6000803e3d6000fd5b505050506040513d60208110156115c657600080fd5b5051604080517f1896f70a0000000000000000000000000000000000000000000000000000000081526004810184905273ffffffffffffffffffffffffffffffffffffffff8b8116602483015291519190921691631896f70a91604480830192600092919082900301818387803b15801561164057600080fd5b505af1158015611654573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff871615611714578773ffffffffffffffffffffffffffffffffffffffff1663d5fa2b0082896040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156116fb57600080fd5b505af115801561170f573d6000803e3d6000fd5b505050505b600154604080517f28ed4f6c0000000000000000000000000000000000000000000000000000000081526004810186905273ffffffffffffffffffffffffffffffffffffffff8e81166024830152915191909216916328ed4f6c91604480830192600092919082900301818387803b15801561178f57600080fd5b505af11580156117a3573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd308d866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561188457600080fd5b505af1158015611898573d6000803e3d6000fd5b5050505050611975565b73ffffffffffffffffffffffffffffffffffffffff8616156118c357600080fd5b600154604080517ffca247ac0000000000000000000000000000000000000000000000000000000081526004810185905273ffffffffffffffffffffffffffffffffffffffff8d81166024830152604482018d90529151919092169163fca247ac9160648083019260209291908290030181600087803b15801561194657600080fd5b505af115801561195a573d6000803e3d6000fd5b505050506040513d602081101561197057600080fd5b505190505b8973ffffffffffffffffffffffffffffffffffffffff16837fca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f8d87856040518080602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156119fa5781810151838201526020016119e2565b50505050905090810190601f168015611a275780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a383341115611a6f5760405133903486900380156108fc02916000818181858888f19350505050158015611a6d573d6000803e3d6000fd5b505b5050505050505050505050565b8051600090819081905b80821015611c5f576000858381518110611a9c57fe5b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f8000000000000000000000000000000000000000000000000000000000000000811015611af857600183019250611c53565b7fe0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611b4d57600283019250611c53565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611ba257600383019250611c53565b7ff8000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611bf757600483019250611c53565b7ffc000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015611c4c57600583019250611c53565b6006830192505b50600190920191611a86565b50909392505050565b73ffffffffffffffffffffffffffffffffffffffff8116611c8857600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60035460008281526005602052604081205490914291011115611d3757600080fd5b60045460008381526005602052604090205442910111611d5657600080fd5b611d5f84611252565b611d6857600080fd5b6000828152600560205260408120819055611d838585610e13565b90506224ea00841015611d9557600080fd5b8034101561137457600080fdfe6d616b65436f6d6d69746d656e7457697468436f6e66696728737472696e672c616464726573732c627974657333322c616464726573732c6164647265737329726567697374657228737472696e672c616464726573732c75696e743235362c62797465733332296d616b65436f6d6d69746d656e7428737472696e672c616464726573732c6279746573333229726567697374657257697468436f6e66696728737472696e672c616464726573732c75696e743235362c627974657333322c616464726573732c6164647265737329a265627a7a7231582053a253c3d59287a7d8afcbca61f9a34825e2003361654c7f2350c82db76d3db764736f6c63430005110032" +} \ No newline at end of file diff --git a/deployments/sepolia/LegacyPublicResolver.json b/deployments/sepolia/LegacyPublicResolver.json new file mode 100644 index 00000000..307cc997 --- /dev/null +++ b/deployments/sepolia/LegacyPublicResolver.json @@ -0,0 +1,888 @@ +{ + "address": "0x0CeEC524b2807841739D3B5E161F5bf1430FFA48", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + } + ], + "name": "ABIChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "AddrChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "newAddress", + "type": "bytes" + } + ], + "name": "AddressChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isAuthorised", + "type": "bool" + } + ], + "name": "AuthorisationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "ContenthashChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "record", + "type": "bytes" + } + ], + "name": "DNSRecordChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "DNSRecordDeleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "DNSZoneCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "InterfaceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "NameChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "PubkeyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "string", + "name": "indexedKey", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "TextChanged", + "type": "event" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentTypes", + "type": "uint256" + } + ], + "name": "ABI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "authorisations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "clearDNSZone", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "contenthash", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "dnsRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + } + ], + "name": "hasDNSRecords", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "interfaceImplementer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "pubkey", + "outputs": [ + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setABI", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "a", + "type": "bytes" + } + ], + "name": "setAddr", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "setAddr", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "isAuthorised", + "type": "bool" + } + ], + "name": "setAuthorisation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "setContenthash", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setDNSRecords", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "setInterface", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "setPubkey", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setText", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "text", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x8c91c98c3308a3a14ec741a5e5890d9253466a82e345d11a1ac922f121423461", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x0CeEC524b2807841739D3B5E161F5bf1430FFA48", + "transactionIndex": 122, + "gasUsed": "2382812", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x24f66f1b0652c26f44660cb37de7a62ecf1a31514798249765d93b22daaaa155", + "transactionHash": "0x8c91c98c3308a3a14ec741a5e5890d9253466a82e345d11a1ac922f121423461", + "logs": [], + "blockNumber": 3790166, + "cumulativeGasUsed": "23665216", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + ], + "numDeployments": 1, + "bytecode": "0x60806040523480156200001157600080fd5b5060405162002abe38038062002abe83398101604081905262000034916200006d565b600a80546001600160a01b0319166001600160a01b0392909216919091179055620000d6565b80516200006781620000bc565b92915050565b6000602082840312156200008057600080fd5b60006200008e84846200005a565b949350505050565b60006200006782620000b0565b6000620000678262000096565b6001600160a01b031690565b620000c781620000a3565b8114620000d357600080fd5b50565b6129d880620000e66000396000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c8063691f3431116100e3578063bc1c58d11161008c578063e59d895d11610066578063e59d895d14610387578063f1cb7e061461039a578063f86bc879146103ad57610198565b8063bc1c58d114610340578063c869023314610353578063d5fa2b001461037457610198565b8063a8fa5682116100bd578063a8fa5682146102fa578063ac9650d81461030d578063ad5780af1461032d57610198565b8063691f3431146102c157806377372213146102d45780638b95dd71146102e757610198565b8063304e6ade116101455780634cbf6ba41161011f5780634cbf6ba41461027b57806359d1d43c1461028e578063623195b0146102ae57610198565b8063304e6ade146102425780633b3b57de146102555780633e9ce7941461026857610198565b8063124a319c11610176578063124a319c146101ee5780632203ab561461020e57806329cd62ea1461022f57610198565b806301ffc9a71461019d5780630af179d7146101c657806310f13a8c146101db575b600080fd5b6101b06101ab366004612504565b6103c0565b6040516101bd9190612730565b60405180910390f35b6101d96101d4366004612364565b61041e565b005b6101d96101e93660046123ba565b61060b565b6102016101fc366004612302565b6106b8565b6040516101bd9190612703565b61022161021c36600461224c565b6109f7565b6040516101bd9291906127f3565b6101d961023d36600461227c565b610b16565b6101d9610250366004612364565b610b96565b610201610263366004612164565b610bf5565b6101d9610276366004612209565b610c2a565b6101b061028936600461224c565b610ccf565b6102a161029c366004612364565b610d01565b6040516101bd9190612787565b6101d96102bc366004612441565b610dc3565b6102a16102cf366004612164565b610e3e565b6101d96102e2366004612364565b610edf565b6101d96102f53660046124a9565b610f3e565b6102a16103083660046122bf565b611003565b61032061031b366004612122565b611090565b6040516101bd919061271f565b6101d961033b366004612164565b6111d4565b6102a161034e366004612164565b611227565b610366610361366004612164565b61128f565b6040516101bd92919061274c565b6101d9610382366004612182565b6112a9565b6101d9610395366004612332565b6112d0565b6102a16103a836600461224c565b61139d565b6101b06103bb3660046121bc565b611446565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f59d1d43c00000000000000000000000000000000000000000000000000000000148061041657506104168261146c565b90505b919050565b82610428816114c2565b61043157600080fd5b60008060608082610440611e30565b61048a60008a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505063ffffffff6115d1169050565b90505b610496816115ec565b6105ae5761ffff86166104ee57806040015195506104b3816115fa565b9350836040516020016104c691906126ec565b6040516020818303038152906040528051906020012091506104e781611621565b92506105a0565b60606104f9826115fa565b9050816040015161ffff168761ffff161415806105235750610521858263ffffffff61164216565b155b1561059e576105778b86898d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050602087015189518c918290039015611660565b81604001519650816020015195508094508480519060200120925061059b82611621565b93505b505b6105a9816118c7565b61048d565b50825115610600576106008984878b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505088518b9250828f03915015611660565b505050505050505050565b84610615816114c2565b61061e57600080fd5b82826009600089815260200190815260200160002087876040516106439291906126df565b90815260405190819003602001902061065d929091611e7b565b50848460405161066e9291906126df565b6040518091039020867fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a755087876040516106a8929190612775565b60405180910390a3505050505050565b60008281526006602090815260408083207fffffffff000000000000000000000000000000000000000000000000000000008516845290915281205473ffffffffffffffffffffffffffffffffffffffff1680156107175790506109f1565b600061072285610bf5565b905073ffffffffffffffffffffffffffffffffffffffff811661074a576000925050506109f1565b600060608273ffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b60405160240161077d9190612767565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052516107fe91906126ec565b600060405180830381855afa9150503d8060008114610839576040519150601f19603f3d011682016040523d82523d6000602084013e61083e565b606091505b5091509150811580610851575060208151105b8061088d575080601f8151811061086457fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b1561089f5760009450505050506109f1565b8273ffffffffffffffffffffffffffffffffffffffff16866040516024016108c79190612767565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790525161094891906126ec565b600060405180830381855afa9150503d8060008114610983576040519150601f19603f3d011682016040523d82523d6000602084013e610988565b606091505b50909250905081158061099c575060208151105b806109d8575080601f815181106109af57fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109ea5760009450505050506109f1565b5090925050505b92915050565b600082815260208190526040812060609060015b848111610af85780851615801590610a4357506000818152602083905260409020546002600019610100600184161502019091160415155b15610af0576000818152602083815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845284939192839190830182828015610ade5780601f10610ab357610100808354040283529160200191610ade565b820191906000526020600020905b815481529060010190602001808311610ac157829003601f168201915b50505050509050935093505050610b0f565b60011b610a0b565b505060408051602081019091526000808252925090505b9250929050565b82610b20816114c2565b610b2957600080fd5b6040805180820182528481526020808201858152600088815260089092529083902091518255516001909101555184907f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4690610b88908690869061274c565b60405180910390a250505050565b82610ba0816114c2565b610ba957600080fd5b6000848152600260205260409020610bc2908484611e7b565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610b88929190612775565b60006060610c0483603c61139d565b9050805160001415610c1a576000915050610419565b610c238161199a565b9392505050565b6000838152600b602090815260408083203380855290835281842073ffffffffffffffffffffffffffffffffffffffff871680865293529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515151790555190919085907fe1c5610a6e0cbe10764ecd182adcef1ec338dc4e199c99c32ce98f38e12791df90610cc2908690612730565b60405180910390a4505050565b600091825260056020908152604080842060038352818520548552825280842092845291905290205461ffff16151590565b6060600960008581526020019081526020016000208383604051610d269291906126df565b9081526040805160209281900383018120805460026001821615610100026000190190911604601f81018590048502830185019093528282529092909190830182828015610db55780601f10610d8a57610100808354040283529160200191610db5565b820191906000526020600020905b815481529060010190602001808311610d9857829003601f168201915b505050505090509392505050565b83610dcd816114c2565b610dd657600080fd5b6000198401841615610de757600080fd5b6000858152602081815260408083208784529091529020610e09908484611e7b565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b60008181526007602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610ed35780601f10610ea857610100808354040283529160200191610ed3565b820191906000526020600020905b815481529060010190602001808311610eb657829003601f168201915b50505050509050919050565b82610ee9816114c2565b610ef257600080fd5b6000848152600760205260409020610f0b908484611e7b565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610b88929190612775565b82610f48816114c2565b610f5157600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af7528484604051610f839291906127f3565b60405180910390a2603c831415610fd557837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2610fbf8461199a565b604051610fcc9190612711565b60405180910390a25b600084815260016020908152604080832086845282529091208351610ffc92850190611f17565b5050505050565b6000838152600460209081526040808320600383528184205484528252808320858452825280832061ffff8516845282529182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610db55780601f10610d8a57610100808354040283529160200191610db5565b6040805182815260208084028201019091526060908280156110c657816020015b60608152602001906001900390816110b15790505b50905060005b828110156111cd5760006060308686858181106110e557fe5b6020028201905080357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe13684900301811261111f57600080fd5b9091016020810191503567ffffffffffffffff81111561113e57600080fd5b3681900382131561114e57600080fd5b60405161115c9291906126df565b600060405180830381855af49150503d8060008114611197576040519150601f19603f3d011682016040523d82523d6000602084013e61119c565b606091505b5091509150816111ab57600080fd5b808484815181106111b857fe5b602090810291909101015250506001016110cc565b5092915050565b806111de816114c2565b6111e757600080fd5b600082815260036020526040808220805460010190555183917fb757169b8492ca2f1c6619d9d76ce22803035c3b1d5f6930dffe7b127c1a198391a25050565b600081815260026020818152604092839020805484516001821615610100026000190190911693909304601f81018390048302840183019094528383526060939091830182828015610ed35780601f10610ea857610100808354040283529160200191610ed3565b600090815260086020526040902080546001909101549091565b816112b3816114c2565b6112bc57600080fd5b6112cb83603c6102f5856119c2565b505050565b826112da816114c2565b6112e357600080fd5b60008481526006602090815260408083207fffffffff00000000000000000000000000000000000000000000000000000000871680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055905185907f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa9061138f908690612703565b60405180910390a350505050565b600082815260016020818152604080842085855282529283902080548451600294821615610100026000190190911693909304601f810183900483028401830190945283835260609390918301828280156114395780601f1061140e57610100808354040283529160200191611439565b820191906000526020600020905b81548152906001019060200180831161141c57829003601f168201915b5050505050905092915050565b600b60209081526000938452604080852082529284528284209052825290205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fc86902330000000000000000000000000000000000000000000000000000000014806104165750610416826119fb565b600a546040517f02571be3000000000000000000000000000000000000000000000000000000008152600091829173ffffffffffffffffffffffffffffffffffffffff909116906302571be39061151d90869060040161273e565b60206040518083038186803b15801561153557600080fd5b505afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061156d91908101906120fc565b905073ffffffffffffffffffffffffffffffffffffffff8116331480610c2357506000838152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452825280832033845290915290205460ff16915050919050565b6115d9611e30565b82815260c081018290526109f1816118c7565b805151602090910151101590565b60208101518151606091610416916116129082611a51565b8451919063ffffffff611a9816565b60a081015160c082015182516060926104169281900363ffffffff611a9816565b600081518351148015610c235750610c238360008460008751611afa565b600087815260036020908152604090912054875191880191909120606061168e87878763ffffffff611a9816565b905083156117a85760008a81526004602090815260408083208684528252808320858452825280832061ffff8c16845290915290205460026000196101006001841615020190911604156117335760008a81526005602090815260408083208684528252808320858452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000811661ffff918216600019019091161790555b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c168452909152812061176991611f85565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a60405161179b929190612798565b60405180910390a26118bb565b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c168452909152902054600260001961010060018416150201909116046118425760008a815260056020908152604080832086845282528083208584529091529020805461ffff808216600101167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009091161790555b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c1684528252909120825161187d92840190611f17565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a846040516118b2939291906127b8565b60405180910390a25b50505050505050505050565b60c081015160208201819052815151116118e057611997565b60006118f482600001518360200151611a51565b602083015183519101915061190f908263ffffffff611b1d16565b61ffff166040830152815160029190910190611931908263ffffffff611b1d16565b61ffff166060830152815160029190910190611953908263ffffffff611b3d16565b63ffffffff908116608084015282516004929092019160009161197991908490611b1d16565b600283810160a086015261ffff9190911690920190910160c0830152505b50565b600081516014146119aa57600080fd5b50602001516c01000000000000000000000000900490565b6040805160148082528183019092526060916020820181803883395050506c010000000000000000000000009290920260208301525090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f691f3431000000000000000000000000000000000000000000000000000000001480610416575061041682611b5f565b6000815b83518110611a5f57fe5b6000611a71858363ffffffff611bc416565b60ff1691820160010191905080611a885750611a8e565b50611a55565b9190910392915050565b606083518284011115611aaa57600080fd5b6060826040519080825280601f01601f191660200182016040528015611ad7576020820181803883390190505b50905060208082019086860101611aef828287611be2565b509095945050505050565b6000611b07848484611c3e565b611b12878785611c3e565b149695505050505050565b60008251826002011115611b3057600080fd5b50016002015161ffff1690565b60008251826004011115611b5057600080fd5b50016004015163ffffffff1690565b6000604051611b6d906126f8565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610416575061041682611c5a565b6000828281518110611bd257fe5b016020015160f81c905092915050565b5b60208110611c205781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001611be3565b905182516020929092036101000a6000190180199091169116179052565b600083518284011115611c5057600080fd5b5091016020012090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fa8fa568200000000000000000000000000000000000000000000000000000000148061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167fbc1c58d100000000000000000000000000000000000000000000000000000000148061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167f3b3b57de000000000000000000000000000000000000000000000000000000001480611d8f57507fffffffff0000000000000000000000000000000000000000000000000000000082167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b8061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167f2203ab5600000000000000000000000000000000000000000000000000000000148061041657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610416565b6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611eda578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555611f07565b82800160010185558215611f07579182015b82811115611f07578235825591602001919060010190611eec565b50611f13929150611fc5565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f5857805160ff1916838001178555611f07565b82800160010185558215611f07579182015b82811115611f07578251825591602001919060010190611f6a565b50805460018160011615610100020316600290046000825580601f10611fab5750611997565b601f01602090049060005260206000209081019061199791905b611fdf91905b80821115611f135760008155600101611fcb565b90565b80356109f18161295d565b80516109f18161295d565b60008083601f84011261200a57600080fd5b50813567ffffffffffffffff81111561202257600080fd5b602083019150836020820283011115610b0f57600080fd5b80356109f181612971565b80356109f18161297a565b80356109f181612983565b60008083601f84011261206d57600080fd5b50813567ffffffffffffffff81111561208557600080fd5b602083019150836001820283011115610b0f57600080fd5b600082601f8301126120ae57600080fd5b81356120c16120bc8261283a565b612813565b915080825260208301602083018583830111156120dd57600080fd5b6120e88382846128f9565b50505092915050565b80356109f18161298c565b60006020828403121561210e57600080fd5b600061211a8484611fed565b949350505050565b6000806020838503121561213557600080fd5b823567ffffffffffffffff81111561214c57600080fd5b61215885828601611ff8565b92509250509250929050565b60006020828403121561217657600080fd5b600061211a8484612045565b6000806040838503121561219557600080fd5b60006121a18585612045565b92505060206121b285828601611fe2565b9150509250929050565b6000806000606084860312156121d157600080fd5b60006121dd8686612045565b93505060206121ee86828701611fe2565b92505060406121ff86828701611fe2565b9150509250925092565b60008060006060848603121561221e57600080fd5b600061222a8686612045565b935050602061223b86828701611fe2565b92505060406121ff8682870161203a565b6000806040838503121561225f57600080fd5b600061226b8585612045565b92505060206121b285828601612045565b60008060006060848603121561229157600080fd5b600061229d8686612045565b93505060206122ae86828701612045565b92505060406121ff86828701612045565b6000806000606084860312156122d457600080fd5b60006122e08686612045565b93505060206122f186828701612045565b92505060406121ff868287016120f1565b6000806040838503121561231557600080fd5b60006123218585612045565b92505060206121b285828601612050565b60008060006060848603121561234757600080fd5b60006123538686612045565b93505060206121ee86828701612050565b60008060006040848603121561237957600080fd5b60006123858686612045565b935050602084013567ffffffffffffffff8111156123a257600080fd5b6123ae8682870161205b565b92509250509250925092565b6000806000806000606086880312156123d257600080fd5b60006123de8888612045565b955050602086013567ffffffffffffffff8111156123fb57600080fd5b6124078882890161205b565b9450945050604086013567ffffffffffffffff81111561242657600080fd5b6124328882890161205b565b92509250509295509295909350565b6000806000806060858703121561245757600080fd5b60006124638787612045565b945050602061247487828801612045565b935050604085013567ffffffffffffffff81111561249157600080fd5b61249d8782880161205b565b95989497509550505050565b6000806000606084860312156124be57600080fd5b60006124ca8686612045565b93505060206124db86828701612045565b925050604084013567ffffffffffffffff8111156124f857600080fd5b6121ff8682870161209d565b60006020828403121561251657600080fd5b600061211a8484612050565b6000610c23838361261a565b612537816128e8565b82525050565b61253781612893565b600061255182612886565b61255b818561288a565b93508360208202850161256d85612880565b8060005b858110156125a7578484038952815161258a8582612522565b945061259583612880565b60209a909a0199925050600101612571565b5091979650505050505050565b6125378161289e565b61253781611fdf565b612537816128a3565b60006125db838561288a565b93506125e88385846128f9565b6125f183612935565b9093019392505050565b60006126078385610419565b93506126148385846128f9565b50500190565b600061262582612886565b61262f818561288a565b935061263f818560208601612905565b6125f181612935565b600061265382612886565b61265d8185610419565b935061266d818560208601612905565b9290920192915050565b6000612684602483610419565b7f696e74657266616365496d706c656d656e74657228627974657333322c62797481527f6573342900000000000000000000000000000000000000000000000000000000602082015260240192915050565b612537816128c8565b600061211a8284866125fb565b6000610c238284612648565b60006109f182612677565b602081016109f1828461253d565b602081016109f1828461252e565b60208082528101610c238184612546565b602081016109f182846125b4565b602081016109f182846125bd565b6040810161275a82856125bd565b610c2360208301846125bd565b602081016109f182846125c6565b6020808252810161211a8184866125cf565b60208082528101610c23818461261a565b604080825281016127a9818561261a565b9050610c2360208301846126d6565b606080825281016127c9818661261a565b90506127d860208301856126d6565b81810360408301526127ea818461261a565b95945050505050565b6040810161280182856125bd565b818103602083015261211a818461261a565b60405181810167ffffffffffffffff8111828210171561283257600080fd5b604052919050565b600067ffffffffffffffff82111561285157600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b90815260200190565b6000610416826128cf565b151590565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61ffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b600061041682600061041682612893565b82818337506000910152565b60005b83811015612920578181015183820152602001612908565b8381111561292f576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b61296681612893565b811461199757600080fd5b6129668161289e565b61296681611fdf565b612966816128a3565b612966816128c856fea365627a7a7231582082927c55ed80cd2c2b4af3ecca0340c755f0257fadbdd76a4c4b6458f1c8eefc6c6578706572696d656e74616cf564736f6c63430005110040", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101985760003560e01c8063691f3431116100e3578063bc1c58d11161008c578063e59d895d11610066578063e59d895d14610387578063f1cb7e061461039a578063f86bc879146103ad57610198565b8063bc1c58d114610340578063c869023314610353578063d5fa2b001461037457610198565b8063a8fa5682116100bd578063a8fa5682146102fa578063ac9650d81461030d578063ad5780af1461032d57610198565b8063691f3431146102c157806377372213146102d45780638b95dd71146102e757610198565b8063304e6ade116101455780634cbf6ba41161011f5780634cbf6ba41461027b57806359d1d43c1461028e578063623195b0146102ae57610198565b8063304e6ade146102425780633b3b57de146102555780633e9ce7941461026857610198565b8063124a319c11610176578063124a319c146101ee5780632203ab561461020e57806329cd62ea1461022f57610198565b806301ffc9a71461019d5780630af179d7146101c657806310f13a8c146101db575b600080fd5b6101b06101ab366004612504565b6103c0565b6040516101bd9190612730565b60405180910390f35b6101d96101d4366004612364565b61041e565b005b6101d96101e93660046123ba565b61060b565b6102016101fc366004612302565b6106b8565b6040516101bd9190612703565b61022161021c36600461224c565b6109f7565b6040516101bd9291906127f3565b6101d961023d36600461227c565b610b16565b6101d9610250366004612364565b610b96565b610201610263366004612164565b610bf5565b6101d9610276366004612209565b610c2a565b6101b061028936600461224c565b610ccf565b6102a161029c366004612364565b610d01565b6040516101bd9190612787565b6101d96102bc366004612441565b610dc3565b6102a16102cf366004612164565b610e3e565b6101d96102e2366004612364565b610edf565b6101d96102f53660046124a9565b610f3e565b6102a16103083660046122bf565b611003565b61032061031b366004612122565b611090565b6040516101bd919061271f565b6101d961033b366004612164565b6111d4565b6102a161034e366004612164565b611227565b610366610361366004612164565b61128f565b6040516101bd92919061274c565b6101d9610382366004612182565b6112a9565b6101d9610395366004612332565b6112d0565b6102a16103a836600461224c565b61139d565b6101b06103bb3660046121bc565b611446565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f59d1d43c00000000000000000000000000000000000000000000000000000000148061041657506104168261146c565b90505b919050565b82610428816114c2565b61043157600080fd5b60008060608082610440611e30565b61048a60008a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505063ffffffff6115d1169050565b90505b610496816115ec565b6105ae5761ffff86166104ee57806040015195506104b3816115fa565b9350836040516020016104c691906126ec565b6040516020818303038152906040528051906020012091506104e781611621565b92506105a0565b60606104f9826115fa565b9050816040015161ffff168761ffff161415806105235750610521858263ffffffff61164216565b155b1561059e576105778b86898d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505050602087015189518c918290039015611660565b81604001519650816020015195508094508480519060200120925061059b82611621565b93505b505b6105a9816118c7565b61048d565b50825115610600576106008984878b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505088518b9250828f03915015611660565b505050505050505050565b84610615816114c2565b61061e57600080fd5b82826009600089815260200190815260200160002087876040516106439291906126df565b90815260405190819003602001902061065d929091611e7b565b50848460405161066e9291906126df565b6040518091039020867fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a755087876040516106a8929190612775565b60405180910390a3505050505050565b60008281526006602090815260408083207fffffffff000000000000000000000000000000000000000000000000000000008516845290915281205473ffffffffffffffffffffffffffffffffffffffff1680156107175790506109f1565b600061072285610bf5565b905073ffffffffffffffffffffffffffffffffffffffff811661074a576000925050506109f1565b600060608273ffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b60405160240161077d9190612767565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052516107fe91906126ec565b600060405180830381855afa9150503d8060008114610839576040519150601f19603f3d011682016040523d82523d6000602084013e61083e565b606091505b5091509150811580610851575060208151105b8061088d575080601f8151811061086457fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b1561089f5760009450505050506109f1565b8273ffffffffffffffffffffffffffffffffffffffff16866040516024016108c79190612767565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790525161094891906126ec565b600060405180830381855afa9150503d8060008114610983576040519150601f19603f3d011682016040523d82523d6000602084013e610988565b606091505b50909250905081158061099c575060208151105b806109d8575080601f815181106109af57fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109ea5760009450505050506109f1565b5090925050505b92915050565b600082815260208190526040812060609060015b848111610af85780851615801590610a4357506000818152602083905260409020546002600019610100600184161502019091160415155b15610af0576000818152602083815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845284939192839190830182828015610ade5780601f10610ab357610100808354040283529160200191610ade565b820191906000526020600020905b815481529060010190602001808311610ac157829003601f168201915b50505050509050935093505050610b0f565b60011b610a0b565b505060408051602081019091526000808252925090505b9250929050565b82610b20816114c2565b610b2957600080fd5b6040805180820182528481526020808201858152600088815260089092529083902091518255516001909101555184907f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4690610b88908690869061274c565b60405180910390a250505050565b82610ba0816114c2565b610ba957600080fd5b6000848152600260205260409020610bc2908484611e7b565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610b88929190612775565b60006060610c0483603c61139d565b9050805160001415610c1a576000915050610419565b610c238161199a565b9392505050565b6000838152600b602090815260408083203380855290835281842073ffffffffffffffffffffffffffffffffffffffff871680865293529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168515151790555190919085907fe1c5610a6e0cbe10764ecd182adcef1ec338dc4e199c99c32ce98f38e12791df90610cc2908690612730565b60405180910390a4505050565b600091825260056020908152604080842060038352818520548552825280842092845291905290205461ffff16151590565b6060600960008581526020019081526020016000208383604051610d269291906126df565b9081526040805160209281900383018120805460026001821615610100026000190190911604601f81018590048502830185019093528282529092909190830182828015610db55780601f10610d8a57610100808354040283529160200191610db5565b820191906000526020600020905b815481529060010190602001808311610d9857829003601f168201915b505050505090509392505050565b83610dcd816114c2565b610dd657600080fd5b6000198401841615610de757600080fd5b6000858152602081815260408083208784529091529020610e09908484611e7b565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b60008181526007602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610ed35780601f10610ea857610100808354040283529160200191610ed3565b820191906000526020600020905b815481529060010190602001808311610eb657829003601f168201915b50505050509050919050565b82610ee9816114c2565b610ef257600080fd5b6000848152600760205260409020610f0b908484611e7b565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610b88929190612775565b82610f48816114c2565b610f5157600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af7528484604051610f839291906127f3565b60405180910390a2603c831415610fd557837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2610fbf8461199a565b604051610fcc9190612711565b60405180910390a25b600084815260016020908152604080832086845282529091208351610ffc92850190611f17565b5050505050565b6000838152600460209081526040808320600383528184205484528252808320858452825280832061ffff8516845282529182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610db55780601f10610d8a57610100808354040283529160200191610db5565b6040805182815260208084028201019091526060908280156110c657816020015b60608152602001906001900390816110b15790505b50905060005b828110156111cd5760006060308686858181106110e557fe5b6020028201905080357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe13684900301811261111f57600080fd5b9091016020810191503567ffffffffffffffff81111561113e57600080fd5b3681900382131561114e57600080fd5b60405161115c9291906126df565b600060405180830381855af49150503d8060008114611197576040519150601f19603f3d011682016040523d82523d6000602084013e61119c565b606091505b5091509150816111ab57600080fd5b808484815181106111b857fe5b602090810291909101015250506001016110cc565b5092915050565b806111de816114c2565b6111e757600080fd5b600082815260036020526040808220805460010190555183917fb757169b8492ca2f1c6619d9d76ce22803035c3b1d5f6930dffe7b127c1a198391a25050565b600081815260026020818152604092839020805484516001821615610100026000190190911693909304601f81018390048302840183019094528383526060939091830182828015610ed35780601f10610ea857610100808354040283529160200191610ed3565b600090815260086020526040902080546001909101549091565b816112b3816114c2565b6112bc57600080fd5b6112cb83603c6102f5856119c2565b505050565b826112da816114c2565b6112e357600080fd5b60008481526006602090815260408083207fffffffff00000000000000000000000000000000000000000000000000000000871680855292529182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8616179055905185907f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa9061138f908690612703565b60405180910390a350505050565b600082815260016020818152604080842085855282529283902080548451600294821615610100026000190190911693909304601f810183900483028401830190945283835260609390918301828280156114395780601f1061140e57610100808354040283529160200191611439565b820191906000526020600020905b81548152906001019060200180831161141c57829003601f168201915b5050505050905092915050565b600b60209081526000938452604080852082529284528284209052825290205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fc86902330000000000000000000000000000000000000000000000000000000014806104165750610416826119fb565b600a546040517f02571be3000000000000000000000000000000000000000000000000000000008152600091829173ffffffffffffffffffffffffffffffffffffffff909116906302571be39061151d90869060040161273e565b60206040518083038186803b15801561153557600080fd5b505afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061156d91908101906120fc565b905073ffffffffffffffffffffffffffffffffffffffff8116331480610c2357506000838152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452825280832033845290915290205460ff16915050919050565b6115d9611e30565b82815260c081018290526109f1816118c7565b805151602090910151101590565b60208101518151606091610416916116129082611a51565b8451919063ffffffff611a9816565b60a081015160c082015182516060926104169281900363ffffffff611a9816565b600081518351148015610c235750610c238360008460008751611afa565b600087815260036020908152604090912054875191880191909120606061168e87878763ffffffff611a9816565b905083156117a85760008a81526004602090815260408083208684528252808320858452825280832061ffff8c16845290915290205460026000196101006001841615020190911604156117335760008a81526005602090815260408083208684528252808320858452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000811661ffff918216600019019091161790555b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c168452909152812061176991611f85565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a60405161179b929190612798565b60405180910390a26118bb565b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c168452909152902054600260001961010060018416150201909116046118425760008a815260056020908152604080832086845282528083208584529091529020805461ffff808216600101167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00009091161790555b60008a81526004602090815260408083208684528252808320858452825280832061ffff8c1684528252909120825161187d92840190611f17565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a846040516118b2939291906127b8565b60405180910390a25b50505050505050505050565b60c081015160208201819052815151116118e057611997565b60006118f482600001518360200151611a51565b602083015183519101915061190f908263ffffffff611b1d16565b61ffff166040830152815160029190910190611931908263ffffffff611b1d16565b61ffff166060830152815160029190910190611953908263ffffffff611b3d16565b63ffffffff908116608084015282516004929092019160009161197991908490611b1d16565b600283810160a086015261ffff9190911690920190910160c0830152505b50565b600081516014146119aa57600080fd5b50602001516c01000000000000000000000000900490565b6040805160148082528183019092526060916020820181803883395050506c010000000000000000000000009290920260208301525090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f691f3431000000000000000000000000000000000000000000000000000000001480610416575061041682611b5f565b6000815b83518110611a5f57fe5b6000611a71858363ffffffff611bc416565b60ff1691820160010191905080611a885750611a8e565b50611a55565b9190910392915050565b606083518284011115611aaa57600080fd5b6060826040519080825280601f01601f191660200182016040528015611ad7576020820181803883390190505b50905060208082019086860101611aef828287611be2565b509095945050505050565b6000611b07848484611c3e565b611b12878785611c3e565b149695505050505050565b60008251826002011115611b3057600080fd5b50016002015161ffff1690565b60008251826004011115611b5057600080fd5b50016004015163ffffffff1690565b6000604051611b6d906126f8565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610416575061041682611c5a565b6000828281518110611bd257fe5b016020015160f81c905092915050565b5b60208110611c205781518352602092830192909101907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001611be3565b905182516020929092036101000a6000190180199091169116179052565b600083518284011115611c5057600080fd5b5091016020012090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fa8fa568200000000000000000000000000000000000000000000000000000000148061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167fbc1c58d100000000000000000000000000000000000000000000000000000000148061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167f3b3b57de000000000000000000000000000000000000000000000000000000001480611d8f57507fffffffff0000000000000000000000000000000000000000000000000000000082167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b8061041657506104168260007fffffffff0000000000000000000000000000000000000000000000000000000082167f2203ab5600000000000000000000000000000000000000000000000000000000148061041657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610416565b6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611eda578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555611f07565b82800160010185558215611f07579182015b82811115611f07578235825591602001919060010190611eec565b50611f13929150611fc5565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f5857805160ff1916838001178555611f07565b82800160010185558215611f07579182015b82811115611f07578251825591602001919060010190611f6a565b50805460018160011615610100020316600290046000825580601f10611fab5750611997565b601f01602090049060005260206000209081019061199791905b611fdf91905b80821115611f135760008155600101611fcb565b90565b80356109f18161295d565b80516109f18161295d565b60008083601f84011261200a57600080fd5b50813567ffffffffffffffff81111561202257600080fd5b602083019150836020820283011115610b0f57600080fd5b80356109f181612971565b80356109f18161297a565b80356109f181612983565b60008083601f84011261206d57600080fd5b50813567ffffffffffffffff81111561208557600080fd5b602083019150836001820283011115610b0f57600080fd5b600082601f8301126120ae57600080fd5b81356120c16120bc8261283a565b612813565b915080825260208301602083018583830111156120dd57600080fd5b6120e88382846128f9565b50505092915050565b80356109f18161298c565b60006020828403121561210e57600080fd5b600061211a8484611fed565b949350505050565b6000806020838503121561213557600080fd5b823567ffffffffffffffff81111561214c57600080fd5b61215885828601611ff8565b92509250509250929050565b60006020828403121561217657600080fd5b600061211a8484612045565b6000806040838503121561219557600080fd5b60006121a18585612045565b92505060206121b285828601611fe2565b9150509250929050565b6000806000606084860312156121d157600080fd5b60006121dd8686612045565b93505060206121ee86828701611fe2565b92505060406121ff86828701611fe2565b9150509250925092565b60008060006060848603121561221e57600080fd5b600061222a8686612045565b935050602061223b86828701611fe2565b92505060406121ff8682870161203a565b6000806040838503121561225f57600080fd5b600061226b8585612045565b92505060206121b285828601612045565b60008060006060848603121561229157600080fd5b600061229d8686612045565b93505060206122ae86828701612045565b92505060406121ff86828701612045565b6000806000606084860312156122d457600080fd5b60006122e08686612045565b93505060206122f186828701612045565b92505060406121ff868287016120f1565b6000806040838503121561231557600080fd5b60006123218585612045565b92505060206121b285828601612050565b60008060006060848603121561234757600080fd5b60006123538686612045565b93505060206121ee86828701612050565b60008060006040848603121561237957600080fd5b60006123858686612045565b935050602084013567ffffffffffffffff8111156123a257600080fd5b6123ae8682870161205b565b92509250509250925092565b6000806000806000606086880312156123d257600080fd5b60006123de8888612045565b955050602086013567ffffffffffffffff8111156123fb57600080fd5b6124078882890161205b565b9450945050604086013567ffffffffffffffff81111561242657600080fd5b6124328882890161205b565b92509250509295509295909350565b6000806000806060858703121561245757600080fd5b60006124638787612045565b945050602061247487828801612045565b935050604085013567ffffffffffffffff81111561249157600080fd5b61249d8782880161205b565b95989497509550505050565b6000806000606084860312156124be57600080fd5b60006124ca8686612045565b93505060206124db86828701612045565b925050604084013567ffffffffffffffff8111156124f857600080fd5b6121ff8682870161209d565b60006020828403121561251657600080fd5b600061211a8484612050565b6000610c23838361261a565b612537816128e8565b82525050565b61253781612893565b600061255182612886565b61255b818561288a565b93508360208202850161256d85612880565b8060005b858110156125a7578484038952815161258a8582612522565b945061259583612880565b60209a909a0199925050600101612571565b5091979650505050505050565b6125378161289e565b61253781611fdf565b612537816128a3565b60006125db838561288a565b93506125e88385846128f9565b6125f183612935565b9093019392505050565b60006126078385610419565b93506126148385846128f9565b50500190565b600061262582612886565b61262f818561288a565b935061263f818560208601612905565b6125f181612935565b600061265382612886565b61265d8185610419565b935061266d818560208601612905565b9290920192915050565b6000612684602483610419565b7f696e74657266616365496d706c656d656e74657228627974657333322c62797481527f6573342900000000000000000000000000000000000000000000000000000000602082015260240192915050565b612537816128c8565b600061211a8284866125fb565b6000610c238284612648565b60006109f182612677565b602081016109f1828461253d565b602081016109f1828461252e565b60208082528101610c238184612546565b602081016109f182846125b4565b602081016109f182846125bd565b6040810161275a82856125bd565b610c2360208301846125bd565b602081016109f182846125c6565b6020808252810161211a8184866125cf565b60208082528101610c23818461261a565b604080825281016127a9818561261a565b9050610c2360208301846126d6565b606080825281016127c9818661261a565b90506127d860208301856126d6565b81810360408301526127ea818461261a565b95945050505050565b6040810161280182856125bd565b818103602083015261211a818461261a565b60405181810167ffffffffffffffff8111828210171561283257600080fd5b604052919050565b600067ffffffffffffffff82111561285157600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b90815260200190565b6000610416826128cf565b151590565b7fffffffff000000000000000000000000000000000000000000000000000000001690565b61ffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b600061041682600061041682612893565b82818337506000910152565b60005b83811015612920578181015183820152602001612908565b8381111561292f576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b61296681612893565b811461199757600080fd5b6129668161289e565b61296681611fdf565b612966816128a3565b612966816128c856fea365627a7a7231582082927c55ed80cd2c2b4af3ecca0340c755f0257fadbdd76a4c4b6458f1c8eefc6c6578706572696d656e74616cf564736f6c63430005110040" +} \ No newline at end of file diff --git a/deployments/sepolia/NameWrapper.json b/deployments/sepolia/NameWrapper.json new file mode 100644 index 00000000..93067682 --- /dev/null +++ b/deployments/sepolia/NameWrapper.json @@ -0,0 +1,2026 @@ +{ + "address": "0x0635513f179D50A207757E05759CbD106d7dFcE8", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + }, + { + "internalType": "contract IBaseRegistrar", + "name": "_registrar", + "type": "address" + }, + { + "internalType": "contract IMetadataService", + "name": "_metadataService", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CannotUpgrade", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "IncorrectTargetOwner", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectTokenType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "labelHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "expectedLabelhash", + "type": "bytes32" + } + ], + "name": "LabelMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "LabelTooLong", + "type": "error" + }, + { + "inputs": [], + "name": "LabelTooShort", + "type": "error" + }, + { + "inputs": [], + "name": "NameIsNotWrapped", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "OperationProhibited", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Unauthorised", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ControllerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "ExpiryExtended", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + } + ], + "name": "FusesSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "NameUnwrapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "NameWrapped", + "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": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "_tokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fuseMask", + "type": "uint32" + } + ], + "name": "allFusesBurned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "canExtendSubnames", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "canModifyName", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "controllers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ens", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "labelhash", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "extendExpiry", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "getData", + "outputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "labelhash", + "type": "bytes32" + } + ], + "name": "isWrapped", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "isWrapped", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "metadataService", + "outputs": [ + { + "internalType": "contract IMetadataService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "names", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint16", + "name": "ownerControlledFuses", + "type": "uint16" + } + ], + "name": "registerAndWrapETH2LD", + "outputs": [ + { + "internalType": "uint256", + "name": "registrarExpiry", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "registrar", + "outputs": [ + { + "internalType": "contract IBaseRegistrar", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "renew", + "outputs": [ + { + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "labelhash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "setChildFuses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "ownerControlledFuses", + "type": "uint16" + } + ], + "name": "setFuses", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IMetadataService", + "name": "_metadataService", + "type": "address" + } + ], + "name": "setMetadataService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "setSubnodeOwner", + "outputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "setSubnodeRecord", + "outputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + } + ], + "name": "setTTL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract INameWrapperUpgrade", + "name": "_upgradeAddress", + "type": "address" + } + ], + "name": "setUpgradeContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "labelhash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "unwrap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "labelhash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "registrant", + "type": "address" + }, + { + "internalType": "address", + "name": "controller", + "type": "address" + } + ], + "name": "unwrapETH2LD", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "upgradeContract", + "outputs": [ + { + "internalType": "contract INameWrapperUpgrade", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "wrap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "uint16", + "name": "ownerControlledFuses", + "type": "uint16" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "wrapETH2LD", + "outputs": [ + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x60f94207da794ed2a42bef84ad3ffbe39aab7a08501fc6cc35b9bddacb182144", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x0635513f179D50A207757E05759CbD106d7dFcE8", + "transactionIndex": 62, + "gasUsed": "5487360", + "logsBloom": "0x00001000000000400000000000000000000000000000200000800000000004000000000000000000100000000000000000000000000010000000000000000000000000000000000000000000008000000001000000000000100000000000000000000000020000000000000004000800000000000000000000001000000000400000010000000000000000000000000000000000000010200000000000000000000000000000040000000019000000000000000000000000008000240000000080000000000000000002000000005040000000000000000020000000000020000000000000000000000020000100000000000000001000000000000008000000", + "blockHash": "0xa14ab7b389c1fa6e5c0635638d9aed3123472664c873a1296a4c3ce8cc5c6839", + "transactionHash": "0x60f94207da794ed2a42bef84ad3ffbe39aab7a08501fc6cc35b9bddacb182144", + "logs": [ + { + "transactionIndex": 62, + "blockNumber": 3790153, + "transactionHash": "0x60f94207da794ed2a42bef84ad3ffbe39aab7a08501fc6cc35b9bddacb182144", + "address": "0x0635513f179D50A207757E05759CbD106d7dFcE8", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 94, + "blockHash": "0xa14ab7b389c1fa6e5c0635638d9aed3123472664c873a1296a4c3ce8cc5c6839" + }, + { + "transactionIndex": 62, + "blockNumber": 3790153, + "transactionHash": "0x60f94207da794ed2a42bef84ad3ffbe39aab7a08501fc6cc35b9bddacb182144", + "address": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "topics": [ + "0x6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e92", + "0x0000000000000000000000000635513f179d50a207757e05759cbd106d7dfce8", + "0x4ef5377426f026cf8bf8e26532753941a1216caa1729302267b8c57117310271" + ], + "data": "0x", + "logIndex": 95, + "blockHash": "0xa14ab7b389c1fa6e5c0635638d9aed3123472664c873a1296a4c3ce8cc5c6839" + }, + { + "transactionIndex": 62, + "blockNumber": 3790153, + "transactionHash": "0x60f94207da794ed2a42bef84ad3ffbe39aab7a08501fc6cc35b9bddacb182144", + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "topics": [ + "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", + "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2", + "0x3b2f093329dda9e8020bdae7615b2d0825e7b39a6b72263a3119df90765c2f95" + ], + "data": "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "logIndex": 96, + "blockHash": "0xa14ab7b389c1fa6e5c0635638d9aed3123472664c873a1296a4c3ce8cc5c6839" + } + ], + "blockNumber": 3790153, + "cumulativeGasUsed": "20337800", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "0x2e9736e109a2745628a5915983f8d9172414f1ac" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"},{\"internalType\":\"contract IBaseRegistrar\",\"name\":\"_registrar\",\"type\":\"address\"},{\"internalType\":\"contract IMetadataService\",\"name\":\"_metadataService\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotUpgrade\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncompatibleParent\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"IncorrectTargetOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IncorrectTokenType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"labelHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"expectedLabelhash\",\"type\":\"bytes32\"}],\"name\":\"LabelMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"}],\"name\":\"LabelTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LabelTooShort\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NameIsNotWrapped\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"OperationProhibited\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"Unauthorised\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"}],\"name\":\"ControllerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"ExpiryExtended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"}],\"name\":\"FusesSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"NameUnwrapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"NameWrapped\",\"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\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_tokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"fuseMask\",\"type\":\"uint32\"}],\"name\":\"allFusesBurned\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"canExtendSubnames\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"canModifyName\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"controllers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"labelhash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"extendExpiry\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getData\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"labelhash\",\"type\":\"bytes32\"}],\"name\":\"isWrapped\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"isWrapped\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"metadataService\",\"outputs\":[{\"internalType\":\"contract IMetadataService\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"names\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"recoverFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"ownerControlledFuses\",\"type\":\"uint16\"}],\"name\":\"registerAndWrapETH2LD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"registrarExpiry\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registrar\",\"outputs\":[{\"internalType\":\"contract IBaseRegistrar\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"renew\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expires\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"labelhash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"setChildFuses\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"}],\"name\":\"setController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint16\",\"name\":\"ownerControlledFuses\",\"type\":\"uint16\"}],\"name\":\"setFuses\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IMetadataService\",\"name\":\"_metadataService\",\"type\":\"address\"}],\"name\":\"setMetadataService\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"setRecord\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"setSubnodeOwner\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"ttl\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"setSubnodeRecord\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"setTTL\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract INameWrapperUpgrade\",\"name\":\"_upgradeAddress\",\"type\":\"address\"}],\"name\":\"setUpgradeContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"labelhash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"unwrap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"labelhash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"registrant\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"unwrapETH2LD\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upgradeContract\",\"outputs\":[{\"internalType\":\"contract INameWrapperUpgrade\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"wrap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"ownerControlledFuses\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"wrapETH2LD\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allFusesBurned(bytes32,uint32)\":{\"params\":{\"fuseMask\":\"The fuses you want to check\",\"node\":\"Namehash of the name\"},\"returns\":{\"_0\":\"Boolean of whether or not all the selected fuses are burned\"}},\"approve(address,uint256)\":{\"params\":{\"to\":\"address to approve\",\"tokenId\":\"name to approve\"}},\"balanceOf(address,uint256)\":{\"details\":\"See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.\"},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"canExtendSubnames(bytes32,address)\":{\"params\":{\"addr\":\"which address to check permissions for\",\"node\":\"namehash of the name to check\"},\"returns\":{\"_0\":\"whether or not is owner/operator or approved\"}},\"canModifyName(bytes32,address)\":{\"params\":{\"addr\":\"which address to check permissions for\",\"node\":\"namehash of the name to check\"},\"returns\":{\"_0\":\"whether or not is owner or operator\"}},\"extendExpiry(bytes32,bytes32,uint64)\":{\"params\":{\"expiry\":\"When the name will expire in seconds since the Unix epoch\",\"labelhash\":\"Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\",\"parentNode\":\"Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\"},\"returns\":{\"_0\":\"New expiry\"}},\"getApproved(uint256)\":{\"params\":{\"id\":\"Namehash of the name\"},\"returns\":{\"operator\":\"Approved operator of a name\"}},\"getData(uint256)\":{\"params\":{\"id\":\"Namehash of the name\"},\"returns\":{\"expiry\":\"Expiry of the name\",\"fuses\":\"Fuses of the name\",\"owner\":\"Owner of the name\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC1155-isApprovedForAll}.\"},\"isWrapped(bytes32)\":{\"params\":{\"node\":\"Namehash of the name\"},\"returns\":{\"_0\":\"Boolean of whether or not the name is wrapped\"}},\"isWrapped(bytes32,bytes32)\":{\"params\":{\"labelhash\":\"Namehash of the name\",\"parentNode\":\"Namehash of the name\"},\"returns\":{\"_0\":\"Boolean of whether or not the name is wrapped\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"params\":{\"id\":\"Label as a string of the .eth domain to wrap\"},\"returns\":{\"owner\":\"The owner of the name\"}},\"recoverFunds(address,address,uint256)\":{\"details\":\"The contract is Ownable and only the owner can call the recover function.\",\"params\":{\"_amount\":\"The amount of tokens to recover.\",\"_to\":\"The address to send the tokens to.\",\"_token\":\"The address of the ERC20 token to recover\"}},\"registerAndWrapETH2LD(string,address,uint256,address,uint16)\":{\"details\":\"Registers a new .eth second-level domain and wraps it. Only callable by authorised controllers.\",\"params\":{\"duration\":\"The duration, in seconds, to register the name for.\",\"label\":\"The label to register (Eg, 'foo' for 'foo.eth').\",\"ownerControlledFuses\":\"Initial owner-controlled fuses to set\",\"resolver\":\"The resolver address to set on the ENS registry (optional).\",\"wrappedOwner\":\"The owner of the wrapped name.\"},\"returns\":{\"registrarExpiry\":\"The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch.\"}},\"renew(uint256,uint256)\":{\"details\":\"Only callable by authorised controllers.\",\"params\":{\"duration\":\"The number of seconds to renew the name for.\",\"tokenId\":\"The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth').\"},\"returns\":{\"expires\":\"The expiry date of the name on the .eth registrar, in seconds since the Unix epoch.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC1155-setApprovalForAll}.\"},\"setChildFuses(bytes32,bytes32,uint32,uint64)\":{\"params\":{\"expiry\":\"When the name will expire in seconds since the Unix epoch\",\"fuses\":\"Fuses to burn\",\"labelhash\":\"Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\",\"parentNode\":\"Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\"}},\"setFuses(bytes32,uint16)\":{\"params\":{\"node\":\"Namehash of the name\",\"ownerControlledFuses\":\"Owner-controlled fuses to burn\"},\"returns\":{\"_0\":\"Old fuses\"}},\"setMetadataService(address)\":{\"params\":{\"_metadataService\":\"The new metadata service\"}},\"setRecord(bytes32,address,address,uint64)\":{\"params\":{\"node\":\"Namehash of the name to set a record for\",\"owner\":\"New owner in the registry\",\"resolver\":\"Resolver contract\",\"ttl\":\"Time to live in the registry\"}},\"setResolver(bytes32,address)\":{\"params\":{\"node\":\"namehash of the name\",\"resolver\":\"the resolver contract\"}},\"setSubnodeOwner(bytes32,string,address,uint32,uint64)\":{\"params\":{\"expiry\":\"When the name will expire in seconds since the Unix epoch\",\"fuses\":\"Initial fuses for the wrapped subdomain\",\"label\":\"Label of the subdomain as a string\",\"owner\":\"New owner in the wrapper\",\"parentNode\":\"Parent namehash of the subdomain\"},\"returns\":{\"node\":\"Namehash of the subdomain\"}},\"setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)\":{\"params\":{\"expiry\":\"When the name will expire in seconds since the Unix epoch\",\"fuses\":\"initial fuses for the wrapped subdomain\",\"label\":\"label of the subdomain as a string\",\"owner\":\"new owner in the wrapper\",\"parentNode\":\"parent namehash of the subdomain\",\"resolver\":\"resolver contract in the registry\",\"ttl\":\"ttl in the registry\"},\"returns\":{\"node\":\"Namehash of the subdomain\"}},\"setTTL(bytes32,uint64)\":{\"params\":{\"node\":\"Namehash of the name\",\"ttl\":\"TTL in the registry\"}},\"setUpgradeContract(address)\":{\"details\":\"The default value of upgradeContract is the 0 address. Use the 0 address at any time to make the contract not upgradable.\",\"params\":{\"_upgradeAddress\":\"address of an upgraded contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unwrap(bytes32,bytes32,address)\":{\"details\":\"Can be called by the owner in the wrapper or an authorised caller in the wrapper\",\"params\":{\"controller\":\"Sets the owner in the registry to this address\",\"labelhash\":\"Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\",\"parentNode\":\"Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\"}},\"unwrapETH2LD(bytes32,address,address)\":{\"details\":\"Can be called by the owner in the wrapper or an authorised caller in the wrapper\",\"params\":{\"controller\":\"Sets the owner in the registry to this address\",\"labelhash\":\"Labelhash of the .eth domain\",\"registrant\":\"Sets the owner in the .eth registrar to this address\"}},\"upgrade(bytes,bytes)\":{\"details\":\"Can be called by the owner or an authorised caller\",\"params\":{\"extraData\":\"Extra data to pass to the upgrade contract\",\"name\":\"The name to upgrade, in DNS format\"}},\"uri(uint256)\":{\"params\":{\"tokenId\":\"The id of the token\"},\"returns\":{\"_0\":\"string uri of the metadata service\"}},\"wrap(bytes,address,address)\":{\"details\":\"Can be called by the owner in the registry or an authorised caller in the registry\",\"params\":{\"name\":\"The name to wrap, in DNS format\",\"resolver\":\"Resolver contract\",\"wrappedOwner\":\"Owner of the name in this contract\"}},\"wrapETH2LD(string,address,uint16,address)\":{\"details\":\"Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar\",\"params\":{\"label\":\"Label as a string of the .eth domain to wrap\",\"ownerControlledFuses\":\"Initial owner-controlled fuses to set\",\"resolver\":\"Resolver contract address\",\"wrappedOwner\":\"Owner of the name in this contract\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"allFusesBurned(bytes32,uint32)\":{\"notice\":\"Checks all Fuses in the mask are burned for the node\"},\"approve(address,uint256)\":{\"notice\":\"Approves an address for a name\"},\"canExtendSubnames(bytes32,address)\":{\"notice\":\"Checks if owner/operator or approved by owner\"},\"canModifyName(bytes32,address)\":{\"notice\":\"Checks if owner or operator of the owner\"},\"extendExpiry(bytes32,bytes32,uint64)\":{\"notice\":\"Extends expiry for a name\"},\"getApproved(uint256)\":{\"notice\":\"Gets the owner of a name\"},\"getData(uint256)\":{\"notice\":\"Gets the data for a name\"},\"isWrapped(bytes32)\":{\"notice\":\"Checks if a name is wrapped\"},\"isWrapped(bytes32,bytes32)\":{\"notice\":\"Checks if a name is wrapped in a more gas efficient way\"},\"ownerOf(uint256)\":{\"notice\":\"Gets the owner of a name\"},\"recoverFunds(address,address,uint256)\":{\"notice\":\"Recover ERC20 tokens sent to the contract by mistake.\"},\"renew(uint256,uint256)\":{\"notice\":\"Renews a .eth second-level domain.\"},\"setChildFuses(bytes32,bytes32,uint32,uint64)\":{\"notice\":\"Sets fuses of a name that you own the parent of\"},\"setFuses(bytes32,uint16)\":{\"notice\":\"Sets fuses of a name\"},\"setMetadataService(address)\":{\"notice\":\"Set the metadata service. Only the owner can do this\"},\"setRecord(bytes32,address,address,uint64)\":{\"notice\":\"Sets records for the name in the ENS Registry\"},\"setResolver(bytes32,address)\":{\"notice\":\"Sets resolver contract in the registry\"},\"setSubnodeOwner(bytes32,string,address,uint32,uint64)\":{\"notice\":\"Sets the subdomain owner in the registry and then wraps the subdomain\"},\"setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)\":{\"notice\":\"Sets the subdomain owner in the registry with records and then wraps the subdomain\"},\"setTTL(bytes32,uint64)\":{\"notice\":\"Sets TTL in the registry\"},\"setUpgradeContract(address)\":{\"notice\":\"Set the address of the upgradeContract of the contract. only admin can do this\"},\"unwrap(bytes32,bytes32,address)\":{\"notice\":\"Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\"},\"unwrapETH2LD(bytes32,address,address)\":{\"notice\":\"Unwraps a .eth domain. e.g. vitalik.eth\"},\"upgrade(bytes,bytes)\":{\"notice\":\"Upgrades a domain of any kind. Could be a .eth name vitalik.eth, a DNSSEC name vitalik.xyz, or a subdomain\"},\"uri(uint256)\":{\"notice\":\"Get the metadata uri\"},\"wrap(bytes,address,address)\":{\"notice\":\"Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\"},\"wrapETH2LD(string,address,uint16,address)\":{\"notice\":\"Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrapper/NameWrapper.sol\":\"NameWrapper\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/reverseRegistrar/IReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface IReverseRegistrar {\\n function setDefaultResolver(address resolver) external;\\n\\n function claim(address owner) external returns (bytes32);\\n\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function setName(string memory name) external returns (bytes32);\\n\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) external returns (bytes32);\\n\\n function node(address addr) external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0x83adfcf6da72b1bcd1e3ac387afe5fc7fdf7f2ac28b7601544d2ca4b9d45d159\"},\"contracts/reverseRegistrar/ReverseClaimer.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IReverseRegistrar} from \\\"../reverseRegistrar/IReverseRegistrar.sol\\\";\\n\\ncontract ReverseClaimer {\\n bytes32 constant ADDR_REVERSE_NODE =\\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n constructor(ENS ens, address claimant) {\\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\\n ens.owner(ADDR_REVERSE_NODE)\\n );\\n reverseRegistrar.claim(claimant);\\n }\\n}\\n\",\"keccak256\":\"0x78a28627241535b595f6fff476a1fa7acc90c80684fe7784734920fc8af6fc22\",\"license\":\"MIT\"},\"contracts/utils/ERC20Recoverable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.\\n */\\n\\ncontract ERC20Recoverable is Ownable {\\n /**\\n @notice Recover ERC20 tokens sent to the contract by mistake.\\n @dev The contract is Ownable and only the owner can call the recover function.\\n @param _to The address to send the tokens to.\\n@param _token The address of the ERC20 token to recover\\n @param _amount The amount of tokens to recover.\\n */\\n function recoverFunds(\\n address _token,\\n address _to,\\n uint256 _amount\\n ) external onlyOwner {\\n IERC20(_token).transfer(_to, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x793a38091e1f81499a29ddba82c2b2f3cdd07071b81a832886e8e02a45ff352a\",\"license\":\"MIT\"},\"contracts/wrapper/BytesUtils.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nlibrary BytesUtils {\\n /*\\n * @dev Returns the keccak-256 hash of a byte range.\\n * @param self The byte string to hash.\\n * @param offset The position to start hashing at.\\n * @param len The number of bytes to hash.\\n * @return The hash of the byte range.\\n */\\n function keccak(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(offset + len <= self.length);\\n assembly {\\n ret := keccak256(add(add(self, 32), offset), len)\\n }\\n }\\n\\n /**\\n * @dev Returns the ENS namehash of a DNS-encoded name.\\n * @param self The DNS-encoded name to hash.\\n * @param offset The offset at which to start hashing.\\n * @return The namehash of the name.\\n */\\n function namehash(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (bytes32) {\\n (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);\\n if (labelhash == bytes32(0)) {\\n require(offset == self.length - 1, \\\"namehash: Junk at end of name\\\");\\n return bytes32(0);\\n }\\n return\\n keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));\\n }\\n\\n /**\\n * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.\\n * @param self The byte string to read a label from.\\n * @param idx The index to read a label at.\\n * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.\\n * @return newIdx The index of the start of the next label.\\n */\\n function readLabel(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes32 labelhash, uint256 newIdx) {\\n require(idx < self.length, \\\"readLabel: Index out of bounds\\\");\\n uint256 len = uint256(uint8(self[idx]));\\n if (len > 0) {\\n labelhash = keccak(self, idx + 1, len);\\n } else {\\n labelhash = bytes32(0);\\n }\\n newIdx = idx + len + 1;\\n }\\n}\\n\",\"keccak256\":\"0xf862cd86d749158a554e3cb517efa9097331ec0cf7225117f21e96fb50c67edb\",\"license\":\"MIT\"},\"contracts/wrapper/Controllable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool active);\\n\\n function setController(address controller, bool active) public onlyOwner {\\n controllers[controller] = active;\\n emit ControllerChanged(controller, active);\\n }\\n\\n modifier onlyController() {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x9a9191656a82eda6763cda29ce893ddbfddb6c43559ff3b90c00a184e14e1fa1\",\"license\":\"MIT\"},\"contracts/wrapper/ERC1155Fuse.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\n/* This contract is a variation on ERC1155 with the additions of _setData, getData and _beforeTransfer and ownerOf. _setData and getData allows the use of the other 96 bits next to the address of the owner for extra data. We use this to store 'fuses' that control permissions that can be burnt. 32 bits are used for the fuses themselves and 64 bits are used for the expiry of the name. When a name has expired, its fuses will be be set back to 0 */\\n\\nabstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(\\n address indexed owner,\\n address indexed approved,\\n uint256 indexed tokenId\\n );\\n mapping(uint256 => uint256) public _tokens;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n // Mapping from token ID to approved address\\n mapping(uint256 => address) internal _tokenApprovals;\\n\\n /**************************************************************************\\n * ERC721 methods\\n *************************************************************************/\\n\\n function ownerOf(uint256 id) public view virtual returns (address) {\\n (address owner, , ) = getData(id);\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n address owner = ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(\\n uint256 tokenId\\n ) public view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override returns (uint256) {\\n require(\\n account != address(0),\\n \\\"ERC1155: balance query for the zero address\\\"\\n );\\n address owner = ownerOf(id);\\n if (owner == account) {\\n return 1;\\n }\\n return 0;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(\\n address[] memory accounts,\\n uint256[] memory ids\\n ) public view virtual override returns (uint256[] memory) {\\n require(\\n accounts.length == ids.length,\\n \\\"ERC1155: accounts and ids length mismatch\\\"\\n );\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(\\n address operator,\\n bool approved\\n ) public virtual override {\\n require(\\n msg.sender != operator,\\n \\\"ERC1155: setting approval status for self\\\"\\n );\\n\\n _operatorApprovals[msg.sender][operator] = approved;\\n emit ApprovalForAll(msg.sender, operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev Returns the Name's owner address and fuses\\n */\\n function getData(\\n uint256 tokenId\\n ) public view virtual returns (address owner, uint32 fuses, uint64 expiry) {\\n uint256 t = _tokens[tokenId];\\n owner = address(uint160(t));\\n expiry = uint64(t >> 192);\\n fuses = uint32(t >> 160);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n require(\\n from == msg.sender || isApprovedForAll(from, msg.sender),\\n \\\"ERC1155: caller is not owner nor approved\\\"\\n );\\n\\n _transfer(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n ids.length == amounts.length,\\n \\\"ERC1155: ids and amounts length mismatch\\\"\\n );\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n require(\\n from == msg.sender || isApprovedForAll(from, msg.sender),\\n \\\"ERC1155: transfer caller is not owner nor approved\\\"\\n );\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\\n\\n _beforeTransfer(id, fuses, expiry);\\n\\n require(\\n amount == 1 && oldOwner == from,\\n \\\"ERC1155: insufficient balance for transfer\\\"\\n );\\n _setData(id, to, fuses, expiry);\\n }\\n\\n emit TransferBatch(msg.sender, from, to, ids, amounts);\\n\\n _doSafeBatchTransferAcceptanceCheck(\\n msg.sender,\\n from,\\n to,\\n ids,\\n amounts,\\n data\\n );\\n }\\n\\n /**************************************************************************\\n * Internal/private methods\\n *************************************************************************/\\n\\n /**\\n * @dev Sets the Name's owner address and fuses\\n */\\n function _setData(\\n uint256 tokenId,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal virtual {\\n _tokens[tokenId] =\\n uint256(uint160(owner)) |\\n (uint256(fuses) << 160) |\\n (uint256(expiry) << 192);\\n }\\n\\n function _beforeTransfer(\\n uint256 id,\\n uint32 fuses,\\n uint64 expiry\\n ) internal virtual;\\n\\n function _clearOwnerAndFuses(\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal virtual returns (address, uint32);\\n\\n function _mint(\\n bytes32 node,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal virtual {\\n uint256 tokenId = uint256(node);\\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n\\n uint32 parentControlledFuses = (uint32(type(uint16).max) << 16) &\\n oldFuses;\\n\\n if (oldExpiry > expiry) {\\n expiry = oldExpiry;\\n }\\n\\n if (oldExpiry >= block.timestamp) {\\n fuses = fuses | parentControlledFuses;\\n }\\n\\n require(oldOwner == address(0), \\\"ERC1155: mint of existing token\\\");\\n require(owner != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(\\n owner != address(this),\\n \\\"ERC1155: newOwner cannot be the NameWrapper contract\\\"\\n );\\n\\n _setData(tokenId, owner, fuses, expiry);\\n emit TransferSingle(msg.sender, address(0x0), owner, tokenId, 1);\\n _doSafeTransferAcceptanceCheck(\\n msg.sender,\\n address(0),\\n owner,\\n tokenId,\\n 1,\\n \\\"\\\"\\n );\\n }\\n\\n function _burn(uint256 tokenId) internal virtual {\\n (address oldOwner, uint32 fuses, uint64 expiry) = ERC1155Fuse.getData(\\n tokenId\\n );\\n (, fuses) = _clearOwnerAndFuses(oldOwner, fuses, expiry);\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n // Fuses and expiry are kept on burn\\n _setData(tokenId, address(0x0), fuses, expiry);\\n emit TransferSingle(msg.sender, oldOwner, address(0x0), tokenId, 1);\\n }\\n\\n function _transfer(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal {\\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\\n\\n _beforeTransfer(id, fuses, expiry);\\n\\n require(\\n amount == 1 && oldOwner == from,\\n \\\"ERC1155: insufficient balance for transfer\\\"\\n );\\n\\n if (oldOwner == to) {\\n return;\\n }\\n\\n _setData(id, to, fuses, expiry);\\n\\n emit TransferSingle(msg.sender, from, to, id, amount);\\n\\n _doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);\\n }\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try\\n IERC1155Receiver(to).onERC1155Received(\\n operator,\\n from,\\n id,\\n amount,\\n data\\n )\\n returns (bytes4 response) {\\n if (\\n response != IERC1155Receiver(to).onERC1155Received.selector\\n ) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try\\n IERC1155Receiver(to).onERC1155BatchReceived(\\n operator,\\n from,\\n ids,\\n amounts,\\n data\\n )\\n returns (bytes4 response) {\\n if (\\n response !=\\n IERC1155Receiver(to).onERC1155BatchReceived.selector\\n ) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n /* ERC721 internal functions */\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ownerOf(tokenId), to, tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xfbbd36e7f5df0fe7a8e9199783af99ac61ab24122e4a9fdb072bbd4cd676a88b\",\"license\":\"MIT\"},\"contracts/wrapper/IMetadataService.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface IMetadataService {\\n function uri(uint256) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xb3f1cf6df01ed7b15e5f2318f6823afbdb586ca38c2124c67955c645647ae9a2\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"./IMetadataService.sol\\\";\\nimport \\\"./INameWrapperUpgrade.sol\\\";\\n\\nuint32 constant CANNOT_UNWRAP = 1;\\nuint32 constant CANNOT_BURN_FUSES = 2;\\nuint32 constant CANNOT_TRANSFER = 4;\\nuint32 constant CANNOT_SET_RESOLVER = 8;\\nuint32 constant CANNOT_SET_TTL = 16;\\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\\nuint32 constant CANNOT_APPROVE = 64;\\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\\nuint32 constant IS_DOT_ETH = 1 << 17;\\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\\n// all fuses apart from IS_DOT_ETH\\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\\n\\ninterface INameWrapper is IERC1155 {\\n event NameWrapped(\\n bytes32 indexed node,\\n bytes name,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n );\\n\\n event NameUnwrapped(bytes32 indexed node, address owner);\\n\\n event FusesSet(bytes32 indexed node, uint32 fuses);\\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\\n\\n function ens() external view returns (ENS);\\n\\n function registrar() external view returns (IBaseRegistrar);\\n\\n function metadataService() external view returns (IMetadataService);\\n\\n function names(bytes32) external view returns (bytes memory);\\n\\n function name() external view returns (string memory);\\n\\n function upgradeContract() external view returns (INameWrapperUpgrade);\\n\\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\\n\\n function wrap(\\n bytes calldata name,\\n address wrappedOwner,\\n address resolver\\n ) external;\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) external returns (uint64 expires);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint16 ownerControlledFuses\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration\\n ) external returns (uint256 expires);\\n\\n function unwrap(bytes32 node, bytes32 label, address owner) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function upgrade(bytes calldata name, bytes calldata extraData) external;\\n\\n function setFuses(\\n bytes32 node,\\n uint16 ownerControlledFuses\\n ) external returns (uint32 newFuses);\\n\\n function setChildFuses(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint32 fuses,\\n uint64 expiry\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n string calldata label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n string calldata label,\\n address newOwner,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function extendExpiry(\\n bytes32 node,\\n bytes32 labelhash,\\n uint64 expiry\\n ) external returns (uint64);\\n\\n function canModifyName(\\n bytes32 node,\\n address addr\\n ) external view returns (bool);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function ownerOf(uint256 id) external view returns (address owner);\\n\\n function approve(address to, uint256 tokenId) external;\\n\\n function getApproved(uint256 tokenId) external view returns (address);\\n\\n function getData(\\n uint256 id\\n ) external view returns (address, uint32, uint64);\\n\\n function setMetadataService(IMetadataService _metadataService) external;\\n\\n function uri(uint256 tokenId) external view returns (string memory);\\n\\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\\n\\n function allFusesBurned(\\n bytes32 node,\\n uint32 fuseMask\\n ) external view returns (bool);\\n\\n function isWrapped(bytes32) external view returns (bool);\\n\\n function isWrapped(bytes32, bytes32) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x70310eb67146d7290731c31841399640ac3b6a949eadc6598bc150123d185c57\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapperUpgrade.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface INameWrapperUpgrade {\\n function wrapFromUpgrade(\\n bytes calldata name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address approved,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x42e0cec6cd9d1a62d51d45b678f69d3e4ad5555e659b197e41257b308346bb8a\",\"license\":\"MIT\"},\"contracts/wrapper/NameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport {ERC1155Fuse, IERC165, IERC1155MetadataURI} from \\\"./ERC1155Fuse.sol\\\";\\nimport {Controllable} from \\\"./Controllable.sol\\\";\\nimport {INameWrapper, CANNOT_UNWRAP, CANNOT_BURN_FUSES, CANNOT_TRANSFER, CANNOT_SET_RESOLVER, CANNOT_SET_TTL, CANNOT_CREATE_SUBDOMAIN, CANNOT_APPROVE, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING, IS_DOT_ETH, CAN_EXTEND_EXPIRY, PARENT_CONTROLLED_FUSES, USER_SETTABLE_FUSES} from \\\"./INameWrapper.sol\\\";\\nimport {INameWrapperUpgrade} from \\\"./INameWrapperUpgrade.sol\\\";\\nimport {IMetadataService} from \\\"./IMetadataService.sol\\\";\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IReverseRegistrar} from \\\"../reverseRegistrar/IReverseRegistrar.sol\\\";\\nimport {ReverseClaimer} from \\\"../reverseRegistrar/ReverseClaimer.sol\\\";\\nimport {IBaseRegistrar} from \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport {IERC721Receiver} from \\\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {BytesUtils} from \\\"./BytesUtils.sol\\\";\\nimport {ERC20Recoverable} from \\\"../utils/ERC20Recoverable.sol\\\";\\n\\nerror Unauthorised(bytes32 node, address addr);\\nerror IncompatibleParent();\\nerror IncorrectTokenType();\\nerror LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);\\nerror LabelTooShort();\\nerror LabelTooLong(string label);\\nerror IncorrectTargetOwner(address owner);\\nerror CannotUpgrade();\\nerror OperationProhibited(bytes32 node);\\nerror NameIsNotWrapped();\\nerror NameIsStillExpired();\\n\\ncontract NameWrapper is\\n Ownable,\\n ERC1155Fuse,\\n INameWrapper,\\n Controllable,\\n IERC721Receiver,\\n ERC20Recoverable,\\n ReverseClaimer\\n{\\n using BytesUtils for bytes;\\n\\n ENS public immutable ens;\\n IBaseRegistrar public immutable registrar;\\n IMetadataService public metadataService;\\n mapping(bytes32 => bytes) public names;\\n string public constant name = \\\"NameWrapper\\\";\\n\\n uint64 private constant GRACE_PERIOD = 90 days;\\n bytes32 private constant ETH_NODE =\\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\\n bytes32 private constant ETH_LABELHASH =\\n 0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0;\\n bytes32 private constant ROOT_NODE =\\n 0x0000000000000000000000000000000000000000000000000000000000000000;\\n\\n INameWrapperUpgrade public upgradeContract;\\n uint64 private constant MAX_EXPIRY = type(uint64).max;\\n\\n constructor(\\n ENS _ens,\\n IBaseRegistrar _registrar,\\n IMetadataService _metadataService\\n ) ReverseClaimer(_ens, msg.sender) {\\n ens = _ens;\\n registrar = _registrar;\\n metadataService = _metadataService;\\n\\n /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE and ETH_NODE and set expiry to max */\\n\\n _setData(\\n uint256(ETH_NODE),\\n address(0),\\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\\n MAX_EXPIRY\\n );\\n _setData(\\n uint256(ROOT_NODE),\\n address(0),\\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\\n MAX_EXPIRY\\n );\\n names[ROOT_NODE] = \\\"\\\\x00\\\";\\n names[ETH_NODE] = \\\"\\\\x03eth\\\\x00\\\";\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(ERC1155Fuse, INameWrapper) returns (bool) {\\n return\\n interfaceId == type(INameWrapper).interfaceId ||\\n interfaceId == type(IERC721Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /* ERC1155 Fuse */\\n\\n /**\\n * @notice Gets the owner of a name\\n * @param id Label as a string of the .eth domain to wrap\\n * @return owner The owner of the name\\n */\\n\\n function ownerOf(\\n uint256 id\\n ) public view override(ERC1155Fuse, INameWrapper) returns (address owner) {\\n return super.ownerOf(id);\\n }\\n\\n /**\\n * @notice Gets the owner of a name\\n * @param id Namehash of the name\\n * @return operator Approved operator of a name\\n */\\n\\n function getApproved(\\n uint256 id\\n )\\n public\\n view\\n override(ERC1155Fuse, INameWrapper)\\n returns (address operator)\\n {\\n address owner = ownerOf(id);\\n if (owner == address(0)) {\\n return address(0);\\n }\\n return super.getApproved(id);\\n }\\n\\n /**\\n * @notice Approves an address for a name\\n * @param to address to approve\\n * @param tokenId name to approve\\n */\\n\\n function approve(\\n address to,\\n uint256 tokenId\\n ) public override(ERC1155Fuse, INameWrapper) {\\n (, uint32 fuses, ) = getData(tokenId);\\n if (fuses & CANNOT_APPROVE == CANNOT_APPROVE) {\\n revert OperationProhibited(bytes32(tokenId));\\n }\\n super.approve(to, tokenId);\\n }\\n\\n /**\\n * @notice Gets the data for a name\\n * @param id Namehash of the name\\n * @return owner Owner of the name\\n * @return fuses Fuses of the name\\n * @return expiry Expiry of the name\\n */\\n\\n function getData(\\n uint256 id\\n )\\n public\\n view\\n override(ERC1155Fuse, INameWrapper)\\n returns (address owner, uint32 fuses, uint64 expiry)\\n {\\n (owner, fuses, expiry) = super.getData(id);\\n\\n (owner, fuses) = _clearOwnerAndFuses(owner, fuses, expiry);\\n }\\n\\n /* Metadata service */\\n\\n /**\\n * @notice Set the metadata service. Only the owner can do this\\n * @param _metadataService The new metadata service\\n */\\n\\n function setMetadataService(\\n IMetadataService _metadataService\\n ) public onlyOwner {\\n metadataService = _metadataService;\\n }\\n\\n /**\\n * @notice Get the metadata uri\\n * @param tokenId The id of the token\\n * @return string uri of the metadata service\\n */\\n\\n function uri(\\n uint256 tokenId\\n )\\n public\\n view\\n override(INameWrapper, IERC1155MetadataURI)\\n returns (string memory)\\n {\\n return metadataService.uri(tokenId);\\n }\\n\\n /**\\n * @notice Set the address of the upgradeContract of the contract. only admin can do this\\n * @dev The default value of upgradeContract is the 0 address. Use the 0 address at any time\\n * to make the contract not upgradable.\\n * @param _upgradeAddress address of an upgraded contract\\n */\\n\\n function setUpgradeContract(\\n INameWrapperUpgrade _upgradeAddress\\n ) public onlyOwner {\\n if (address(upgradeContract) != address(0)) {\\n registrar.setApprovalForAll(address(upgradeContract), false);\\n ens.setApprovalForAll(address(upgradeContract), false);\\n }\\n\\n upgradeContract = _upgradeAddress;\\n\\n if (address(upgradeContract) != address(0)) {\\n registrar.setApprovalForAll(address(upgradeContract), true);\\n ens.setApprovalForAll(address(upgradeContract), true);\\n }\\n }\\n\\n /**\\n * @notice Checks if msg.sender is the owner or operator of the owner of a name\\n * @param node namehash of the name to check\\n */\\n\\n modifier onlyTokenOwner(bytes32 node) {\\n if (!canModifyName(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n _;\\n }\\n\\n /**\\n * @notice Checks if owner or operator of the owner\\n * @param node namehash of the name to check\\n * @param addr which address to check permissions for\\n * @return whether or not is owner or operator\\n */\\n\\n function canModifyName(\\n bytes32 node,\\n address addr\\n ) public view returns (bool) {\\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\\n return\\n (owner == addr || isApprovedForAll(owner, addr)) &&\\n !_isETH2LDInGracePeriod(fuses, expiry);\\n }\\n\\n /**\\n * @notice Checks if owner/operator or approved by owner\\n * @param node namehash of the name to check\\n * @param addr which address to check permissions for\\n * @return whether or not is owner/operator or approved\\n */\\n\\n function canExtendSubnames(\\n bytes32 node,\\n address addr\\n ) public view returns (bool) {\\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\\n return\\n (owner == addr ||\\n isApprovedForAll(owner, addr) ||\\n getApproved(uint256(node)) == addr) &&\\n !_isETH2LDInGracePeriod(fuses, expiry);\\n }\\n\\n /**\\n * @notice Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract\\n * @dev Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar\\n * @param label Label as a string of the .eth domain to wrap\\n * @param wrappedOwner Owner of the name in this contract\\n * @param ownerControlledFuses Initial owner-controlled fuses to set\\n * @param resolver Resolver contract address\\n */\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) public returns (uint64 expiry) {\\n uint256 tokenId = uint256(keccak256(bytes(label)));\\n address registrant = registrar.ownerOf(tokenId);\\n if (\\n registrant != msg.sender &&\\n !registrar.isApprovedForAll(registrant, msg.sender)\\n ) {\\n revert Unauthorised(\\n _makeNode(ETH_NODE, bytes32(tokenId)),\\n msg.sender\\n );\\n }\\n\\n // transfer the token from the user to this contract\\n registrar.transferFrom(registrant, address(this), tokenId);\\n\\n // transfer the ens record back to the new owner (this contract)\\n registrar.reclaim(tokenId, address(this));\\n\\n expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\\n\\n _wrapETH2LD(\\n label,\\n wrappedOwner,\\n ownerControlledFuses,\\n expiry,\\n resolver\\n );\\n }\\n\\n /**\\n * @dev Registers a new .eth second-level domain and wraps it.\\n * Only callable by authorised controllers.\\n * @param label The label to register (Eg, 'foo' for 'foo.eth').\\n * @param wrappedOwner The owner of the wrapped name.\\n * @param duration The duration, in seconds, to register the name for.\\n * @param resolver The resolver address to set on the ENS registry (optional).\\n * @param ownerControlledFuses Initial owner-controlled fuses to set\\n * @return registrarExpiry The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch.\\n */\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint16 ownerControlledFuses\\n ) external onlyController returns (uint256 registrarExpiry) {\\n uint256 tokenId = uint256(keccak256(bytes(label)));\\n registrarExpiry = registrar.register(tokenId, address(this), duration);\\n _wrapETH2LD(\\n label,\\n wrappedOwner,\\n ownerControlledFuses,\\n uint64(registrarExpiry) + GRACE_PERIOD,\\n resolver\\n );\\n }\\n\\n /**\\n * @notice Renews a .eth second-level domain.\\n * @dev Only callable by authorised controllers.\\n * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth').\\n * @param duration The number of seconds to renew the name for.\\n * @return expires The expiry date of the name on the .eth registrar, in seconds since the Unix epoch.\\n */\\n\\n function renew(\\n uint256 tokenId,\\n uint256 duration\\n ) external onlyController returns (uint256 expires) {\\n bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));\\n\\n uint256 registrarExpiry = registrar.renew(tokenId, duration);\\n\\n // Do not set anything in wrapper if name is not wrapped\\n try registrar.ownerOf(tokenId) returns (address registrarOwner) {\\n if (\\n registrarOwner != address(this) ||\\n ens.owner(node) != address(this)\\n ) {\\n return registrarExpiry;\\n }\\n } catch {\\n return registrarExpiry;\\n }\\n\\n // Set expiry in Wrapper\\n uint64 expiry = uint64(registrarExpiry) + GRACE_PERIOD;\\n\\n // Use super to allow names expired on the wrapper, but not expired on the registrar to renew()\\n (address owner, uint32 fuses, ) = super.getData(uint256(node));\\n _setData(node, owner, fuses, expiry);\\n\\n return registrarExpiry;\\n }\\n\\n /**\\n * @notice Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\\n * @dev Can be called by the owner in the registry or an authorised caller in the registry\\n * @param name The name to wrap, in DNS format\\n * @param wrappedOwner Owner of the name in this contract\\n * @param resolver Resolver contract\\n */\\n\\n function wrap(\\n bytes calldata name,\\n address wrappedOwner,\\n address resolver\\n ) public {\\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\\n bytes32 parentNode = name.namehash(offset);\\n bytes32 node = _makeNode(parentNode, labelhash);\\n\\n names[node] = name;\\n\\n if (parentNode == ETH_NODE) {\\n revert IncompatibleParent();\\n }\\n\\n address owner = ens.owner(node);\\n\\n if (owner != msg.sender && !ens.isApprovedForAll(owner, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n if (resolver != address(0)) {\\n ens.setResolver(node, resolver);\\n }\\n\\n ens.setOwner(node, address(this));\\n\\n _wrap(node, name, wrappedOwner, 0, 0);\\n }\\n\\n /**\\n * @notice Unwraps a .eth domain. e.g. vitalik.eth\\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\\n * @param labelhash Labelhash of the .eth domain\\n * @param registrant Sets the owner in the .eth registrar to this address\\n * @param controller Sets the owner in the registry to this address\\n */\\n\\n function unwrapETH2LD(\\n bytes32 labelhash,\\n address registrant,\\n address controller\\n ) public onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {\\n if (registrant == address(this)) {\\n revert IncorrectTargetOwner(registrant);\\n }\\n _unwrap(_makeNode(ETH_NODE, labelhash), controller);\\n registrar.safeTransferFrom(\\n address(this),\\n registrant,\\n uint256(labelhash)\\n );\\n }\\n\\n /**\\n * @notice Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\\n * @param controller Sets the owner in the registry to this address\\n */\\n\\n function unwrap(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n address controller\\n ) public onlyTokenOwner(_makeNode(parentNode, labelhash)) {\\n if (parentNode == ETH_NODE) {\\n revert IncompatibleParent();\\n }\\n if (controller == address(0x0) || controller == address(this)) {\\n revert IncorrectTargetOwner(controller);\\n }\\n _unwrap(_makeNode(parentNode, labelhash), controller);\\n }\\n\\n /**\\n * @notice Sets fuses of a name\\n * @param node Namehash of the name\\n * @param ownerControlledFuses Owner-controlled fuses to burn\\n * @return Old fuses\\n */\\n\\n function setFuses(\\n bytes32 node,\\n uint16 ownerControlledFuses\\n )\\n public\\n onlyTokenOwner(node)\\n operationAllowed(node, CANNOT_BURN_FUSES)\\n returns (uint32)\\n {\\n // owner protected by onlyTokenOwner\\n (address owner, uint32 oldFuses, uint64 expiry) = getData(\\n uint256(node)\\n );\\n _setFuses(node, owner, ownerControlledFuses | oldFuses, expiry, expiry);\\n return oldFuses;\\n }\\n\\n /**\\n * @notice Extends expiry for a name\\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\\n * @param expiry When the name will expire in seconds since the Unix epoch\\n * @return New expiry\\n */\\n\\n function extendExpiry(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint64 expiry\\n ) public returns (uint64) {\\n bytes32 node = _makeNode(parentNode, labelhash);\\n\\n if (!_isWrapped(node)) {\\n revert NameIsNotWrapped();\\n }\\n\\n // this flag is used later, when checking fuses\\n bool canExtendSubname = canExtendSubnames(parentNode, msg.sender);\\n // only allow the owner of the name or owner of the parent name\\n if (!canExtendSubname && !canModifyName(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n (address owner, uint32 fuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n\\n // Either CAN_EXTEND_EXPIRY must be set, or the caller must have permission to modify the parent name\\n if (!canExtendSubname && fuses & CAN_EXTEND_EXPIRY == 0) {\\n revert OperationProhibited(node);\\n }\\n\\n // Max expiry is set to the expiry of the parent\\n (, , uint64 maxExpiry) = getData(uint256(parentNode));\\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\\n\\n _setData(node, owner, fuses, expiry);\\n emit ExpiryExtended(node, expiry);\\n return expiry;\\n }\\n\\n /**\\n * @notice Upgrades a domain of any kind. Could be a .eth name vitalik.eth, a DNSSEC name vitalik.xyz, or a subdomain\\n * @dev Can be called by the owner or an authorised caller\\n * @param name The name to upgrade, in DNS format\\n * @param extraData Extra data to pass to the upgrade contract\\n */\\n\\n function upgrade(bytes calldata name, bytes calldata extraData) public {\\n bytes32 node = name.namehash(0);\\n\\n if (address(upgradeContract) == address(0)) {\\n revert CannotUpgrade();\\n }\\n\\n if (!canModifyName(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n (address currentOwner, uint32 fuses, uint64 expiry) = getData(\\n uint256(node)\\n );\\n\\n address approved = getApproved(uint256(node));\\n\\n _burn(uint256(node));\\n\\n upgradeContract.wrapFromUpgrade(\\n name,\\n currentOwner,\\n fuses,\\n expiry,\\n approved,\\n extraData\\n );\\n }\\n\\n /** \\n /* @notice Sets fuses of a name that you own the parent of\\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\\n * @param fuses Fuses to burn\\n * @param expiry When the name will expire in seconds since the Unix epoch\\n */\\n\\n function setChildFuses(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint32 fuses,\\n uint64 expiry\\n ) public {\\n bytes32 node = _makeNode(parentNode, labelhash);\\n _checkFusesAreSettable(node, fuses);\\n (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n if (owner == address(0) || ens.owner(node) != address(this)) {\\n revert NameIsNotWrapped();\\n }\\n // max expiry is set to the expiry of the parent\\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\\n if (parentNode == ROOT_NODE) {\\n if (!canModifyName(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n } else {\\n if (!canModifyName(parentNode, msg.sender)) {\\n revert Unauthorised(parentNode, msg.sender);\\n }\\n }\\n\\n _checkParentFuses(node, fuses, parentFuses);\\n\\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\\n\\n // if PARENT_CANNOT_CONTROL has been burned and fuses have changed\\n if (\\n oldFuses & PARENT_CANNOT_CONTROL != 0 &&\\n oldFuses | fuses != oldFuses\\n ) {\\n revert OperationProhibited(node);\\n }\\n fuses |= oldFuses;\\n _setFuses(node, owner, fuses, oldExpiry, expiry);\\n }\\n\\n /**\\n * @notice Sets the subdomain owner in the registry and then wraps the subdomain\\n * @param parentNode Parent namehash of the subdomain\\n * @param label Label of the subdomain as a string\\n * @param owner New owner in the wrapper\\n * @param fuses Initial fuses for the wrapped subdomain\\n * @param expiry When the name will expire in seconds since the Unix epoch\\n * @return node Namehash of the subdomain\\n */\\n\\n function setSubnodeOwner(\\n bytes32 parentNode,\\n string calldata label,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\\n bytes32 labelhash = keccak256(bytes(label));\\n node = _makeNode(parentNode, labelhash);\\n _checkCanCallSetSubnodeOwner(parentNode, node);\\n _checkFusesAreSettable(node, fuses);\\n bytes memory name = _saveLabel(parentNode, node, label);\\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\\n\\n if (!_isWrapped(node)) {\\n ens.setSubnodeOwner(parentNode, labelhash, address(this));\\n _wrap(node, name, owner, fuses, expiry);\\n } else {\\n _updateName(parentNode, node, label, owner, fuses, expiry);\\n }\\n }\\n\\n /**\\n * @notice Sets the subdomain owner in the registry with records and then wraps the subdomain\\n * @param parentNode parent namehash of the subdomain\\n * @param label label of the subdomain as a string\\n * @param owner new owner in the wrapper\\n * @param resolver resolver contract in the registry\\n * @param ttl ttl in the registry\\n * @param fuses initial fuses for the wrapped subdomain\\n * @param expiry When the name will expire in seconds since the Unix epoch\\n * @return node Namehash of the subdomain\\n */\\n\\n function setSubnodeRecord(\\n bytes32 parentNode,\\n string memory label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\\n bytes32 labelhash = keccak256(bytes(label));\\n node = _makeNode(parentNode, labelhash);\\n _checkCanCallSetSubnodeOwner(parentNode, node);\\n _checkFusesAreSettable(node, fuses);\\n _saveLabel(parentNode, node, label);\\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\\n if (!_isWrapped(node)) {\\n ens.setSubnodeRecord(\\n parentNode,\\n labelhash,\\n address(this),\\n resolver,\\n ttl\\n );\\n _storeNameAndWrap(parentNode, node, label, owner, fuses, expiry);\\n } else {\\n ens.setSubnodeRecord(\\n parentNode,\\n labelhash,\\n address(this),\\n resolver,\\n ttl\\n );\\n _updateName(parentNode, node, label, owner, fuses, expiry);\\n }\\n }\\n\\n /**\\n * @notice Sets records for the name in the ENS Registry\\n * @param node Namehash of the name to set a record for\\n * @param owner New owner in the registry\\n * @param resolver Resolver contract\\n * @param ttl Time to live in the registry\\n */\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n )\\n public\\n onlyTokenOwner(node)\\n operationAllowed(\\n node,\\n CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL\\n )\\n {\\n ens.setRecord(node, address(this), resolver, ttl);\\n if (owner == address(0)) {\\n (, uint32 fuses, ) = getData(uint256(node));\\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\\n revert IncorrectTargetOwner(owner);\\n }\\n _unwrap(node, address(0));\\n } else {\\n address oldOwner = ownerOf(uint256(node));\\n _transfer(oldOwner, owner, uint256(node), 1, \\\"\\\");\\n }\\n }\\n\\n /**\\n * @notice Sets resolver contract in the registry\\n * @param node namehash of the name\\n * @param resolver the resolver contract\\n */\\n\\n function setResolver(\\n bytes32 node,\\n address resolver\\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_RESOLVER) {\\n ens.setResolver(node, resolver);\\n }\\n\\n /**\\n * @notice Sets TTL in the registry\\n * @param node Namehash of the name\\n * @param ttl TTL in the registry\\n */\\n\\n function setTTL(\\n bytes32 node,\\n uint64 ttl\\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_TTL) {\\n ens.setTTL(node, ttl);\\n }\\n\\n /**\\n * @dev Allows an operation only if none of the specified fuses are burned.\\n * @param node The namehash of the name to check fuses on.\\n * @param fuseMask A bitmask of fuses that must not be burned.\\n */\\n\\n modifier operationAllowed(bytes32 node, uint32 fuseMask) {\\n (, uint32 fuses, ) = getData(uint256(node));\\n if (fuses & fuseMask != 0) {\\n revert OperationProhibited(node);\\n }\\n _;\\n }\\n\\n /**\\n * @notice Check whether a name can call setSubnodeOwner/setSubnodeRecord\\n * @dev Checks both CANNOT_CREATE_SUBDOMAIN and PARENT_CANNOT_CONTROL and whether not they have been burnt\\n * and checks whether the owner of the subdomain is 0x0 for creating or already exists for\\n * replacing a subdomain. If either conditions are true, then it is possible to call\\n * setSubnodeOwner\\n * @param parentNode Namehash of the parent name to check\\n * @param subnode Namehash of the subname to check\\n */\\n\\n function _checkCanCallSetSubnodeOwner(\\n bytes32 parentNode,\\n bytes32 subnode\\n ) internal view {\\n (\\n address subnodeOwner,\\n uint32 subnodeFuses,\\n uint64 subnodeExpiry\\n ) = getData(uint256(subnode));\\n\\n // check if the registry owner is 0 and expired\\n // check if the wrapper owner is 0 and expired\\n // If either, then check parent fuses for CANNOT_CREATE_SUBDOMAIN\\n bool expired = subnodeExpiry < block.timestamp;\\n if (\\n expired &&\\n // protects a name that has been unwrapped with PCC and doesn't allow the parent to take control by recreating it if unexpired\\n (subnodeOwner == address(0) ||\\n // protects a name that has been burnt and doesn't allow the parent to take control by recreating it if unexpired\\n ens.owner(subnode) == address(0))\\n ) {\\n (, uint32 parentFuses, ) = getData(uint256(parentNode));\\n if (parentFuses & CANNOT_CREATE_SUBDOMAIN != 0) {\\n revert OperationProhibited(subnode);\\n }\\n } else {\\n if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {\\n revert OperationProhibited(subnode);\\n }\\n }\\n }\\n\\n /**\\n * @notice Checks all Fuses in the mask are burned for the node\\n * @param node Namehash of the name\\n * @param fuseMask The fuses you want to check\\n * @return Boolean of whether or not all the selected fuses are burned\\n */\\n\\n function allFusesBurned(\\n bytes32 node,\\n uint32 fuseMask\\n ) public view returns (bool) {\\n (, uint32 fuses, ) = getData(uint256(node));\\n return fuses & fuseMask == fuseMask;\\n }\\n\\n /**\\n * @notice Checks if a name is wrapped\\n * @param node Namehash of the name\\n * @return Boolean of whether or not the name is wrapped\\n */\\n\\n function isWrapped(bytes32 node) public view returns (bool) {\\n bytes memory name = names[node];\\n if (name.length == 0) {\\n return false;\\n }\\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\\n bytes32 parentNode = name.namehash(offset);\\n return isWrapped(parentNode, labelhash);\\n }\\n\\n /**\\n * @notice Checks if a name is wrapped in a more gas efficient way\\n * @param parentNode Namehash of the name\\n * @param labelhash Namehash of the name\\n * @return Boolean of whether or not the name is wrapped\\n */\\n\\n function isWrapped(\\n bytes32 parentNode,\\n bytes32 labelhash\\n ) public view returns (bool) {\\n bytes32 node = _makeNode(parentNode, labelhash);\\n bool wrapped = _isWrapped(node);\\n if (parentNode != ETH_NODE) {\\n return wrapped;\\n }\\n try registrar.ownerOf(uint256(labelhash)) returns (address owner) {\\n return owner == address(this);\\n } catch {\\n return false;\\n }\\n }\\n\\n function onERC721Received(\\n address to,\\n address,\\n uint256 tokenId,\\n bytes calldata data\\n ) public returns (bytes4) {\\n //check if it's the eth registrar ERC721\\n if (msg.sender != address(registrar)) {\\n revert IncorrectTokenType();\\n }\\n\\n (\\n string memory label,\\n address owner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) = abi.decode(data, (string, address, uint16, address));\\n\\n bytes32 labelhash = bytes32(tokenId);\\n bytes32 labelhashFromData = keccak256(bytes(label));\\n\\n if (labelhashFromData != labelhash) {\\n revert LabelMismatch(labelhashFromData, labelhash);\\n }\\n\\n // transfer the ens record back to the new owner (this contract)\\n registrar.reclaim(uint256(labelhash), address(this));\\n\\n uint64 expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\\n\\n _wrapETH2LD(label, owner, ownerControlledFuses, expiry, resolver);\\n\\n return IERC721Receiver(to).onERC721Received.selector;\\n }\\n\\n /***** Internal functions */\\n\\n function _beforeTransfer(\\n uint256 id,\\n uint32 fuses,\\n uint64 expiry\\n ) internal override {\\n // For this check, treat .eth 2LDs as expiring at the start of the grace period.\\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\\n expiry -= GRACE_PERIOD;\\n }\\n\\n if (expiry < block.timestamp) {\\n // Transferable if the name was not emancipated\\n if (fuses & PARENT_CANNOT_CONTROL != 0) {\\n revert(\\\"ERC1155: insufficient balance for transfer\\\");\\n }\\n } else {\\n // Transferable if CANNOT_TRANSFER is unburned\\n if (fuses & CANNOT_TRANSFER != 0) {\\n revert OperationProhibited(bytes32(id));\\n }\\n }\\n\\n // delete token approval if CANNOT_APPROVE has not been burnt\\n if (fuses & CANNOT_APPROVE == 0) {\\n delete _tokenApprovals[id];\\n }\\n }\\n\\n function _clearOwnerAndFuses(\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal view override returns (address, uint32) {\\n if (expiry < block.timestamp) {\\n if (fuses & PARENT_CANNOT_CONTROL == PARENT_CANNOT_CONTROL) {\\n owner = address(0);\\n }\\n fuses = 0;\\n }\\n\\n return (owner, fuses);\\n }\\n\\n function _makeNode(\\n bytes32 node,\\n bytes32 labelhash\\n ) private pure returns (bytes32) {\\n return keccak256(abi.encodePacked(node, labelhash));\\n }\\n\\n function _addLabel(\\n string memory label,\\n bytes memory name\\n ) internal pure returns (bytes memory ret) {\\n if (bytes(label).length < 1) {\\n revert LabelTooShort();\\n }\\n if (bytes(label).length > 255) {\\n revert LabelTooLong(label);\\n }\\n return abi.encodePacked(uint8(bytes(label).length), label, name);\\n }\\n\\n function _mint(\\n bytes32 node,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal override {\\n _canFusesBeBurned(node, fuses);\\n (address oldOwner, , ) = super.getData(uint256(node));\\n if (oldOwner != address(0)) {\\n // burn and unwrap old token of old owner\\n _burn(uint256(node));\\n emit NameUnwrapped(node, address(0));\\n }\\n super._mint(node, owner, fuses, expiry);\\n }\\n\\n function _wrap(\\n bytes32 node,\\n bytes memory name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal {\\n _mint(node, wrappedOwner, fuses, expiry);\\n emit NameWrapped(node, name, wrappedOwner, fuses, expiry);\\n }\\n\\n function _storeNameAndWrap(\\n bytes32 parentNode,\\n bytes32 node,\\n string memory label,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal {\\n bytes memory name = _addLabel(label, names[parentNode]);\\n _wrap(node, name, owner, fuses, expiry);\\n }\\n\\n function _saveLabel(\\n bytes32 parentNode,\\n bytes32 node,\\n string memory label\\n ) internal returns (bytes memory) {\\n bytes memory name = _addLabel(label, names[parentNode]);\\n names[node] = name;\\n return name;\\n }\\n\\n function _updateName(\\n bytes32 parentNode,\\n bytes32 node,\\n string memory label,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal {\\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n bytes memory name = _addLabel(label, names[parentNode]);\\n if (names[node].length == 0) {\\n names[node] = name;\\n }\\n _setFuses(node, oldOwner, oldFuses | fuses, oldExpiry, expiry);\\n if (owner == address(0)) {\\n _unwrap(node, address(0));\\n } else {\\n _transfer(oldOwner, owner, uint256(node), 1, \\\"\\\");\\n }\\n }\\n\\n // wrapper function for stack limit\\n function _checkParentFusesAndExpiry(\\n bytes32 parentNode,\\n bytes32 node,\\n uint32 fuses,\\n uint64 expiry\\n ) internal view returns (uint64) {\\n (, , uint64 oldExpiry) = getData(uint256(node));\\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\\n _checkParentFuses(node, fuses, parentFuses);\\n return _normaliseExpiry(expiry, oldExpiry, maxExpiry);\\n }\\n\\n function _checkParentFuses(\\n bytes32 node,\\n uint32 fuses,\\n uint32 parentFuses\\n ) internal pure {\\n bool isBurningParentControlledFuses = fuses & PARENT_CONTROLLED_FUSES !=\\n 0;\\n\\n bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;\\n\\n if (isBurningParentControlledFuses && parentHasNotBurnedCU) {\\n revert OperationProhibited(node);\\n }\\n }\\n\\n function _normaliseExpiry(\\n uint64 expiry,\\n uint64 oldExpiry,\\n uint64 maxExpiry\\n ) private pure returns (uint64) {\\n // Expiry cannot be more than maximum allowed\\n // .eth names will check registrar, non .eth check parent\\n if (expiry > maxExpiry) {\\n expiry = maxExpiry;\\n }\\n // Expiry cannot be less than old expiry\\n if (expiry < oldExpiry) {\\n expiry = oldExpiry;\\n }\\n\\n return expiry;\\n }\\n\\n function _wrapETH2LD(\\n string memory label,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address resolver\\n ) private {\\n bytes32 labelhash = keccak256(bytes(label));\\n bytes32 node = _makeNode(ETH_NODE, labelhash);\\n // hardcode dns-encoded eth string for gas savings\\n bytes memory name = _addLabel(label, \\\"\\\\x03eth\\\\x00\\\");\\n names[node] = name;\\n\\n _wrap(\\n node,\\n name,\\n wrappedOwner,\\n fuses | PARENT_CANNOT_CONTROL | IS_DOT_ETH,\\n expiry\\n );\\n\\n if (resolver != address(0)) {\\n ens.setResolver(node, resolver);\\n }\\n }\\n\\n function _unwrap(bytes32 node, address owner) private {\\n if (allFusesBurned(node, CANNOT_UNWRAP)) {\\n revert OperationProhibited(node);\\n }\\n\\n // Burn token and fuse data\\n _burn(uint256(node));\\n ens.setOwner(node, owner);\\n\\n emit NameUnwrapped(node, owner);\\n }\\n\\n function _setFuses(\\n bytes32 node,\\n address owner,\\n uint32 fuses,\\n uint64 oldExpiry,\\n uint64 expiry\\n ) internal {\\n _setData(node, owner, fuses, expiry);\\n emit FusesSet(node, fuses);\\n if (expiry > oldExpiry) {\\n emit ExpiryExtended(node, expiry);\\n }\\n }\\n\\n function _setData(\\n bytes32 node,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal {\\n _canFusesBeBurned(node, fuses);\\n super._setData(uint256(node), owner, fuses, expiry);\\n }\\n\\n function _canFusesBeBurned(bytes32 node, uint32 fuses) internal pure {\\n // If a non-parent controlled fuse is being burned, check PCC and CU are burnt\\n if (\\n fuses & ~PARENT_CONTROLLED_FUSES != 0 &&\\n fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=\\n (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)\\n ) {\\n revert OperationProhibited(node);\\n }\\n }\\n\\n function _checkFusesAreSettable(bytes32 node, uint32 fuses) internal pure {\\n if (fuses | USER_SETTABLE_FUSES != USER_SETTABLE_FUSES) {\\n // Cannot directly burn other non-user settable fuses\\n revert OperationProhibited(node);\\n }\\n }\\n\\n function _isWrapped(bytes32 node) internal view returns (bool) {\\n return\\n ownerOf(uint256(node)) != address(0) &&\\n ens.owner(node) == address(this);\\n }\\n\\n function _isETH2LDInGracePeriod(\\n uint32 fuses,\\n uint64 expiry\\n ) internal view returns (bool) {\\n return\\n fuses & IS_DOT_ETH == IS_DOT_ETH &&\\n expiry - GRACE_PERIOD < block.timestamp;\\n }\\n}\\n\",\"keccak256\":\"0x91ee0a58d8ecf132c4e7fba9a25bbf45bbfc3634f2024b30a6a2eea4a151ed0c\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b5060405162006502380380620065028339810160408190526200003491620002f8565b823362000041816200028f565b6040516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260048201526000906001600160a01b038416906302571be390602401602060405180830381865afa158015620000a9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000cf91906200034c565b604051630f41a04d60e11b81526001600160a01b03848116600483015291925090821690631e83409a906024016020604051808303816000875af11580156200011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000142919062000373565b505050506001600160a01b0383811660805282811660a052600580546001600160a01b031916918316919091179055600163fffeffff60a01b03197fafa26c20e8b3d9a2853d642cfe1021dae26242ffedfac91c97aab212c1a4b93b8190557fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4955604080518082019091526001815260006020808301829052908052600690527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f89062000210908262000432565b506040805180820190915260058152626cae8d60e31b6020808301919091527f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae600052600690527ffb9e8e321b8a5ec48f12a7b41f22c6e595d761285c9eb19d8dda7c99edf1b54f9062000285908262000432565b50505050620004fe565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620002f557600080fd5b50565b6000806000606084860312156200030e57600080fd5b83516200031b81620002df565b60208501519093506200032e81620002df565b60408501519092506200034181620002df565b809150509250925092565b6000602082840312156200035f57600080fd5b81516200036c81620002df565b9392505050565b6000602082840312156200038657600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620003b857607f821691505b602082108103620003d957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200042d57600081815260208120601f850160051c81016020861015620004085750805b601f850160051c820191505b81811015620004295782815560010162000414565b5050505b505050565b81516001600160401b038111156200044e576200044e6200038d565b62000466816200045f8454620003a3565b84620003df565b602080601f8311600181146200049e5760008415620004855750858301515b600019600386901b1c1916600185901b17855562000429565b600085815260208120601f198616915b82811015620004cf57888601518255948401946001909101908401620004ae565b5085821015620004ee5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a051615ef76200060b6000396000818161050601528181610c1501528181610cef01528181610d7901528181611c6601528181611cfc01528181611daa01528181611ecc01528181611f4201528181611fc20152818161224401528181612380015281816124b2015281816126970152818161271d0152612f5201526000818161055301528181610b9b01528181610ed70152818161108b0152818161113d015281816115550152818161240501528181612537015281816127c8015281816129bf01528181612ccd0152818161317d0152818161322b015281816132f40152818161336d015281816139ca01528181613ae501528181613d4d015261438d0152615ef76000f3fe608060405234801561001057600080fd5b506004361061031f5760003560e01c80636352211e116101a7578063c93ab3fd116100ee578063e985e9c511610097578063f242432a11610071578063f242432a146107d7578063f2fde38b146107ea578063fd0cd0d9146107fd57600080fd5b8063e985e9c514610768578063eb8ae530146107a4578063ed70554d146107b757600080fd5b8063d9a50c12116100c8578063d9a50c121461071f578063da8c229e14610732578063e0dba60f1461075557600080fd5b8063c93ab3fd146106e6578063cf408823146106f9578063d8c9921a1461070c57600080fd5b8063a22cb46511610150578063b6bcad261161012a578063b6bcad26146106ad578063c475abff146106c0578063c658e086146106d357600080fd5b8063a22cb46514610674578063a401498214610687578063adf4960a1461069a57600080fd5b80638b4dfa75116101815780638b4dfa751461063d5780638cf8b41e146106505780638da5cb5b1461066357600080fd5b80636352211e146105f65780636e5d6ad214610609578063715018a61461063557600080fd5b80631f4e15041161026b5780633f15457f116102145780634e1273f4116101ee5780634e1273f4146105b057806353095467146105d05780635d3590d5146105e357600080fd5b80633f15457f1461054e578063402906fc1461057557806341415eab1461059d57600080fd5b80632b20e397116102455780632b20e397146105015780632eb2c2d61461052857806333c69ea91461053b57600080fd5b80631f4e1504146104c857806320c38e2b146104db57806324c1af44146104ee57600080fd5b80630e4cd725116102cd578063150b7a02116102a7578063150b7a02146104765780631534e177146104a25780631896f70a146104b557600080fd5b80630e4cd7251461043d5780630e89341c1461045057806314ab90381461046357600080fd5b806306fdde03116102fe57806306fdde03146103b4578063081812fc146103fd578063095ea7b31461042857600080fd5b8062fdd58e146103245780630178fe3f1461034a57806301ffc9a714610391575b600080fd5b610337610332366004614d26565b610810565b6040519081526020015b60405180910390f35b61035d610358366004614d52565b6108cf565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610341565b6103a461039f366004614d81565b6108ff565b6040519015158152602001610341565b6103f06040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516103419190614dee565b61041061040b366004614d52565b610958565b6040516001600160a01b039091168152602001610341565b61043b610436366004614d26565b61099d565b005b6103a461044b366004614e01565b6109e3565b6103f061045e366004614d52565b610a7d565b61043b610471366004614e4e565b610aef565b610489610484366004614ec3565b610c08565b6040516001600160e01b03199091168152602001610341565b61043b6104b0366004614f36565b610e1a565b61043b6104c3366004614e01565b610e44565b600754610410906001600160a01b031681565b6103f06104e9366004614d52565b610f06565b6103376104fc36600461502e565b610fa0565b6104107f000000000000000000000000000000000000000000000000000000000000000081565b61043b610536366004615156565b6111b4565b61043b610549366004615204565b6114de565b6104107f000000000000000000000000000000000000000000000000000000000000000081565b61058861058336600461525c565b6116d3565b60405163ffffffff9091168152602001610341565b6103a46105ab366004614e01565b611775565b6105c36105be36600461527f565b6117d2565b604051610341919061537d565b600554610410906001600160a01b031681565b61043b6105f1366004615390565b611910565b610410610604366004614d52565b6119aa565b61061c6106173660046153d1565b6119b5565b60405167ffffffffffffffff9091168152602001610341565b61043b611b0a565b61043b61064b366004615406565b611b1e565b61061c61065e366004615448565b611cc8565b6000546001600160a01b0316610410565b61043b6106823660046154d1565b612094565b6103376106953660046154ff565b61217e565b6103a46106a8366004615580565b612319565b61043b6106bb366004614f36565b61233e565b6103376106ce3660046155a3565b612596565b6103376106e13660046155c5565b61288d565b61043b6106f4366004615638565b612a9a565b61043b6107073660046156a4565b612c0b565b61043b61071a3660046156dc565b612dc4565b6103a461072d3660046155a3565b612ed4565b6103a4610740366004614f36565b60046020526000908152604090205460ff1681565b61043b6107633660046154d1565b612fe1565b6103a461077636600461570a565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61043b6107b2366004615738565b613049565b6103376107c5366004614d52565b60016020526000908152604090205481565b61043b6107e53660046157a0565b613414565b61043b6107f8366004614f36565b613531565b6103a461080b366004614d52565b6135be565b60006001600160a01b0383166108935760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061089e836119aa565b9050836001600160a01b0316816001600160a01b0316036108c35760019150506108c9565b60009150505b92915050565b60008181526001602052604090205460a081901c60c082901c6108f3838383613696565b90959094509092509050565b60006001600160e01b031982167fd82c42d800000000000000000000000000000000000000000000000000000000148061094957506001600160e01b03198216630a85bd0160e11b145b806108c957506108c9826136cd565b600080610964836119aa565b90506001600160a01b03811661097d5750600092915050565b6000838152600360205260409020546001600160a01b03165b9392505050565b60006109a8826108cf565b50915050603f1960408216016109d45760405163a2a7201360e01b81526004810183905260240161088a565b6109de838361374f565b505050565b60008080806109f1866108cf565b925092509250846001600160a01b0316836001600160a01b03161480610a3c57506001600160a01b0380841660009081526002602090815260408083209389168352929052205460ff165b80610a6057506001600160a01b038516610a5587610958565b6001600160a01b0316145b8015610a735750610a718282613899565b155b9695505050505050565b6005546040516303a24d0760e21b8152600481018390526060916001600160a01b031690630e89341c90602401600060405180830381865afa158015610ac7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108c99190810190615809565b81610afa8133611775565b610b205760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8260106000610b2e836108cf565b5091505063ffffffff8282161615610b5c5760405163a2a7201360e01b81526004810184905260240161088a565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c6c576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808080610c7d86880188615881565b83516020850120939750919550935091508890808214610cd3576040517fc65c3ccc000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161088a565b604051630a3b53db60e21b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610d3b57600080fd5b505af1158015610d4f573d6000803e3d6000fd5b5050604051636b727d4360e11b8152600481018d9052600092506276a70091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d6e4fa8690602401602060405180830381865afa158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de491906158e9565b610dee9190615918565b9050610e0187878761ffff1684886138ca565b50630a85bd0160e11b9c9b505050505050505050505050565b610e22613a30565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b81610e4f8133611775565b610e755760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8260086000610e83836108cf565b5091505063ffffffff8282161615610eb15760405163a2a7201360e01b81526004810184905260240161088a565b604051630c4b7b8560e11b8152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610bce565b60066020526000908152604090208054610f1f90615940565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4b90615940565b8015610f985780601f10610f6d57610100808354040283529160200191610f98565b820191906000526020600020905b815481529060010190602001808311610f7b57829003601f168201915b505050505081565b600087610fad8133611775565b610fd35760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8751602089012061100b8a82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92506110178a84613a8a565b6110218386613bc9565b61102c8a848b613bfc565b506110398a848787613cc9565b935061104483613d0f565b6110fa576040516305ef2c7f60e41b8152600481018b9052602481018290523060448201526001600160a01b03888116606483015267ffffffffffffffff881660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156110cf57600080fd5b505af11580156110e3573d6000803e3d6000fd5b505050506110f58a848b8b8989613dc8565b6111a7565b6040516305ef2c7f60e41b8152600481018b9052602481018290523060448201526001600160a01b03888116606483015267ffffffffffffffff881660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561118157600080fd5b505af1158015611195573d6000803e3d6000fd5b505050506111a78a848b8b8989613dff565b5050979650505050505050565b815183511461122b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161088a565b6001600160a01b03841661128f5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161088a565b6001600160a01b0385163314806112c957506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b61133b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161088a565b60005b835181101561147157600084828151811061135b5761135b61597a565b6020026020010151905060008483815181106113795761137961597a565b602002602001015190506000806000611391856108cf565b9250925092506113a2858383613ec3565b8360011480156113c357508a6001600160a01b0316836001600160a01b0316145b6114225760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b60008581526001602052604090206001600160a01b038b1663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905550505050508061146a90615990565b905061133e565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516114c19291906159a9565b60405180910390a46114d7338686868686613fb0565b5050505050565b604080516020808201879052818301869052825180830384018152606090920190925280519101206115108184613bc9565b6000808061151d846108cf565b919450925090506001600160a01b03831615806115cc57506040516302571be360e01b81526004810185905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906159d7565b6001600160a01b031614155b156115ea57604051635374b59960e01b815260040160405180910390fd5b6000806115f68a6108cf565b90935091508a90506116375761160c8633611775565b6116325760405163168ab55d60e31b81526004810187905233602482015260440161088a565b611667565b6116418a33611775565b6116675760405163168ab55d60e31b8152600481018b905233602482015260440161088a565b611672868984614155565b61167d878483614190565b9650620100008416158015906116a157508363ffffffff1688851763ffffffff1614155b156116c25760405163a2a7201360e01b81526004810187905260240161088a565b96831796610bfc86868a868b6141da565b6000826116e08133611775565b6117065760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8360026000611714836108cf565b5091505063ffffffff82821616156117425760405163a2a7201360e01b81526004810184905260240161088a565b6000808061174f8a6108cf565b9250925092506117688a84848c61ffff161784856141da565b5098975050505050505050565b6000808080611783866108cf565b925092509250846001600160a01b0316836001600160a01b03161480610a6057506001600160a01b0380841660009081526002602090815260408083209389168352929052205460ff16610a60565b6060815183511461184b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161088a565b6000835167ffffffffffffffff81111561186757611867614f53565b604051908082528060200260200182016040528015611890578160200160208202803683370190505b50905060005b8451811015611908576118db8582815181106118b4576118b461597a565b60200260200101518583815181106118ce576118ce61597a565b6020026020010151610810565b8282815181106118ed576118ed61597a565b602090810291909101015261190181615990565b9050611896565b509392505050565b611918613a30565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a491906159f4565b50505050565b60006108c982614284565b604080516020808201869052818301859052825180830384018152606090920190925280519101206000906119e981613d0f565b611a0657604051635374b59960e01b815260040160405180910390fd5b6000611a1286336109e3565b905080158015611a295750611a278233611775565b155b15611a505760405163168ab55d60e31b81526004810183905233602482015260440161088a565b60008080611a5d856108cf565b92509250925083158015611a745750620400008216155b15611a955760405163a2a7201360e01b81526004810186905260240161088a565b6000611aa08a6108cf565b92505050611aaf888383614190565b9750611abd8685858b61429a565b60405167ffffffffffffffff8916815286907ff675815a0817338f93a7da433f6bd5f5542f1029b11b455191ac96c7f6a9b1329060200160405180910390a2509598975050505050505050565b611b12613a30565b611b1c60006142e2565b565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611b728133611775565b611b985760405163168ab55d60e31b81526004810182905233602482015260440161088a565b306001600160a01b03841603611bcc57604051632ca49b0d60e11b81526001600160a01b038416600482015260240161088a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611c21905b83614332565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015611caa57600080fd5b505af1158015611cbe573d6000803e3d6000fd5b5050505050505050565b6000808686604051611cdb929190615a11565b6040519081900381206331a9108f60e11b82526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f91906159d7565b90506001600160a01b0381163314801590611e17575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1591906159f4565b155b15611e8757604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a40161088a565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b158015611f1057600080fd5b505af1158015611f24573d6000803e3d6000fd5b5050604051630a3b53db60e21b8152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b158015611f9057600080fd5b505af1158015611fa4573d6000803e3d6000fd5b5050604051636b727d4360e11b8152600481018590526276a70092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063d6e4fa8690602401602060405180830381865afa158015612012573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203691906158e9565b6120409190615918565b925061208988888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250505061ffff881686886138ca565b505095945050505050565b6001600160a01b03821633036121125760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161088a565b3360008181526002602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081526004602052604081205460ff166121ee5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b606482015260840161088a565b60008787604051612200929190615a11565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820187905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015612295573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b991906158e9565b915061230e88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250505061ffff86166123086276a70087615918565b886138ca565b509695505050505050565b600080612325846108cf565b50841663ffffffff908116908516149250505092915050565b612346613a30565b6007546001600160a01b0316156124665760075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156123c657600080fd5b505af11580156123da573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561244d57600080fd5b505af1158015612461573d6000803e3d6000fd5b505050505b600780546001600160a01b0319166001600160a01b038316908117909155156125935760075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156124f857600080fd5b505af115801561250c573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561257f57600080fd5b505af11580156114d7573d6000803e3d6000fd5b50565b3360009081526004602052604081205460ff166126065760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b606482015260840161088a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101869052602481018590529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c475abff906044016020604051808303816000875af11580156126e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270491906158e9565b6040516331a9108f60e11b8152600481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa925050508015612788575060408051601f3d908101601f19168201909252612785918101906159d7565b60015b6127955791506108c99050565b6001600160a01b0381163014158061283f57506040516302571be360e01b81526004810184905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561280f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283391906159d7565b6001600160a01b031614155b1561284e575091506108c99050565b50600061285e6276a70083615918565b60008481526001602052604090205490915060a081901c6128818583838661429a565b50919695505050505050565b60008661289a8133611775565b6128c05760405163168ab55d60e31b81526004810182905233602482015260440161088a565b600087876040516128d2929190615a11565b6040518091039020905061290d8982604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92506129198984613a8a565b6129238386613bc9565b60006129668a858b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613bfc92505050565b90506129748a858888613cc9565b945061297f84613d0f565b612a47576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018b9052602481018390523060448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906306ab5923906064016020604051808303816000875af1158015612a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3491906158e9565b50612a428482898989614424565b612a8d565b612a8d8a858b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508c91508b9050613dff565b5050509695505050505050565b6000612ae0600086868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144669050565b6007549091506001600160a01b0316612b25576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b2f8133611775565b612b555760405163168ab55d60e31b81526004810182905233602482015260440161088a565b60008080612b62846108cf565b919450925090506000612b7485610958565b9050612b7f85614525565b600760009054906101000a90046001600160a01b03166001600160a01b0316639198c2768a8a878787878e8e6040518963ffffffff1660e01b8152600401612bce989796959493929190615a4a565b600060405180830381600087803b158015612be857600080fd5b505af1158015612bfc573d6000803e3d6000fd5b50505050505050505050505050565b83612c168133611775565b612c3c5760405163168ab55d60e31b81526004810182905233602482015260440161088a565b84601c6000612c4a836108cf565b5091505063ffffffff8282161615612c785760405163a2a7201360e01b81526004810184905260240161088a565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b158015612d1157600080fd5b505af1158015612d25573d6000803e3d6000fd5b5050506001600160a01b0388169050612d8c576000612d43896108cf565b509150506201ffff1962020000821601612d7b57604051632ca49b0d60e11b81526001600160a01b038916600482015260240161088a565b612d86896000614332565b50611cbe565b6000612d97896119aa565b9050612db981898b60001c6001604051806020016040528060008152506145e7565b505050505050505050565b60408051602080820186905281830185905282518083038401815260609092019092528051910120612df68133611775565b612e1c5760405163168ab55d60e31b81526004810182905233602482015260440161088a565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612e5c5760405163615a470360e01b815260040160405180910390fd5b6001600160a01b0382161580612e7a57506001600160a01b03821630145b15612ea357604051632ca49b0d60e11b81526001600160a01b038316600482015260240161088a565b604080516020808201879052818301869052825180830384018152606090920190925280519101206119a490611c1b565b604080516020808201859052818301849052825180830384018152606090920190925280519101206000906000612f0a82613d0f565b90507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae8514612f3c5791506108c99050565b6040516331a9108f60e11b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa925050508015612fbd575060408051601f3d908101601f19168201909252612fba918101906159d7565b60015b612fcc576000925050506108c9565b6001600160a01b0316301492506108c9915050565b612fe9613a30565b6001600160a01b038216600081815260046020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b600080613090600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506147399050565b9150915060006130d98288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144669050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091506000906000818152600660205260409020909150613123888a83615af9565b507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5282016131645760405163615a470360e01b815260040160405180910390fd5b6040516302571be360e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa1580156131cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131f091906159d7565b90506001600160a01b0381163314801590613298575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015613272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329691906159f4565b155b156132bf5760405163168ab55d60e31b81526004810183905233602482015260440161088a565b6001600160a01b0386161561335157604051630c4b7b8560e11b8152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b15801561333857600080fd5b505af115801561334c573d6000803e3d6000fd5b505050505b604051635b0fc9c360e01b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b1580156133b957600080fd5b505af11580156133cd573d6000803e3d6000fd5b50505050612db9828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d93509150819050614424565b6001600160a01b0384166134785760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161088a565b6001600160a01b0385163314806134b257506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6135245760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f7665640000000000000000000000000000000000000000000000606482015260840161088a565b6114d785858585856145e7565b613539613a30565b6001600160a01b0381166135b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161088a565b612593816142e2565b600081815260066020526040812080548291906135da90615940565b80601f016020809104026020016040519081016040528092919081815260200182805461360690615940565b80156136535780601f1061362857610100808354040283529160200191613653565b820191906000526020600020905b81548152906001019060200180831161363657829003601f168201915b50505050509050805160000361366c5750600092915050565b6000806136798382614739565b9092509050600061368a8483614466565b9050610a738184612ed4565b600080428367ffffffffffffffff1610156136c45761ffff19620100008516016136bf57600094505b600093505b50929391925050565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061371757506001600160e01b031982166303a24d0760e21b145b806108c957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108c9565b600061375a826119aa565b9050806001600160a01b0316836001600160a01b0316036137e35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161088a565b336001600160a01b038216148061381d57506001600160a01b038116600090815260026020908152604080832033845290915290205460ff165b61388f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161088a565b6109de83836147f0565b6000620200008381161480156109965750426138b86276a70084615bb9565b67ffffffffffffffff16109392505050565b8451602086012060006139247f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000613967886040518060400160405280600581526020017f036574680000000000000000000000000000000000000000000000000000000081525061485e565b60008381526006602052604090209091506139828282615bda565b50613995828289620300008a1789614424565b6001600160a01b03841615611cbe57604051630c4b7b8560e11b8152600481018390526001600160a01b0385811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015613a0e57600080fd5b505af1158015613a22573d6000803e3d6000fd5b505050505050505050505050565b6000546001600160a01b03163314611b1c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161088a565b60008080613a97846108cf565b919450925090504267ffffffffffffffff821610808015613b5b57506001600160a01b0384161580613b5b57506040516302571be360e01b8152600481018690526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015613b2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b5091906159d7565b6001600160a01b0316145b15613b9a576000613b6b876108cf565b509150506020811615613b945760405163a2a7201360e01b81526004810187905260240161088a565b50613bc1565b62010000831615613bc15760405163a2a7201360e01b81526004810186905260240161088a565b505050505050565b63fffdffff81811763ffffffff1614613bf85760405163a2a7201360e01b81526004810183905260240161088a565b5050565b60606000613ca583600660008881526020019081526020016000208054613c2290615940565b80601f0160208091040260200160405190810160405280929190818152602001828054613c4e90615940565b8015613c9b5780601f10613c7057610100808354040283529160200191613c9b565b820191906000526020600020905b815481529060010190602001808311613c7e57829003601f168201915b505050505061485e565b6000858152600660205260409020909150613cc08282615bda565b50949350505050565b600080613cd5856108cf565b92505050600080613ce88860001c6108cf565b9250925050613cf8878784614155565b613d03858483614190565b98975050505050505050565b600080613d1b836119aa565b6001600160a01b0316141580156108c957506040516302571be360e01b81526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015613d94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db891906159d7565b6001600160a01b03161492915050565b60008681526006602052604081208054613de7918791613c2290615940565b9050613df68682868686614424565b50505050505050565b60008080613e0c886108cf565b9250925092506000613e3688600660008d81526020019081526020016000208054613c2290615940565b60008a8152600660205260409020805491925090613e5390615940565b9050600003613e76576000898152600660205260409020613e748282615bda565b505b613e85898588861785896141da565b6001600160a01b038716613ea357613e9e896000614332565b610bfc565b610bfc84888b60001c6001604051806020016040528060008152506145e7565b6201ffff1962020000831601613ee357613ee06276a70082615bb9565b90505b428167ffffffffffffffff161015613f605762010000821615613f5b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b613f85565b6004821615613f855760405163a2a7201360e01b81526004810184905260240161088a565b604082166000036109de575050600090815260036020526040902080546001600160a01b0319169055565b6001600160a01b0384163b15613bc15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613ff49089908990889088908890600401615c9a565b6020604051808303816000875af192505050801561402f575060408051601f3d908101601f1916820190925261402c91810190615cec565b60015b6140e45761403b615d09565b806308c379a003614074575061404f615d25565b8061405a5750614076565b8060405162461bcd60e51b815260040161088a9190614dee565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161088a565b6001600160e01b0319811663bc197c8160e01b14613df65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161088a565b63ffff0000821615801590600183161590829061416f5750805b156114d75760405163a2a7201360e01b81526004810186905260240161088a565b60008167ffffffffffffffff168467ffffffffffffffff1611156141b2578193505b8267ffffffffffffffff168467ffffffffffffffff1610156141d2578293505b509192915050565b6141e68585858461429a565b60405163ffffffff8416815285907f39873f00c80f4f94b7bd1594aebcf650f003545b74824d57ddf4939e3ff3a34b9060200160405180910390a28167ffffffffffffffff168167ffffffffffffffff1611156114d75760405167ffffffffffffffff8216815285907ff675815a0817338f93a7da433f6bd5f5542f1029b11b455191ac96c7f6a9b132906020015b60405180910390a25050505050565b600080614290836108cf565b5090949350505050565b6142a48483614907565b60008481526001602052604090206001600160a01b03841663ffffffff60a01b60a085901b16176001600160c01b031960c084901b161790556119a4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61433d826001612319565b1561435e5760405163a2a7201360e01b81526004810183905260240161088a565b61436782614525565b604051635b0fc9c360e01b8152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b1580156143d157600080fd5b505af11580156143e5573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c4915060200161303d565b61443085848484614940565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516142759493929190615daf565b60008060006144758585614739565b9092509050816144e7576001855161448d9190615df7565b84146144db5760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d65000000604482015260640161088a565b50600091506108c99050565b6144f18582614466565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b60008181526001602052604090205460a081901c60c082901c614549838383613696565b600086815260036020908152604080832080546001600160a01b03191690556001909152902063ffffffff60a01b60a083901b166001600160c01b031960c086901b1617905592506145989050565b60408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b60008060006145f5866108cf565b925092509250614606868383613ec3565b8460011480156146275750876001600160a01b0316836001600160a01b0316145b6146865760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b866001600160a01b0316836001600160a01b0316036146a7575050506114d7565b60008681526001602052604090206001600160a01b03881663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611cbe3389898989896149b4565b6000808351831061478c5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e64730000604482015260640161088a565b60008484815181106147a0576147a061597a565b016020015160f81c905080156147cc576147c5856147bf866001615e0a565b83614ab0565b92506147d1565b600092505b6147db8185615e0a565b6147e6906001615e0a565b9150509250929050565b600081815260036020526040902080546001600160a01b0319166001600160a01b0384169081179091558190614825826119aa565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b606060018351101561489c576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff835111156148da57826040517fe3ba295f00000000000000000000000000000000000000000000000000000000815260040161088a9190614dee565b825183836040516020016148f093929190615e1d565b604051602081830303815290604052905092915050565b61ffff81161580159061491f57506201000181811614155b15613bf85760405163a2a7201360e01b81526004810183905260240161088a565b61494a8483614907565b6000848152600160205260409020546001600160a01b038116156149a85761497185614525565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6114d785858585614ad4565b6001600160a01b0384163b15613bc15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906149f89089908990889088908890600401615e7e565b6020604051808303816000875af1925050508015614a33575060408051601f3d908101601f19168201909252614a3091810190615cec565b60015b614a3f5761403b615d09565b6001600160e01b0319811663f23a6e6160e01b14613df65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161088a565b8251600090614abf8385615e0a565b1115614aca57600080fd5b5091016020012090565b8360008080614ae2846108cf565b9194509250905063ffff0000821667ffffffffffffffff8087169083161115614b09578195505b428267ffffffffffffffff1610614b1f57958617955b6001600160a01b03841615614b765760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e00604482015260640161088a565b6001600160a01b038816614bf25760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161088a565b306001600160a01b03891603614c705760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e7472616374000000000000000000000000606482015260840161088a565b60008581526001602052604090206001600160a01b03891663ffffffff60a01b60a08a901b16176001600160c01b031960c089901b1617905560408051868152600160208201526001600160a01b038a169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612db93360008a886001604051806020016040528060008152506149b4565b6001600160a01b038116811461259357600080fd5b60008060408385031215614d3957600080fd5b8235614d4481614d11565b946020939093013593505050565b600060208284031215614d6457600080fd5b5035919050565b6001600160e01b03198116811461259357600080fd5b600060208284031215614d9357600080fd5b813561099681614d6b565b60005b83811015614db9578181015183820152602001614da1565b50506000910152565b60008151808452614dda816020860160208601614d9e565b601f01601f19169290920160200192915050565b6020815260006109966020830184614dc2565b60008060408385031215614e1457600080fd5b823591506020830135614e2681614d11565b809150509250929050565b803567ffffffffffffffff81168114614e4957600080fd5b919050565b60008060408385031215614e6157600080fd5b82359150614e7160208401614e31565b90509250929050565b60008083601f840112614e8c57600080fd5b50813567ffffffffffffffff811115614ea457600080fd5b602083019150836020828501011115614ebc57600080fd5b9250929050565b600080600080600060808688031215614edb57600080fd5b8535614ee681614d11565b94506020860135614ef681614d11565b935060408601359250606086013567ffffffffffffffff811115614f1957600080fd5b614f2588828901614e7a565b969995985093965092949392505050565b600060208284031215614f4857600080fd5b813561099681614d11565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715614f8f57614f8f614f53565b6040525050565b600067ffffffffffffffff821115614fb057614fb0614f53565b50601f01601f191660200190565b600082601f830112614fcf57600080fd5b8135614fda81614f96565b604051614fe78282614f69565b828152856020848701011115614ffc57600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614e4957600080fd5b600080600080600080600060e0888a03121561504957600080fd5b87359650602088013567ffffffffffffffff81111561506757600080fd5b6150738a828b01614fbe565b965050604088013561508481614d11565b9450606088013561509481614d11565b93506150a260808901614e31565b92506150b060a0890161501a565b91506150be60c08901614e31565b905092959891949750929550565b600067ffffffffffffffff8211156150e6576150e6614f53565b5060051b60200190565b600082601f83011261510157600080fd5b8135602061510e826150cc565b60405161511b8282614f69565b83815260059390931b850182019282810191508684111561513b57600080fd5b8286015b8481101561230e578035835291830191830161513f565b600080600080600060a0868803121561516e57600080fd5b853561517981614d11565b9450602086013561518981614d11565b9350604086013567ffffffffffffffff808211156151a657600080fd5b6151b289838a016150f0565b945060608801359150808211156151c857600080fd5b6151d489838a016150f0565b935060808801359150808211156151ea57600080fd5b506151f788828901614fbe565b9150509295509295909350565b6000806000806080858703121561521a57600080fd5b84359350602085013592506152316040860161501a565b915061523f60608601614e31565b905092959194509250565b803561ffff81168114614e4957600080fd5b6000806040838503121561526f57600080fd5b82359150614e716020840161524a565b6000806040838503121561529257600080fd5b823567ffffffffffffffff808211156152aa57600080fd5b818501915085601f8301126152be57600080fd5b813560206152cb826150cc565b6040516152d88282614f69565b83815260059390931b85018201928281019150898411156152f857600080fd5b948201945b8386101561531f57853561531081614d11565b825294820194908201906152fd565b9650508601359250508082111561533557600080fd5b506147e6858286016150f0565b600081518084526020808501945080840160005b8381101561537257815187529582019590820190600101615356565b509495945050505050565b6020815260006109966020830184615342565b6000806000606084860312156153a557600080fd5b83356153b081614d11565b925060208401356153c081614d11565b929592945050506040919091013590565b6000806000606084860312156153e657600080fd5b83359250602084013591506153fd60408501614e31565b90509250925092565b60008060006060848603121561541b57600080fd5b83359250602084013561542d81614d11565b9150604084013561543d81614d11565b809150509250925092565b60008060008060006080868803121561546057600080fd5b853567ffffffffffffffff81111561547757600080fd5b61548388828901614e7a565b909650945050602086013561549781614d11565b92506154a56040870161524a565b915060608601356154b581614d11565b809150509295509295909350565b801515811461259357600080fd5b600080604083850312156154e457600080fd5b82356154ef81614d11565b91506020830135614e26816154c3565b60008060008060008060a0878903121561551857600080fd5b863567ffffffffffffffff81111561552f57600080fd5b61553b89828a01614e7a565b909750955050602087013561554f81614d11565b935060408701359250606087013561556681614d11565b91506155746080880161524a565b90509295509295509295565b6000806040838503121561559357600080fd5b82359150614e716020840161501a565b600080604083850312156155b657600080fd5b50508035926020909101359150565b60008060008060008060a087890312156155de57600080fd5b86359550602087013567ffffffffffffffff8111156155fc57600080fd5b61560889828a01614e7a565b909650945050604087013561561c81614d11565b925061562a6060880161501a565b915061557460808801614e31565b6000806000806040858703121561564e57600080fd5b843567ffffffffffffffff8082111561566657600080fd5b61567288838901614e7a565b9096509450602087013591508082111561568b57600080fd5b5061569887828801614e7a565b95989497509550505050565b600080600080608085870312156156ba57600080fd5b8435935060208501356156cc81614d11565b9250604085013561523181614d11565b6000806000606084860312156156f157600080fd5b8335925060208401359150604084013561543d81614d11565b6000806040838503121561571d57600080fd5b823561572881614d11565b91506020830135614e2681614d11565b6000806000806060858703121561574e57600080fd5b843567ffffffffffffffff81111561576557600080fd5b61577187828801614e7a565b909550935050602085013561578581614d11565b9150604085013561579581614d11565b939692955090935050565b600080600080600060a086880312156157b857600080fd5b85356157c381614d11565b945060208601356157d381614d11565b93506040860135925060608601359150608086013567ffffffffffffffff8111156157fd57600080fd5b6151f788828901614fbe565b60006020828403121561581b57600080fd5b815167ffffffffffffffff81111561583257600080fd5b8201601f8101841361584357600080fd5b805161584e81614f96565b60405161585b8282614f69565b82815286602084860101111561587057600080fd5b610a73836020830160208701614d9e565b6000806000806080858703121561589757600080fd5b843567ffffffffffffffff8111156158ae57600080fd5b6158ba87828801614fbe565b94505060208501356158cb81614d11565b92506158d96040860161524a565b9150606085013561579581614d11565b6000602082840312156158fb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b67ffffffffffffffff81811683821601908082111561593957615939615902565b5092915050565b600181811c9082168061595457607f821691505b60208210810361597457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000600182016159a2576159a2615902565b5060010190565b6040815260006159bc6040830185615342565b82810360208401526159ce8185615342565b95945050505050565b6000602082840312156159e957600080fd5b815161099681614d11565b600060208284031215615a0657600080fd5b8151610996816154c3565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60c081526000615a5e60c083018a8c615a21565b6001600160a01b03898116602085015263ffffffff8916604085015267ffffffffffffffff881660608501528616608084015282810360a0840152615aa4818587615a21565b9b9a5050505050505050505050565b601f8211156109de57600081815260208120601f850160051c81016020861015615ada5750805b601f850160051c820191505b81811015613bc157828155600101615ae6565b67ffffffffffffffff831115615b1157615b11614f53565b615b2583615b1f8354615940565b83615ab3565b6000601f841160018114615b595760008515615b415750838201355b600019600387901b1c1916600186901b1783556114d7565b600083815260209020601f19861690835b82811015615b8a5786850135825560209485019460019092019101615b6a565b5086821015615ba75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b67ffffffffffffffff82811682821603908082111561593957615939615902565b815167ffffffffffffffff811115615bf457615bf4614f53565b615c0881615c028454615940565b84615ab3565b602080601f831160018114615c3d5760008415615c255750858301515b600019600386901b1c1916600185901b178555613bc1565b600085815260208120601f198616915b82811015615c6c57888601518255948401946001909101908401615c4d565b5085821015615c8a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615cc660a0830186615342565b8281036060840152615cd88186615342565b90508281036080840152613d038185614dc2565b600060208284031215615cfe57600080fd5b815161099681614d6b565b600060033d1115615d225760046000803e5060005160e01c5b90565b600060443d1015615d335790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715615d6357505050505090565b8285019150815181811115615d7b5750505050505090565b843d8701016020828501011115615d955750505050505090565b615da460208286010187614f69565b509095945050505050565b608081526000615dc26080830187614dc2565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b818103818111156108c9576108c9615902565b808201808211156108c9576108c9615902565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615e5a816001850160208801614d9e565b835190830190615e71816001840160208801614d9e565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615eb660a0830184614dc2565b97965050505050505056fea26469706673582212204f37b28dc45c53fb37759a47de9637b4ff115b46e39238a82dadf100cccbc4dc64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061031f5760003560e01c80636352211e116101a7578063c93ab3fd116100ee578063e985e9c511610097578063f242432a11610071578063f242432a146107d7578063f2fde38b146107ea578063fd0cd0d9146107fd57600080fd5b8063e985e9c514610768578063eb8ae530146107a4578063ed70554d146107b757600080fd5b8063d9a50c12116100c8578063d9a50c121461071f578063da8c229e14610732578063e0dba60f1461075557600080fd5b8063c93ab3fd146106e6578063cf408823146106f9578063d8c9921a1461070c57600080fd5b8063a22cb46511610150578063b6bcad261161012a578063b6bcad26146106ad578063c475abff146106c0578063c658e086146106d357600080fd5b8063a22cb46514610674578063a401498214610687578063adf4960a1461069a57600080fd5b80638b4dfa75116101815780638b4dfa751461063d5780638cf8b41e146106505780638da5cb5b1461066357600080fd5b80636352211e146105f65780636e5d6ad214610609578063715018a61461063557600080fd5b80631f4e15041161026b5780633f15457f116102145780634e1273f4116101ee5780634e1273f4146105b057806353095467146105d05780635d3590d5146105e357600080fd5b80633f15457f1461054e578063402906fc1461057557806341415eab1461059d57600080fd5b80632b20e397116102455780632b20e397146105015780632eb2c2d61461052857806333c69ea91461053b57600080fd5b80631f4e1504146104c857806320c38e2b146104db57806324c1af44146104ee57600080fd5b80630e4cd725116102cd578063150b7a02116102a7578063150b7a02146104765780631534e177146104a25780631896f70a146104b557600080fd5b80630e4cd7251461043d5780630e89341c1461045057806314ab90381461046357600080fd5b806306fdde03116102fe57806306fdde03146103b4578063081812fc146103fd578063095ea7b31461042857600080fd5b8062fdd58e146103245780630178fe3f1461034a57806301ffc9a714610391575b600080fd5b610337610332366004614d26565b610810565b6040519081526020015b60405180910390f35b61035d610358366004614d52565b6108cf565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff1690820152606001610341565b6103a461039f366004614d81565b6108ff565b6040519015158152602001610341565b6103f06040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516103419190614dee565b61041061040b366004614d52565b610958565b6040516001600160a01b039091168152602001610341565b61043b610436366004614d26565b61099d565b005b6103a461044b366004614e01565b6109e3565b6103f061045e366004614d52565b610a7d565b61043b610471366004614e4e565b610aef565b610489610484366004614ec3565b610c08565b6040516001600160e01b03199091168152602001610341565b61043b6104b0366004614f36565b610e1a565b61043b6104c3366004614e01565b610e44565b600754610410906001600160a01b031681565b6103f06104e9366004614d52565b610f06565b6103376104fc36600461502e565b610fa0565b6104107f000000000000000000000000000000000000000000000000000000000000000081565b61043b610536366004615156565b6111b4565b61043b610549366004615204565b6114de565b6104107f000000000000000000000000000000000000000000000000000000000000000081565b61058861058336600461525c565b6116d3565b60405163ffffffff9091168152602001610341565b6103a46105ab366004614e01565b611775565b6105c36105be36600461527f565b6117d2565b604051610341919061537d565b600554610410906001600160a01b031681565b61043b6105f1366004615390565b611910565b610410610604366004614d52565b6119aa565b61061c6106173660046153d1565b6119b5565b60405167ffffffffffffffff9091168152602001610341565b61043b611b0a565b61043b61064b366004615406565b611b1e565b61061c61065e366004615448565b611cc8565b6000546001600160a01b0316610410565b61043b6106823660046154d1565b612094565b6103376106953660046154ff565b61217e565b6103a46106a8366004615580565b612319565b61043b6106bb366004614f36565b61233e565b6103376106ce3660046155a3565b612596565b6103376106e13660046155c5565b61288d565b61043b6106f4366004615638565b612a9a565b61043b6107073660046156a4565b612c0b565b61043b61071a3660046156dc565b612dc4565b6103a461072d3660046155a3565b612ed4565b6103a4610740366004614f36565b60046020526000908152604090205460ff1681565b61043b6107633660046154d1565b612fe1565b6103a461077636600461570a565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61043b6107b2366004615738565b613049565b6103376107c5366004614d52565b60016020526000908152604090205481565b61043b6107e53660046157a0565b613414565b61043b6107f8366004614f36565b613531565b6103a461080b366004614d52565b6135be565b60006001600160a01b0383166108935760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061089e836119aa565b9050836001600160a01b0316816001600160a01b0316036108c35760019150506108c9565b60009150505b92915050565b60008181526001602052604090205460a081901c60c082901c6108f3838383613696565b90959094509092509050565b60006001600160e01b031982167fd82c42d800000000000000000000000000000000000000000000000000000000148061094957506001600160e01b03198216630a85bd0160e11b145b806108c957506108c9826136cd565b600080610964836119aa565b90506001600160a01b03811661097d5750600092915050565b6000838152600360205260409020546001600160a01b03165b9392505050565b60006109a8826108cf565b50915050603f1960408216016109d45760405163a2a7201360e01b81526004810183905260240161088a565b6109de838361374f565b505050565b60008080806109f1866108cf565b925092509250846001600160a01b0316836001600160a01b03161480610a3c57506001600160a01b0380841660009081526002602090815260408083209389168352929052205460ff165b80610a6057506001600160a01b038516610a5587610958565b6001600160a01b0316145b8015610a735750610a718282613899565b155b9695505050505050565b6005546040516303a24d0760e21b8152600481018390526060916001600160a01b031690630e89341c90602401600060405180830381865afa158015610ac7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108c99190810190615809565b81610afa8133611775565b610b205760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8260106000610b2e836108cf565b5091505063ffffffff8282161615610b5c5760405163a2a7201360e01b81526004810184905260240161088a565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c6c576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808080610c7d86880188615881565b83516020850120939750919550935091508890808214610cd3576040517fc65c3ccc000000000000000000000000000000000000000000000000000000008152600481018290526024810183905260440161088a565b604051630a3b53db60e21b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610d3b57600080fd5b505af1158015610d4f573d6000803e3d6000fd5b5050604051636b727d4360e11b8152600481018d9052600092506276a70091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d6e4fa8690602401602060405180830381865afa158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de491906158e9565b610dee9190615918565b9050610e0187878761ffff1684886138ca565b50630a85bd0160e11b9c9b505050505050505050505050565b610e22613a30565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b81610e4f8133611775565b610e755760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8260086000610e83836108cf565b5091505063ffffffff8282161615610eb15760405163a2a7201360e01b81526004810184905260240161088a565b604051630c4b7b8560e11b8152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610bce565b60066020526000908152604090208054610f1f90615940565b80601f0160208091040260200160405190810160405280929190818152602001828054610f4b90615940565b8015610f985780601f10610f6d57610100808354040283529160200191610f98565b820191906000526020600020905b815481529060010190602001808311610f7b57829003601f168201915b505050505081565b600087610fad8133611775565b610fd35760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8751602089012061100b8a82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92506110178a84613a8a565b6110218386613bc9565b61102c8a848b613bfc565b506110398a848787613cc9565b935061104483613d0f565b6110fa576040516305ef2c7f60e41b8152600481018b9052602481018290523060448201526001600160a01b03888116606483015267ffffffffffffffff881660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156110cf57600080fd5b505af11580156110e3573d6000803e3d6000fd5b505050506110f58a848b8b8989613dc8565b6111a7565b6040516305ef2c7f60e41b8152600481018b9052602481018290523060448201526001600160a01b03888116606483015267ffffffffffffffff881660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561118157600080fd5b505af1158015611195573d6000803e3d6000fd5b505050506111a78a848b8b8989613dff565b5050979650505050505050565b815183511461122b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161088a565b6001600160a01b03841661128f5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161088a565b6001600160a01b0385163314806112c957506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b61133b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161088a565b60005b835181101561147157600084828151811061135b5761135b61597a565b6020026020010151905060008483815181106113795761137961597a565b602002602001015190506000806000611391856108cf565b9250925092506113a2858383613ec3565b8360011480156113c357508a6001600160a01b0316836001600160a01b0316145b6114225760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b60008581526001602052604090206001600160a01b038b1663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905550505050508061146a90615990565b905061133e565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516114c19291906159a9565b60405180910390a46114d7338686868686613fb0565b5050505050565b604080516020808201879052818301869052825180830384018152606090920190925280519101206115108184613bc9565b6000808061151d846108cf565b919450925090506001600160a01b03831615806115cc57506040516302571be360e01b81526004810185905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906159d7565b6001600160a01b031614155b156115ea57604051635374b59960e01b815260040160405180910390fd5b6000806115f68a6108cf565b90935091508a90506116375761160c8633611775565b6116325760405163168ab55d60e31b81526004810187905233602482015260440161088a565b611667565b6116418a33611775565b6116675760405163168ab55d60e31b8152600481018b905233602482015260440161088a565b611672868984614155565b61167d878483614190565b9650620100008416158015906116a157508363ffffffff1688851763ffffffff1614155b156116c25760405163a2a7201360e01b81526004810187905260240161088a565b96831796610bfc86868a868b6141da565b6000826116e08133611775565b6117065760405163168ab55d60e31b81526004810182905233602482015260440161088a565b8360026000611714836108cf565b5091505063ffffffff82821616156117425760405163a2a7201360e01b81526004810184905260240161088a565b6000808061174f8a6108cf565b9250925092506117688a84848c61ffff161784856141da565b5098975050505050505050565b6000808080611783866108cf565b925092509250846001600160a01b0316836001600160a01b03161480610a6057506001600160a01b0380841660009081526002602090815260408083209389168352929052205460ff16610a60565b6060815183511461184b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161088a565b6000835167ffffffffffffffff81111561186757611867614f53565b604051908082528060200260200182016040528015611890578160200160208202803683370190505b50905060005b8451811015611908576118db8582815181106118b4576118b461597a565b60200260200101518583815181106118ce576118ce61597a565b6020026020010151610810565b8282815181106118ed576118ed61597a565b602090810291909101015261190181615990565b9050611896565b509392505050565b611918613a30565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a491906159f4565b50505050565b60006108c982614284565b604080516020808201869052818301859052825180830384018152606090920190925280519101206000906119e981613d0f565b611a0657604051635374b59960e01b815260040160405180910390fd5b6000611a1286336109e3565b905080158015611a295750611a278233611775565b155b15611a505760405163168ab55d60e31b81526004810183905233602482015260440161088a565b60008080611a5d856108cf565b92509250925083158015611a745750620400008216155b15611a955760405163a2a7201360e01b81526004810186905260240161088a565b6000611aa08a6108cf565b92505050611aaf888383614190565b9750611abd8685858b61429a565b60405167ffffffffffffffff8916815286907ff675815a0817338f93a7da433f6bd5f5542f1029b11b455191ac96c7f6a9b1329060200160405180910390a2509598975050505050505050565b611b12613a30565b611b1c60006142e2565b565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611b728133611775565b611b985760405163168ab55d60e31b81526004810182905233602482015260440161088a565b306001600160a01b03841603611bcc57604051632ca49b0d60e11b81526001600160a01b038416600482015260240161088a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611c21905b83614332565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015611caa57600080fd5b505af1158015611cbe573d6000803e3d6000fd5b5050505050505050565b6000808686604051611cdb929190615a11565b6040519081900381206331a9108f60e11b82526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f91906159d7565b90506001600160a01b0381163314801590611e17575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015611df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1591906159f4565b155b15611e8757604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a40161088a565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b158015611f1057600080fd5b505af1158015611f24573d6000803e3d6000fd5b5050604051630a3b53db60e21b8152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b158015611f9057600080fd5b505af1158015611fa4573d6000803e3d6000fd5b5050604051636b727d4360e11b8152600481018590526276a70092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063d6e4fa8690602401602060405180830381865afa158015612012573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203691906158e9565b6120409190615918565b925061208988888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250505061ffff881686886138ca565b505095945050505050565b6001600160a01b03821633036121125760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161088a565b3360008181526002602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081526004602052604081205460ff166121ee5760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b606482015260840161088a565b60008787604051612200929190615a11565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820187905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015612295573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b991906158e9565b915061230e88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250505061ffff86166123086276a70087615918565b886138ca565b509695505050505050565b600080612325846108cf565b50841663ffffffff908116908516149250505092915050565b612346613a30565b6007546001600160a01b0316156124665760075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156123c657600080fd5b505af11580156123da573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561244d57600080fd5b505af1158015612461573d6000803e3d6000fd5b505050505b600780546001600160a01b0319166001600160a01b038316908117909155156125935760075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156124f857600080fd5b505af115801561250c573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561257f57600080fd5b505af11580156114d7573d6000803e3d6000fd5b50565b3360009081526004602052604081205460ff166126065760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b606482015260840161088a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101869052602481018590529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c475abff906044016020604051808303816000875af11580156126e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270491906158e9565b6040516331a9108f60e11b8152600481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa925050508015612788575060408051601f3d908101601f19168201909252612785918101906159d7565b60015b6127955791506108c99050565b6001600160a01b0381163014158061283f57506040516302571be360e01b81526004810184905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561280f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283391906159d7565b6001600160a01b031614155b1561284e575091506108c99050565b50600061285e6276a70083615918565b60008481526001602052604090205490915060a081901c6128818583838661429a565b50919695505050505050565b60008661289a8133611775565b6128c05760405163168ab55d60e31b81526004810182905233602482015260440161088a565b600087876040516128d2929190615a11565b6040518091039020905061290d8982604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92506129198984613a8a565b6129238386613bc9565b60006129668a858b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613bfc92505050565b90506129748a858888613cc9565b945061297f84613d0f565b612a47576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018b9052602481018390523060448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906306ab5923906064016020604051808303816000875af1158015612a10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3491906158e9565b50612a428482898989614424565b612a8d565b612a8d8a858b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508c91508b9050613dff565b5050509695505050505050565b6000612ae0600086868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144669050565b6007549091506001600160a01b0316612b25576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b2f8133611775565b612b555760405163168ab55d60e31b81526004810182905233602482015260440161088a565b60008080612b62846108cf565b919450925090506000612b7485610958565b9050612b7f85614525565b600760009054906101000a90046001600160a01b03166001600160a01b0316639198c2768a8a878787878e8e6040518963ffffffff1660e01b8152600401612bce989796959493929190615a4a565b600060405180830381600087803b158015612be857600080fd5b505af1158015612bfc573d6000803e3d6000fd5b50505050505050505050505050565b83612c168133611775565b612c3c5760405163168ab55d60e31b81526004810182905233602482015260440161088a565b84601c6000612c4a836108cf565b5091505063ffffffff8282161615612c785760405163a2a7201360e01b81526004810184905260240161088a565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b158015612d1157600080fd5b505af1158015612d25573d6000803e3d6000fd5b5050506001600160a01b0388169050612d8c576000612d43896108cf565b509150506201ffff1962020000821601612d7b57604051632ca49b0d60e11b81526001600160a01b038916600482015260240161088a565b612d86896000614332565b50611cbe565b6000612d97896119aa565b9050612db981898b60001c6001604051806020016040528060008152506145e7565b505050505050505050565b60408051602080820186905281830185905282518083038401815260609092019092528051910120612df68133611775565b612e1c5760405163168ab55d60e31b81526004810182905233602482015260440161088a565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612e5c5760405163615a470360e01b815260040160405180910390fd5b6001600160a01b0382161580612e7a57506001600160a01b03821630145b15612ea357604051632ca49b0d60e11b81526001600160a01b038316600482015260240161088a565b604080516020808201879052818301869052825180830384018152606090920190925280519101206119a490611c1b565b604080516020808201859052818301849052825180830384018152606090920190925280519101206000906000612f0a82613d0f565b90507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae8514612f3c5791506108c99050565b6040516331a9108f60e11b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa925050508015612fbd575060408051601f3d908101601f19168201909252612fba918101906159d7565b60015b612fcc576000925050506108c9565b6001600160a01b0316301492506108c9915050565b612fe9613a30565b6001600160a01b038216600081815260046020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b600080613090600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506147399050565b9150915060006130d98288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506144669050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091506000906000818152600660205260409020909150613123888a83615af9565b507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5282016131645760405163615a470360e01b815260040160405180910390fd5b6040516302571be360e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa1580156131cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131f091906159d7565b90506001600160a01b0381163314801590613298575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015613272573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329691906159f4565b155b156132bf5760405163168ab55d60e31b81526004810183905233602482015260440161088a565b6001600160a01b0386161561335157604051630c4b7b8560e11b8152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b15801561333857600080fd5b505af115801561334c573d6000803e3d6000fd5b505050505b604051635b0fc9c360e01b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b1580156133b957600080fd5b505af11580156133cd573d6000803e3d6000fd5b50505050612db9828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d93509150819050614424565b6001600160a01b0384166134785760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161088a565b6001600160a01b0385163314806134b257506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6135245760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f7665640000000000000000000000000000000000000000000000606482015260840161088a565b6114d785858585856145e7565b613539613a30565b6001600160a01b0381166135b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161088a565b612593816142e2565b600081815260066020526040812080548291906135da90615940565b80601f016020809104026020016040519081016040528092919081815260200182805461360690615940565b80156136535780601f1061362857610100808354040283529160200191613653565b820191906000526020600020905b81548152906001019060200180831161363657829003601f168201915b50505050509050805160000361366c5750600092915050565b6000806136798382614739565b9092509050600061368a8483614466565b9050610a738184612ed4565b600080428367ffffffffffffffff1610156136c45761ffff19620100008516016136bf57600094505b600093505b50929391925050565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061371757506001600160e01b031982166303a24d0760e21b145b806108c957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108c9565b600061375a826119aa565b9050806001600160a01b0316836001600160a01b0316036137e35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161088a565b336001600160a01b038216148061381d57506001600160a01b038116600090815260026020908152604080832033845290915290205460ff165b61388f5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840161088a565b6109de83836147f0565b6000620200008381161480156109965750426138b86276a70084615bb9565b67ffffffffffffffff16109392505050565b8451602086012060006139247f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000613967886040518060400160405280600581526020017f036574680000000000000000000000000000000000000000000000000000000081525061485e565b60008381526006602052604090209091506139828282615bda565b50613995828289620300008a1789614424565b6001600160a01b03841615611cbe57604051630c4b7b8560e11b8152600481018390526001600160a01b0385811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015613a0e57600080fd5b505af1158015613a22573d6000803e3d6000fd5b505050505050505050505050565b6000546001600160a01b03163314611b1c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161088a565b60008080613a97846108cf565b919450925090504267ffffffffffffffff821610808015613b5b57506001600160a01b0384161580613b5b57506040516302571be360e01b8152600481018690526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015613b2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b5091906159d7565b6001600160a01b0316145b15613b9a576000613b6b876108cf565b509150506020811615613b945760405163a2a7201360e01b81526004810187905260240161088a565b50613bc1565b62010000831615613bc15760405163a2a7201360e01b81526004810186905260240161088a565b505050505050565b63fffdffff81811763ffffffff1614613bf85760405163a2a7201360e01b81526004810183905260240161088a565b5050565b60606000613ca583600660008881526020019081526020016000208054613c2290615940565b80601f0160208091040260200160405190810160405280929190818152602001828054613c4e90615940565b8015613c9b5780601f10613c7057610100808354040283529160200191613c9b565b820191906000526020600020905b815481529060010190602001808311613c7e57829003601f168201915b505050505061485e565b6000858152600660205260409020909150613cc08282615bda565b50949350505050565b600080613cd5856108cf565b92505050600080613ce88860001c6108cf565b9250925050613cf8878784614155565b613d03858483614190565b98975050505050505050565b600080613d1b836119aa565b6001600160a01b0316141580156108c957506040516302571be360e01b81526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015613d94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613db891906159d7565b6001600160a01b03161492915050565b60008681526006602052604081208054613de7918791613c2290615940565b9050613df68682868686614424565b50505050505050565b60008080613e0c886108cf565b9250925092506000613e3688600660008d81526020019081526020016000208054613c2290615940565b60008a8152600660205260409020805491925090613e5390615940565b9050600003613e76576000898152600660205260409020613e748282615bda565b505b613e85898588861785896141da565b6001600160a01b038716613ea357613e9e896000614332565b610bfc565b610bfc84888b60001c6001604051806020016040528060008152506145e7565b6201ffff1962020000831601613ee357613ee06276a70082615bb9565b90505b428167ffffffffffffffff161015613f605762010000821615613f5b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b613f85565b6004821615613f855760405163a2a7201360e01b81526004810184905260240161088a565b604082166000036109de575050600090815260036020526040902080546001600160a01b0319169055565b6001600160a01b0384163b15613bc15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613ff49089908990889088908890600401615c9a565b6020604051808303816000875af192505050801561402f575060408051601f3d908101601f1916820190925261402c91810190615cec565b60015b6140e45761403b615d09565b806308c379a003614074575061404f615d25565b8061405a5750614076565b8060405162461bcd60e51b815260040161088a9190614dee565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161088a565b6001600160e01b0319811663bc197c8160e01b14613df65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161088a565b63ffff0000821615801590600183161590829061416f5750805b156114d75760405163a2a7201360e01b81526004810186905260240161088a565b60008167ffffffffffffffff168467ffffffffffffffff1611156141b2578193505b8267ffffffffffffffff168467ffffffffffffffff1610156141d2578293505b509192915050565b6141e68585858461429a565b60405163ffffffff8416815285907f39873f00c80f4f94b7bd1594aebcf650f003545b74824d57ddf4939e3ff3a34b9060200160405180910390a28167ffffffffffffffff168167ffffffffffffffff1611156114d75760405167ffffffffffffffff8216815285907ff675815a0817338f93a7da433f6bd5f5542f1029b11b455191ac96c7f6a9b132906020015b60405180910390a25050505050565b600080614290836108cf565b5090949350505050565b6142a48483614907565b60008481526001602052604090206001600160a01b03841663ffffffff60a01b60a085901b16176001600160c01b031960c084901b161790556119a4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61433d826001612319565b1561435e5760405163a2a7201360e01b81526004810183905260240161088a565b61436782614525565b604051635b0fc9c360e01b8152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b1580156143d157600080fd5b505af11580156143e5573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c4915060200161303d565b61443085848484614940565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516142759493929190615daf565b60008060006144758585614739565b9092509050816144e7576001855161448d9190615df7565b84146144db5760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d65000000604482015260640161088a565b50600091506108c99050565b6144f18582614466565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b60008181526001602052604090205460a081901c60c082901c614549838383613696565b600086815260036020908152604080832080546001600160a01b03191690556001909152902063ffffffff60a01b60a083901b166001600160c01b031960c086901b1617905592506145989050565b60408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b60008060006145f5866108cf565b925092509250614606868383613ec3565b8460011480156146275750876001600160a01b0316836001600160a01b0316145b6146865760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161088a565b866001600160a01b0316836001600160a01b0316036146a7575050506114d7565b60008681526001602052604090206001600160a01b03881663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611cbe3389898989896149b4565b6000808351831061478c5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e64730000604482015260640161088a565b60008484815181106147a0576147a061597a565b016020015160f81c905080156147cc576147c5856147bf866001615e0a565b83614ab0565b92506147d1565b600092505b6147db8185615e0a565b6147e6906001615e0a565b9150509250929050565b600081815260036020526040902080546001600160a01b0319166001600160a01b0384169081179091558190614825826119aa565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b606060018351101561489c576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff835111156148da57826040517fe3ba295f00000000000000000000000000000000000000000000000000000000815260040161088a9190614dee565b825183836040516020016148f093929190615e1d565b604051602081830303815290604052905092915050565b61ffff81161580159061491f57506201000181811614155b15613bf85760405163a2a7201360e01b81526004810183905260240161088a565b61494a8483614907565b6000848152600160205260409020546001600160a01b038116156149a85761497185614525565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6114d785858585614ad4565b6001600160a01b0384163b15613bc15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906149f89089908990889088908890600401615e7e565b6020604051808303816000875af1925050508015614a33575060408051601f3d908101601f19168201909252614a3091810190615cec565b60015b614a3f5761403b615d09565b6001600160e01b0319811663f23a6e6160e01b14613df65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161088a565b8251600090614abf8385615e0a565b1115614aca57600080fd5b5091016020012090565b8360008080614ae2846108cf565b9194509250905063ffff0000821667ffffffffffffffff8087169083161115614b09578195505b428267ffffffffffffffff1610614b1f57958617955b6001600160a01b03841615614b765760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e00604482015260640161088a565b6001600160a01b038816614bf25760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161088a565b306001600160a01b03891603614c705760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e7472616374000000000000000000000000606482015260840161088a565b60008581526001602052604090206001600160a01b03891663ffffffff60a01b60a08a901b16176001600160c01b031960c089901b1617905560408051868152600160208201526001600160a01b038a169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612db93360008a886001604051806020016040528060008152506149b4565b6001600160a01b038116811461259357600080fd5b60008060408385031215614d3957600080fd5b8235614d4481614d11565b946020939093013593505050565b600060208284031215614d6457600080fd5b5035919050565b6001600160e01b03198116811461259357600080fd5b600060208284031215614d9357600080fd5b813561099681614d6b565b60005b83811015614db9578181015183820152602001614da1565b50506000910152565b60008151808452614dda816020860160208601614d9e565b601f01601f19169290920160200192915050565b6020815260006109966020830184614dc2565b60008060408385031215614e1457600080fd5b823591506020830135614e2681614d11565b809150509250929050565b803567ffffffffffffffff81168114614e4957600080fd5b919050565b60008060408385031215614e6157600080fd5b82359150614e7160208401614e31565b90509250929050565b60008083601f840112614e8c57600080fd5b50813567ffffffffffffffff811115614ea457600080fd5b602083019150836020828501011115614ebc57600080fd5b9250929050565b600080600080600060808688031215614edb57600080fd5b8535614ee681614d11565b94506020860135614ef681614d11565b935060408601359250606086013567ffffffffffffffff811115614f1957600080fd5b614f2588828901614e7a565b969995985093965092949392505050565b600060208284031215614f4857600080fd5b813561099681614d11565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715614f8f57614f8f614f53565b6040525050565b600067ffffffffffffffff821115614fb057614fb0614f53565b50601f01601f191660200190565b600082601f830112614fcf57600080fd5b8135614fda81614f96565b604051614fe78282614f69565b828152856020848701011115614ffc57600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614e4957600080fd5b600080600080600080600060e0888a03121561504957600080fd5b87359650602088013567ffffffffffffffff81111561506757600080fd5b6150738a828b01614fbe565b965050604088013561508481614d11565b9450606088013561509481614d11565b93506150a260808901614e31565b92506150b060a0890161501a565b91506150be60c08901614e31565b905092959891949750929550565b600067ffffffffffffffff8211156150e6576150e6614f53565b5060051b60200190565b600082601f83011261510157600080fd5b8135602061510e826150cc565b60405161511b8282614f69565b83815260059390931b850182019282810191508684111561513b57600080fd5b8286015b8481101561230e578035835291830191830161513f565b600080600080600060a0868803121561516e57600080fd5b853561517981614d11565b9450602086013561518981614d11565b9350604086013567ffffffffffffffff808211156151a657600080fd5b6151b289838a016150f0565b945060608801359150808211156151c857600080fd5b6151d489838a016150f0565b935060808801359150808211156151ea57600080fd5b506151f788828901614fbe565b9150509295509295909350565b6000806000806080858703121561521a57600080fd5b84359350602085013592506152316040860161501a565b915061523f60608601614e31565b905092959194509250565b803561ffff81168114614e4957600080fd5b6000806040838503121561526f57600080fd5b82359150614e716020840161524a565b6000806040838503121561529257600080fd5b823567ffffffffffffffff808211156152aa57600080fd5b818501915085601f8301126152be57600080fd5b813560206152cb826150cc565b6040516152d88282614f69565b83815260059390931b85018201928281019150898411156152f857600080fd5b948201945b8386101561531f57853561531081614d11565b825294820194908201906152fd565b9650508601359250508082111561533557600080fd5b506147e6858286016150f0565b600081518084526020808501945080840160005b8381101561537257815187529582019590820190600101615356565b509495945050505050565b6020815260006109966020830184615342565b6000806000606084860312156153a557600080fd5b83356153b081614d11565b925060208401356153c081614d11565b929592945050506040919091013590565b6000806000606084860312156153e657600080fd5b83359250602084013591506153fd60408501614e31565b90509250925092565b60008060006060848603121561541b57600080fd5b83359250602084013561542d81614d11565b9150604084013561543d81614d11565b809150509250925092565b60008060008060006080868803121561546057600080fd5b853567ffffffffffffffff81111561547757600080fd5b61548388828901614e7a565b909650945050602086013561549781614d11565b92506154a56040870161524a565b915060608601356154b581614d11565b809150509295509295909350565b801515811461259357600080fd5b600080604083850312156154e457600080fd5b82356154ef81614d11565b91506020830135614e26816154c3565b60008060008060008060a0878903121561551857600080fd5b863567ffffffffffffffff81111561552f57600080fd5b61553b89828a01614e7a565b909750955050602087013561554f81614d11565b935060408701359250606087013561556681614d11565b91506155746080880161524a565b90509295509295509295565b6000806040838503121561559357600080fd5b82359150614e716020840161501a565b600080604083850312156155b657600080fd5b50508035926020909101359150565b60008060008060008060a087890312156155de57600080fd5b86359550602087013567ffffffffffffffff8111156155fc57600080fd5b61560889828a01614e7a565b909650945050604087013561561c81614d11565b925061562a6060880161501a565b915061557460808801614e31565b6000806000806040858703121561564e57600080fd5b843567ffffffffffffffff8082111561566657600080fd5b61567288838901614e7a565b9096509450602087013591508082111561568b57600080fd5b5061569887828801614e7a565b95989497509550505050565b600080600080608085870312156156ba57600080fd5b8435935060208501356156cc81614d11565b9250604085013561523181614d11565b6000806000606084860312156156f157600080fd5b8335925060208401359150604084013561543d81614d11565b6000806040838503121561571d57600080fd5b823561572881614d11565b91506020830135614e2681614d11565b6000806000806060858703121561574e57600080fd5b843567ffffffffffffffff81111561576557600080fd5b61577187828801614e7a565b909550935050602085013561578581614d11565b9150604085013561579581614d11565b939692955090935050565b600080600080600060a086880312156157b857600080fd5b85356157c381614d11565b945060208601356157d381614d11565b93506040860135925060608601359150608086013567ffffffffffffffff8111156157fd57600080fd5b6151f788828901614fbe565b60006020828403121561581b57600080fd5b815167ffffffffffffffff81111561583257600080fd5b8201601f8101841361584357600080fd5b805161584e81614f96565b60405161585b8282614f69565b82815286602084860101111561587057600080fd5b610a73836020830160208701614d9e565b6000806000806080858703121561589757600080fd5b843567ffffffffffffffff8111156158ae57600080fd5b6158ba87828801614fbe565b94505060208501356158cb81614d11565b92506158d96040860161524a565b9150606085013561579581614d11565b6000602082840312156158fb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b67ffffffffffffffff81811683821601908082111561593957615939615902565b5092915050565b600181811c9082168061595457607f821691505b60208210810361597457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000600182016159a2576159a2615902565b5060010190565b6040815260006159bc6040830185615342565b82810360208401526159ce8185615342565b95945050505050565b6000602082840312156159e957600080fd5b815161099681614d11565b600060208284031215615a0657600080fd5b8151610996816154c3565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60c081526000615a5e60c083018a8c615a21565b6001600160a01b03898116602085015263ffffffff8916604085015267ffffffffffffffff881660608501528616608084015282810360a0840152615aa4818587615a21565b9b9a5050505050505050505050565b601f8211156109de57600081815260208120601f850160051c81016020861015615ada5750805b601f850160051c820191505b81811015613bc157828155600101615ae6565b67ffffffffffffffff831115615b1157615b11614f53565b615b2583615b1f8354615940565b83615ab3565b6000601f841160018114615b595760008515615b415750838201355b600019600387901b1c1916600186901b1783556114d7565b600083815260209020601f19861690835b82811015615b8a5786850135825560209485019460019092019101615b6a565b5086821015615ba75760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b67ffffffffffffffff82811682821603908082111561593957615939615902565b815167ffffffffffffffff811115615bf457615bf4614f53565b615c0881615c028454615940565b84615ab3565b602080601f831160018114615c3d5760008415615c255750858301515b600019600386901b1c1916600185901b178555613bc1565b600085815260208120601f198616915b82811015615c6c57888601518255948401946001909101908401615c4d565b5085821015615c8a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615cc660a0830186615342565b8281036060840152615cd88186615342565b90508281036080840152613d038185614dc2565b600060208284031215615cfe57600080fd5b815161099681614d6b565b600060033d1115615d225760046000803e5060005160e01c5b90565b600060443d1015615d335790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715615d6357505050505090565b8285019150815181811115615d7b5750505050505090565b843d8701016020828501011115615d955750505050505090565b615da460208286010187614f69565b509095945050505050565b608081526000615dc26080830187614dc2565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b818103818111156108c9576108c9615902565b808201808211156108c9576108c9615902565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615e5a816001850160208801614d9e565b835190830190615e71816001840160208801614d9e565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615eb660a0830184614dc2565b97965050505050505056fea26469706673582212204f37b28dc45c53fb37759a47de9637b4ff115b46e39238a82dadf100cccbc4dc64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "allFusesBurned(bytes32,uint32)": { + "params": { + "fuseMask": "The fuses you want to check", + "node": "Namehash of the name" + }, + "returns": { + "_0": "Boolean of whether or not all the selected fuses are burned" + } + }, + "approve(address,uint256)": { + "params": { + "to": "address to approve", + "tokenId": "name to approve" + } + }, + "balanceOf(address,uint256)": { + "details": "See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address." + }, + "balanceOfBatch(address[],uint256[])": { + "details": "See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length." + }, + "canExtendSubnames(bytes32,address)": { + "params": { + "addr": "which address to check permissions for", + "node": "namehash of the name to check" + }, + "returns": { + "_0": "whether or not is owner/operator or approved" + } + }, + "canModifyName(bytes32,address)": { + "params": { + "addr": "which address to check permissions for", + "node": "namehash of the name to check" + }, + "returns": { + "_0": "whether or not is owner or operator" + } + }, + "extendExpiry(bytes32,bytes32,uint64)": { + "params": { + "expiry": "When the name will expire in seconds since the Unix epoch", + "labelhash": "Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')", + "parentNode": "Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')" + }, + "returns": { + "_0": "New expiry" + } + }, + "getApproved(uint256)": { + "params": { + "id": "Namehash of the name" + }, + "returns": { + "operator": "Approved operator of a name" + } + }, + "getData(uint256)": { + "params": { + "id": "Namehash of the name" + }, + "returns": { + "expiry": "Expiry of the name", + "fuses": "Fuses of the name", + "owner": "Owner of the name" + } + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC1155-isApprovedForAll}." + }, + "isWrapped(bytes32)": { + "params": { + "node": "Namehash of the name" + }, + "returns": { + "_0": "Boolean of whether or not the name is wrapped" + } + }, + "isWrapped(bytes32,bytes32)": { + "params": { + "labelhash": "Namehash of the name", + "parentNode": "Namehash of the name" + }, + "returns": { + "_0": "Boolean of whether or not the name is wrapped" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "ownerOf(uint256)": { + "params": { + "id": "Label as a string of the .eth domain to wrap" + }, + "returns": { + "owner": "The owner of the name" + } + }, + "recoverFunds(address,address,uint256)": { + "details": "The contract is Ownable and only the owner can call the recover function.", + "params": { + "_amount": "The amount of tokens to recover.", + "_to": "The address to send the tokens to.", + "_token": "The address of the ERC20 token to recover" + } + }, + "registerAndWrapETH2LD(string,address,uint256,address,uint16)": { + "details": "Registers a new .eth second-level domain and wraps it. Only callable by authorised controllers.", + "params": { + "duration": "The duration, in seconds, to register the name for.", + "label": "The label to register (Eg, 'foo' for 'foo.eth').", + "ownerControlledFuses": "Initial owner-controlled fuses to set", + "resolver": "The resolver address to set on the ENS registry (optional).", + "wrappedOwner": "The owner of the wrapped name." + }, + "returns": { + "registrarExpiry": "The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch." + } + }, + "renew(uint256,uint256)": { + "details": "Only callable by authorised controllers.", + "params": { + "duration": "The number of seconds to renew the name for.", + "tokenId": "The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth')." + }, + "returns": { + "expires": "The expiry date of the name on the .eth registrar, in seconds since the Unix epoch." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { + "details": "See {IERC1155-safeBatchTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,uint256,bytes)": { + "details": "See {IERC1155-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC1155-setApprovalForAll}." + }, + "setChildFuses(bytes32,bytes32,uint32,uint64)": { + "params": { + "expiry": "When the name will expire in seconds since the Unix epoch", + "fuses": "Fuses to burn", + "labelhash": "Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')", + "parentNode": "Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')" + } + }, + "setFuses(bytes32,uint16)": { + "params": { + "node": "Namehash of the name", + "ownerControlledFuses": "Owner-controlled fuses to burn" + }, + "returns": { + "_0": "Old fuses" + } + }, + "setMetadataService(address)": { + "params": { + "_metadataService": "The new metadata service" + } + }, + "setRecord(bytes32,address,address,uint64)": { + "params": { + "node": "Namehash of the name to set a record for", + "owner": "New owner in the registry", + "resolver": "Resolver contract", + "ttl": "Time to live in the registry" + } + }, + "setResolver(bytes32,address)": { + "params": { + "node": "namehash of the name", + "resolver": "the resolver contract" + } + }, + "setSubnodeOwner(bytes32,string,address,uint32,uint64)": { + "params": { + "expiry": "When the name will expire in seconds since the Unix epoch", + "fuses": "Initial fuses for the wrapped subdomain", + "label": "Label of the subdomain as a string", + "owner": "New owner in the wrapper", + "parentNode": "Parent namehash of the subdomain" + }, + "returns": { + "node": "Namehash of the subdomain" + } + }, + "setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)": { + "params": { + "expiry": "When the name will expire in seconds since the Unix epoch", + "fuses": "initial fuses for the wrapped subdomain", + "label": "label of the subdomain as a string", + "owner": "new owner in the wrapper", + "parentNode": "parent namehash of the subdomain", + "resolver": "resolver contract in the registry", + "ttl": "ttl in the registry" + }, + "returns": { + "node": "Namehash of the subdomain" + } + }, + "setTTL(bytes32,uint64)": { + "params": { + "node": "Namehash of the name", + "ttl": "TTL in the registry" + } + }, + "setUpgradeContract(address)": { + "details": "The default value of upgradeContract is the 0 address. Use the 0 address at any time to make the contract not upgradable.", + "params": { + "_upgradeAddress": "address of an upgraded contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unwrap(bytes32,bytes32,address)": { + "details": "Can be called by the owner in the wrapper or an authorised caller in the wrapper", + "params": { + "controller": "Sets the owner in the registry to this address", + "labelhash": "Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')", + "parentNode": "Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')" + } + }, + "unwrapETH2LD(bytes32,address,address)": { + "details": "Can be called by the owner in the wrapper or an authorised caller in the wrapper", + "params": { + "controller": "Sets the owner in the registry to this address", + "labelhash": "Labelhash of the .eth domain", + "registrant": "Sets the owner in the .eth registrar to this address" + } + }, + "upgrade(bytes,bytes)": { + "details": "Can be called by the owner or an authorised caller", + "params": { + "extraData": "Extra data to pass to the upgrade contract", + "name": "The name to upgrade, in DNS format" + } + }, + "uri(uint256)": { + "params": { + "tokenId": "The id of the token" + }, + "returns": { + "_0": "string uri of the metadata service" + } + }, + "wrap(bytes,address,address)": { + "details": "Can be called by the owner in the registry or an authorised caller in the registry", + "params": { + "name": "The name to wrap, in DNS format", + "resolver": "Resolver contract", + "wrappedOwner": "Owner of the name in this contract" + } + }, + "wrapETH2LD(string,address,uint16,address)": { + "details": "Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar", + "params": { + "label": "Label as a string of the .eth domain to wrap", + "ownerControlledFuses": "Initial owner-controlled fuses to set", + "resolver": "Resolver contract address", + "wrappedOwner": "Owner of the name in this contract" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "allFusesBurned(bytes32,uint32)": { + "notice": "Checks all Fuses in the mask are burned for the node" + }, + "approve(address,uint256)": { + "notice": "Approves an address for a name" + }, + "canExtendSubnames(bytes32,address)": { + "notice": "Checks if owner/operator or approved by owner" + }, + "canModifyName(bytes32,address)": { + "notice": "Checks if owner or operator of the owner" + }, + "extendExpiry(bytes32,bytes32,uint64)": { + "notice": "Extends expiry for a name" + }, + "getApproved(uint256)": { + "notice": "Gets the owner of a name" + }, + "getData(uint256)": { + "notice": "Gets the data for a name" + }, + "isWrapped(bytes32)": { + "notice": "Checks if a name is wrapped" + }, + "isWrapped(bytes32,bytes32)": { + "notice": "Checks if a name is wrapped in a more gas efficient way" + }, + "ownerOf(uint256)": { + "notice": "Gets the owner of a name" + }, + "recoverFunds(address,address,uint256)": { + "notice": "Recover ERC20 tokens sent to the contract by mistake." + }, + "renew(uint256,uint256)": { + "notice": "Renews a .eth second-level domain." + }, + "setChildFuses(bytes32,bytes32,uint32,uint64)": { + "notice": "Sets fuses of a name that you own the parent of" + }, + "setFuses(bytes32,uint16)": { + "notice": "Sets fuses of a name" + }, + "setMetadataService(address)": { + "notice": "Set the metadata service. Only the owner can do this" + }, + "setRecord(bytes32,address,address,uint64)": { + "notice": "Sets records for the name in the ENS Registry" + }, + "setResolver(bytes32,address)": { + "notice": "Sets resolver contract in the registry" + }, + "setSubnodeOwner(bytes32,string,address,uint32,uint64)": { + "notice": "Sets the subdomain owner in the registry and then wraps the subdomain" + }, + "setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)": { + "notice": "Sets the subdomain owner in the registry with records and then wraps the subdomain" + }, + "setTTL(bytes32,uint64)": { + "notice": "Sets TTL in the registry" + }, + "setUpgradeContract(address)": { + "notice": "Set the address of the upgradeContract of the contract. only admin can do this" + }, + "unwrap(bytes32,bytes32,address)": { + "notice": "Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain" + }, + "unwrapETH2LD(bytes32,address,address)": { + "notice": "Unwraps a .eth domain. e.g. vitalik.eth" + }, + "upgrade(bytes,bytes)": { + "notice": "Upgrades a domain of any kind. Could be a .eth name vitalik.eth, a DNSSEC name vitalik.xyz, or a subdomain" + }, + "uri(uint256)": { + "notice": "Get the metadata uri" + }, + "wrap(bytes,address,address)": { + "notice": "Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain" + }, + "wrapETH2LD(string,address,uint16,address)": { + "notice": "Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 20114, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_tokens", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 20120, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_operatorApprovals", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 20124, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_tokenApprovals", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 20045, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "controllers", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 21586, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "metadataService", + "offset": 0, + "slot": "5", + "type": "t_contract(IMetadataService)21088" + }, + { + "astId": 21590, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "names", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_bytes32,t_bytes_storage)" + }, + { + "astId": 21608, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "upgradeContract", + "offset": 0, + "slot": "7", + "type": "t_contract(INameWrapperUpgrade)21480" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IMetadataService)21088": { + "encoding": "inplace", + "label": "contract IMetadataService", + "numberOfBytes": "20" + }, + "t_contract(INameWrapperUpgrade)21480": { + "encoding": "inplace", + "label": "contract INameWrapperUpgrade", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/OwnedResolver.json b/deployments/sepolia/OwnedResolver.json new file mode 100644 index 00000000..a6d8f86d --- /dev/null +++ b/deployments/sepolia/OwnedResolver.json @@ -0,0 +1,1470 @@ +{ + "address": "0x15222A1C2Bf3A4c24eAd1634B8Ee399fd95c3aaf", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + } + ], + "name": "ABIChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "AddrChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "newAddress", + "type": "bytes" + } + ], + "name": "AddressChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "ContenthashChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "record", + "type": "bytes" + } + ], + "name": "DNSRecordChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "DNSRecordDeleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "lastzonehash", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "zonehash", + "type": "bytes" + } + ], + "name": "DNSZonehashChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "InterfaceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "NameChanged", + "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": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "PubkeyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "string", + "name": "indexedKey", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "TextChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "newVersion", + "type": "uint64" + } + ], + "name": "VersionChanged", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentTypes", + "type": "uint256" + } + ], + "name": "ABI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "clearRecords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "contenthash", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "dnsRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + } + ], + "name": "hasDNSRecords", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "interfaceImplementer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "pubkey", + "outputs": [ + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "recordVersions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "resolve", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setABI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "a", + "type": "bytes" + } + ], + "name": "setAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "setAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "setContenthash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setDNSRecords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "setInterface", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "setPubkey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setText", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "setZonehash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "text", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "zonehash", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xdbd6176317ff46ffb2a7f4e627c92ad9334f2363b354725fc8a91663cffc9e42", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x15222A1C2Bf3A4c24eAd1634B8Ee399fd95c3aaf", + "transactionIndex": 100, + "gasUsed": "2349764", + "logsBloom": "0x00000000000000000008000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000001000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000040008000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa1c5cb305cb936f0ecda7c3be41307c024b6fa9c69e420b4d5d02a26c1922969", + "transactionHash": "0xdbd6176317ff46ffb2a7f4e627c92ad9334f2363b354725fc8a91663cffc9e42", + "logs": [ + { + "transactionIndex": 100, + "blockNumber": 3790128, + "transactionHash": "0xdbd6176317ff46ffb2a7f4e627c92ad9334f2363b354725fc8a91663cffc9e42", + "address": "0x15222A1C2Bf3A4c24eAd1634B8Ee399fd95c3aaf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 193, + "blockHash": "0xa1c5cb305cb936f0ecda7c3be41307c024b6fa9c69e420b4d5d02a26c1922969" + } + ], + "blockNumber": 3790128, + "cumulativeGasUsed": "11479488", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 2, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"contentType\",\"type\":\"uint256\"}],\"name\":\"ABIChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"AddrChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newAddress\",\"type\":\"bytes\"}],\"name\":\"AddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"ContenthashChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"record\",\"type\":\"bytes\"}],\"name\":\"DNSRecordChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"}],\"name\":\"DNSRecordDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"lastzonehash\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"zonehash\",\"type\":\"bytes\"}],\"name\":\"DNSZonehashChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementer\",\"type\":\"address\"}],\"name\":\"InterfaceChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NameChanged\",\"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\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"PubkeyChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"indexedKey\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"name\":\"TextChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newVersion\",\"type\":\"uint64\"}],\"name\":\"VersionChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"contentTypes\",\"type\":\"uint256\"}],\"name\":\"ABI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"addr\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"}],\"name\":\"addr\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"clearRecords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"contenthash\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"}],\"name\":\"dnsRecord\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"hasDNSRecords\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"interfaceImplementer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"pubkey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"recordVersions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"contentType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setABI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"a\",\"type\":\"bytes\"}],\"name\":\"setAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"setAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"setContenthash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setDNSRecords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"implementer\",\"type\":\"address\"}],\"name\":\"setInterface\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"setPubkey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"name\":\"setText\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"setZonehash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"}],\"name\":\"text\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"zonehash\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"ABI(bytes32,uint256)\":{\"params\":{\"contentTypes\":\"A bitwise OR of the ABI formats accepted by the caller.\",\"node\":\"The ENS node to query\"},\"returns\":{\"_0\":\"contentType The content type of the return value\",\"_1\":\"data The ABI data\"}},\"addr(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated address.\"}},\"clearRecords(bytes32)\":{\"params\":{\"node\":\"The node to update.\"}},\"contenthash(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated contenthash.\"}},\"dnsRecord(bytes32,bytes32,uint16)\":{\"params\":{\"name\":\"the keccak-256 hash of the fully-qualified name for which to fetch the record\",\"node\":\"the namehash of the node for which to fetch the record\",\"resource\":\"the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\"},\"returns\":{\"_0\":\"the DNS record in wire format if present, otherwise empty\"}},\"hasDNSRecords(bytes32,bytes32)\":{\"params\":{\"name\":\"the namehash of the node for which to check the records\",\"node\":\"the namehash of the node for which to check the records\"}},\"interfaceImplementer(bytes32,bytes4)\":{\"params\":{\"interfaceID\":\"The EIP 165 interface ID to check for.\",\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The address that implements this interface, or 0 if the interface is unsupported.\"}},\"name(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated name.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pubkey(bytes32)\":{\"params\":{\"node\":\"The ENS node to query\"},\"returns\":{\"x\":\"The X coordinate of the curve point for the public key.\",\"y\":\"The Y coordinate of the curve point for the public key.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setABI(bytes32,uint256,bytes)\":{\"params\":{\"contentType\":\"The content type of the ABI\",\"data\":\"The ABI data.\",\"node\":\"The node to update.\"}},\"setAddr(bytes32,address)\":{\"params\":{\"a\":\"The address to set.\",\"node\":\"The node to update.\"}},\"setContenthash(bytes32,bytes)\":{\"params\":{\"hash\":\"The contenthash to set\",\"node\":\"The node to update.\"}},\"setDNSRecords(bytes32,bytes)\":{\"params\":{\"data\":\"the DNS wire format records to set\",\"node\":\"the namehash of the node for which to set the records\"}},\"setInterface(bytes32,bytes4,address)\":{\"params\":{\"implementer\":\"The address of a contract that implements this interface for this node.\",\"interfaceID\":\"The EIP 165 interface ID.\",\"node\":\"The node to update.\"}},\"setName(bytes32,string)\":{\"params\":{\"node\":\"The node to update.\"}},\"setPubkey(bytes32,bytes32,bytes32)\":{\"params\":{\"node\":\"The ENS node to query\",\"x\":\"the X coordinate of the curve point for the public key.\",\"y\":\"the Y coordinate of the curve point for the public key.\"}},\"setText(bytes32,string,string)\":{\"params\":{\"key\":\"The key to set.\",\"node\":\"The node to update.\",\"value\":\"The text data value to set.\"}},\"setZonehash(bytes32,bytes)\":{\"params\":{\"hash\":\"The zonehash to set\",\"node\":\"The node to update.\"}},\"text(bytes32,string)\":{\"params\":{\"key\":\"The text data key to query.\",\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated text data.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"zonehash(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated contenthash.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"ABI(bytes32,uint256)\":{\"notice\":\"Returns the ABI associated with an ENS node. Defined in EIP205.\"},\"addr(bytes32)\":{\"notice\":\"Returns the address associated with an ENS node.\"},\"clearRecords(bytes32)\":{\"notice\":\"Increments the record version associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"contenthash(bytes32)\":{\"notice\":\"Returns the contenthash associated with an ENS node.\"},\"dnsRecord(bytes32,bytes32,uint16)\":{\"notice\":\"Obtain a DNS record.\"},\"hasDNSRecords(bytes32,bytes32)\":{\"notice\":\"Check if a given node has records.\"},\"interfaceImplementer(bytes32,bytes4)\":{\"notice\":\"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.\"},\"name(bytes32)\":{\"notice\":\"Returns the name associated with an ENS node, for reverse records. Defined in EIP181.\"},\"pubkey(bytes32)\":{\"notice\":\"Returns the SECP256k1 public key associated with an ENS node. Defined in EIP 619.\"},\"setABI(bytes32,uint256,bytes)\":{\"notice\":\"Sets the ABI associated with an ENS node. Nodes may have one ABI of each content type. To remove an ABI, set it to the empty string.\"},\"setAddr(bytes32,address)\":{\"notice\":\"Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"setContenthash(bytes32,bytes)\":{\"notice\":\"Sets the contenthash associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"setDNSRecords(bytes32,bytes)\":{\"notice\":\"Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first.\"},\"setInterface(bytes32,bytes4,address)\":{\"notice\":\"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.\"},\"setName(bytes32,string)\":{\"notice\":\"Sets the name associated with an ENS node, for reverse records. May only be called by the owner of that node in the ENS registry.\"},\"setPubkey(bytes32,bytes32,bytes32)\":{\"notice\":\"Sets the SECP256k1 public key associated with an ENS node.\"},\"setText(bytes32,string,string)\":{\"notice\":\"Sets the text data associated with an ENS node and key. May only be called by the owner of that node in the ENS registry.\"},\"setZonehash(bytes32,bytes)\":{\"notice\":\"setZonehash sets the hash for the zone. May only be called by the owner of that node in the ENS registry.\"},\"text(bytes32,string)\":{\"notice\":\"Returns the text data associated with an ENS node and key.\"},\"zonehash(bytes32)\":{\"notice\":\"zonehash obtains the hash for the zone.\"}},\"notice\":\"A simple resolver anyone can use; only allows the owner of a node to set its address.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/resolvers/OwnedResolver.sol\":\"OwnedResolver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@ensdomains/buffer/contracts/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\\n\",\"keccak256\":\"0xd6dd3b0b327288f8e1b711a609f4040fea602e2ad4bba9febdf2f33b4e56eb0c\",\"license\":\"BSD-2-Clause\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/dnssec-oracle/BytesUtils.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nlibrary BytesUtils {\\n error OffsetOutOfBoundsError(uint256 offset, uint256 length);\\n\\n /*\\n * @dev Returns the keccak-256 hash of a byte range.\\n * @param self The byte string to hash.\\n * @param offset The position to start hashing at.\\n * @param len The number of bytes to hash.\\n * @return The hash of the byte range.\\n */\\n function keccak(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(offset + len <= self.length);\\n assembly {\\n ret := keccak256(add(add(self, 32), offset), len)\\n }\\n }\\n\\n /*\\n * @dev Returns a positive number if `other` comes lexicographically after\\n * `self`, a negative number if it comes before, or zero if the\\n * contents of the two bytes are equal.\\n * @param self The first bytes to compare.\\n * @param other The second bytes to compare.\\n * @return The result of the comparison.\\n */\\n function compare(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (int256) {\\n return compare(self, 0, self.length, other, 0, other.length);\\n }\\n\\n /*\\n * @dev Returns a positive number if `other` comes lexicographically after\\n * `self`, a negative number if it comes before, or zero if the\\n * contents of the two bytes are equal. Comparison is done per-rune,\\n * on unicode codepoints.\\n * @param self The first bytes to compare.\\n * @param offset The offset of self.\\n * @param len The length of self.\\n * @param other The second bytes to compare.\\n * @param otheroffset The offset of the other string.\\n * @param otherlen The length of the other string.\\n * @return The result of the comparison.\\n */\\n function compare(\\n bytes memory self,\\n uint256 offset,\\n uint256 len,\\n bytes memory other,\\n uint256 otheroffset,\\n uint256 otherlen\\n ) internal pure returns (int256) {\\n if (offset + len > self.length) {\\n revert OffsetOutOfBoundsError(offset + len, self.length);\\n }\\n if (otheroffset + otherlen > other.length) {\\n revert OffsetOutOfBoundsError(otheroffset + otherlen, other.length);\\n }\\n\\n uint256 shortest = len;\\n if (otherlen < len) shortest = otherlen;\\n\\n uint256 selfptr;\\n uint256 otherptr;\\n\\n assembly {\\n selfptr := add(self, add(offset, 32))\\n otherptr := add(other, add(otheroffset, 32))\\n }\\n for (uint256 idx = 0; idx < shortest; idx += 32) {\\n uint256 a;\\n uint256 b;\\n assembly {\\n a := mload(selfptr)\\n b := mload(otherptr)\\n }\\n if (a != b) {\\n // Mask out irrelevant bytes and check again\\n uint256 mask;\\n if (shortest - idx >= 32) {\\n mask = type(uint256).max;\\n } else {\\n mask = ~(2 ** (8 * (idx + 32 - shortest)) - 1);\\n }\\n int256 diff = int256(a & mask) - int256(b & mask);\\n if (diff != 0) return diff;\\n }\\n selfptr += 32;\\n otherptr += 32;\\n }\\n\\n return int256(len) - int256(otherlen);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @param otherOffset The offset into the second byte range.\\n * @param len The number of bytes to compare\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other,\\n uint256 otherOffset,\\n uint256 len\\n ) internal pure returns (bool) {\\n return keccak(self, offset, len) == keccak(other, otherOffset, len);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal with offsets.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @param otherOffset The offset into the second byte range.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other,\\n uint256 otherOffset\\n ) internal pure returns (bool) {\\n return\\n keccak(self, offset, self.length - offset) ==\\n keccak(other, otherOffset, other.length - otherOffset);\\n }\\n\\n /*\\n * @dev Compares a range of 'self' to all of 'other' and returns True iff\\n * they are equal.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other\\n ) internal pure returns (bool) {\\n return\\n self.length == offset + other.length &&\\n equals(self, offset, other, 0, other.length);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal.\\n * @param self The first byte range to compare.\\n * @param other The second byte range to compare.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (bool) {\\n return\\n self.length == other.length &&\\n equals(self, 0, other, 0, self.length);\\n }\\n\\n /*\\n * @dev Returns the 8-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 8 bits of the string, interpreted as an integer.\\n */\\n function readUint8(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint8 ret) {\\n return uint8(self[idx]);\\n }\\n\\n /*\\n * @dev Returns the 16-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 16 bits of the string, interpreted as an integer.\\n */\\n function readUint16(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint16 ret) {\\n require(idx + 2 <= self.length);\\n assembly {\\n ret := and(mload(add(add(self, 2), idx)), 0xFFFF)\\n }\\n }\\n\\n /*\\n * @dev Returns the 32-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bits of the string, interpreted as an integer.\\n */\\n function readUint32(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint32 ret) {\\n require(idx + 4 <= self.length);\\n assembly {\\n ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF)\\n }\\n }\\n\\n /*\\n * @dev Returns the 32 byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytes32(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes32 ret) {\\n require(idx + 32 <= self.length);\\n assembly {\\n ret := mload(add(add(self, 32), idx))\\n }\\n }\\n\\n /*\\n * @dev Returns the 32 byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytes20(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes20 ret) {\\n require(idx + 20 <= self.length);\\n assembly {\\n ret := and(\\n mload(add(add(self, 32), idx)),\\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000\\n )\\n }\\n }\\n\\n /*\\n * @dev Returns the n byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes.\\n * @param len The number of bytes.\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytesN(\\n bytes memory self,\\n uint256 idx,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(len <= 32);\\n require(idx + len <= self.length);\\n assembly {\\n let mask := not(sub(exp(256, sub(32, len)), 1))\\n ret := and(mload(add(add(self, 32), idx)), mask)\\n }\\n }\\n\\n function memcpy(uint256 dest, uint256 src, uint256 len) private pure {\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint256 mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n }\\n\\n /*\\n * @dev Copies a substring into a new byte string.\\n * @param self The byte string to copy from.\\n * @param offset The offset to start copying at.\\n * @param len The number of bytes to copy.\\n */\\n function substring(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes memory) {\\n require(offset + len <= self.length);\\n\\n bytes memory ret = new bytes(len);\\n uint256 dest;\\n uint256 src;\\n\\n assembly {\\n dest := add(ret, 32)\\n src := add(add(self, 32), offset)\\n }\\n memcpy(dest, src, len);\\n\\n return ret;\\n }\\n\\n // Maps characters from 0x30 to 0x7A to their base32 values.\\n // 0xFF represents invalid characters in that range.\\n bytes constant base32HexTable =\\n hex\\\"00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F\\\";\\n\\n /**\\n * @dev Decodes unpadded base32 data of up to one word in length.\\n * @param self The data to decode.\\n * @param off Offset into the string to start at.\\n * @param len Number of characters to decode.\\n * @return The decoded data, left aligned.\\n */\\n function base32HexDecodeWord(\\n bytes memory self,\\n uint256 off,\\n uint256 len\\n ) internal pure returns (bytes32) {\\n require(len <= 52);\\n\\n uint256 ret = 0;\\n uint8 decoded;\\n for (uint256 i = 0; i < len; i++) {\\n bytes1 char = self[off + i];\\n require(char >= 0x30 && char <= 0x7A);\\n decoded = uint8(base32HexTable[uint256(uint8(char)) - 0x30]);\\n require(decoded <= 0x20);\\n if (i == len - 1) {\\n break;\\n }\\n ret = (ret << 5) | decoded;\\n }\\n\\n uint256 bitlen = len * 5;\\n if (len % 8 == 0) {\\n // Multiple of 8 characters, no padding\\n ret = (ret << 5) | decoded;\\n } else if (len % 8 == 2) {\\n // Two extra characters - 1 byte\\n ret = (ret << 3) | (decoded >> 2);\\n bitlen -= 2;\\n } else if (len % 8 == 4) {\\n // Four extra characters - 2 bytes\\n ret = (ret << 1) | (decoded >> 4);\\n bitlen -= 4;\\n } else if (len % 8 == 5) {\\n // Five extra characters - 3 bytes\\n ret = (ret << 4) | (decoded >> 1);\\n bitlen -= 1;\\n } else if (len % 8 == 7) {\\n // Seven extra characters - 4 bytes\\n ret = (ret << 2) | (decoded >> 3);\\n bitlen -= 3;\\n } else {\\n revert();\\n }\\n\\n return bytes32(ret << (256 - bitlen));\\n }\\n\\n /**\\n * @dev Finds the first occurrence of the byte `needle` in `self`.\\n * @param self The string to search\\n * @param off The offset to start searching at\\n * @param len The number of bytes to search\\n * @param needle The byte to search for\\n * @return The offset of `needle` in `self`, or 2**256-1 if it was not found.\\n */\\n function find(\\n bytes memory self,\\n uint256 off,\\n uint256 len,\\n bytes1 needle\\n ) internal pure returns (uint256) {\\n for (uint256 idx = off; idx < off + len; idx++) {\\n if (self[idx] == needle) {\\n return idx;\\n }\\n }\\n return type(uint256).max;\\n }\\n}\\n\",\"keccak256\":\"0x4f10902639b85a17ae10745264feff322e793bfb1bc130a9a90efa7dda47c6cc\"},\"contracts/dnssec-oracle/RRUtils.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"./BytesUtils.sol\\\";\\nimport \\\"@ensdomains/buffer/contracts/Buffer.sol\\\";\\n\\n/**\\n * @dev RRUtils is a library that provides utilities for parsing DNS resource records.\\n */\\nlibrary RRUtils {\\n using BytesUtils for *;\\n using Buffer for *;\\n\\n /**\\n * @dev Returns the number of bytes in the DNS name at 'offset' in 'self'.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return The length of the DNS name at 'offset', in bytes.\\n */\\n function nameLength(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (uint256) {\\n uint256 idx = offset;\\n while (true) {\\n assert(idx < self.length);\\n uint256 labelLen = self.readUint8(idx);\\n idx += labelLen + 1;\\n if (labelLen == 0) {\\n break;\\n }\\n }\\n return idx - offset;\\n }\\n\\n /**\\n * @dev Returns a DNS format name at the specified offset of self.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return ret The name.\\n */\\n function readName(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (bytes memory ret) {\\n uint256 len = nameLength(self, offset);\\n return self.substring(offset, len);\\n }\\n\\n /**\\n * @dev Returns the number of labels in the DNS name at 'offset' in 'self'.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return The number of labels in the DNS name at 'offset', in bytes.\\n */\\n function labelCount(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (uint256) {\\n uint256 count = 0;\\n while (true) {\\n assert(offset < self.length);\\n uint256 labelLen = self.readUint8(offset);\\n offset += labelLen + 1;\\n if (labelLen == 0) {\\n break;\\n }\\n count += 1;\\n }\\n return count;\\n }\\n\\n uint256 constant RRSIG_TYPE = 0;\\n uint256 constant RRSIG_ALGORITHM = 2;\\n uint256 constant RRSIG_LABELS = 3;\\n uint256 constant RRSIG_TTL = 4;\\n uint256 constant RRSIG_EXPIRATION = 8;\\n uint256 constant RRSIG_INCEPTION = 12;\\n uint256 constant RRSIG_KEY_TAG = 16;\\n uint256 constant RRSIG_SIGNER_NAME = 18;\\n\\n struct SignedSet {\\n uint16 typeCovered;\\n uint8 algorithm;\\n uint8 labels;\\n uint32 ttl;\\n uint32 expiration;\\n uint32 inception;\\n uint16 keytag;\\n bytes signerName;\\n bytes data;\\n bytes name;\\n }\\n\\n function readSignedSet(\\n bytes memory data\\n ) internal pure returns (SignedSet memory self) {\\n self.typeCovered = data.readUint16(RRSIG_TYPE);\\n self.algorithm = data.readUint8(RRSIG_ALGORITHM);\\n self.labels = data.readUint8(RRSIG_LABELS);\\n self.ttl = data.readUint32(RRSIG_TTL);\\n self.expiration = data.readUint32(RRSIG_EXPIRATION);\\n self.inception = data.readUint32(RRSIG_INCEPTION);\\n self.keytag = data.readUint16(RRSIG_KEY_TAG);\\n self.signerName = readName(data, RRSIG_SIGNER_NAME);\\n self.data = data.substring(\\n RRSIG_SIGNER_NAME + self.signerName.length,\\n data.length - RRSIG_SIGNER_NAME - self.signerName.length\\n );\\n }\\n\\n function rrs(\\n SignedSet memory rrset\\n ) internal pure returns (RRIterator memory) {\\n return iterateRRs(rrset.data, 0);\\n }\\n\\n /**\\n * @dev An iterator over resource records.\\n */\\n struct RRIterator {\\n bytes data;\\n uint256 offset;\\n uint16 dnstype;\\n uint16 class;\\n uint32 ttl;\\n uint256 rdataOffset;\\n uint256 nextOffset;\\n }\\n\\n /**\\n * @dev Begins iterating over resource records.\\n * @param self The byte string to read from.\\n * @param offset The offset to start reading at.\\n * @return ret An iterator object.\\n */\\n function iterateRRs(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (RRIterator memory ret) {\\n ret.data = self;\\n ret.nextOffset = offset;\\n next(ret);\\n }\\n\\n /**\\n * @dev Returns true iff there are more RRs to iterate.\\n * @param iter The iterator to check.\\n * @return True iff the iterator has finished.\\n */\\n function done(RRIterator memory iter) internal pure returns (bool) {\\n return iter.offset >= iter.data.length;\\n }\\n\\n /**\\n * @dev Moves the iterator to the next resource record.\\n * @param iter The iterator to advance.\\n */\\n function next(RRIterator memory iter) internal pure {\\n iter.offset = iter.nextOffset;\\n if (iter.offset >= iter.data.length) {\\n return;\\n }\\n\\n // Skip the name\\n uint256 off = iter.offset + nameLength(iter.data, iter.offset);\\n\\n // Read type, class, and ttl\\n iter.dnstype = iter.data.readUint16(off);\\n off += 2;\\n iter.class = iter.data.readUint16(off);\\n off += 2;\\n iter.ttl = iter.data.readUint32(off);\\n off += 4;\\n\\n // Read the rdata\\n uint256 rdataLength = iter.data.readUint16(off);\\n off += 2;\\n iter.rdataOffset = off;\\n iter.nextOffset = off + rdataLength;\\n }\\n\\n /**\\n * @dev Returns the name of the current record.\\n * @param iter The iterator.\\n * @return A new bytes object containing the owner name from the RR.\\n */\\n function name(RRIterator memory iter) internal pure returns (bytes memory) {\\n return\\n iter.data.substring(\\n iter.offset,\\n nameLength(iter.data, iter.offset)\\n );\\n }\\n\\n /**\\n * @dev Returns the rdata portion of the current record.\\n * @param iter The iterator.\\n * @return A new bytes object containing the RR's RDATA.\\n */\\n function rdata(\\n RRIterator memory iter\\n ) internal pure returns (bytes memory) {\\n return\\n iter.data.substring(\\n iter.rdataOffset,\\n iter.nextOffset - iter.rdataOffset\\n );\\n }\\n\\n uint256 constant DNSKEY_FLAGS = 0;\\n uint256 constant DNSKEY_PROTOCOL = 2;\\n uint256 constant DNSKEY_ALGORITHM = 3;\\n uint256 constant DNSKEY_PUBKEY = 4;\\n\\n struct DNSKEY {\\n uint16 flags;\\n uint8 protocol;\\n uint8 algorithm;\\n bytes publicKey;\\n }\\n\\n function readDNSKEY(\\n bytes memory data,\\n uint256 offset,\\n uint256 length\\n ) internal pure returns (DNSKEY memory self) {\\n self.flags = data.readUint16(offset + DNSKEY_FLAGS);\\n self.protocol = data.readUint8(offset + DNSKEY_PROTOCOL);\\n self.algorithm = data.readUint8(offset + DNSKEY_ALGORITHM);\\n self.publicKey = data.substring(\\n offset + DNSKEY_PUBKEY,\\n length - DNSKEY_PUBKEY\\n );\\n }\\n\\n uint256 constant DS_KEY_TAG = 0;\\n uint256 constant DS_ALGORITHM = 2;\\n uint256 constant DS_DIGEST_TYPE = 3;\\n uint256 constant DS_DIGEST = 4;\\n\\n struct DS {\\n uint16 keytag;\\n uint8 algorithm;\\n uint8 digestType;\\n bytes digest;\\n }\\n\\n function readDS(\\n bytes memory data,\\n uint256 offset,\\n uint256 length\\n ) internal pure returns (DS memory self) {\\n self.keytag = data.readUint16(offset + DS_KEY_TAG);\\n self.algorithm = data.readUint8(offset + DS_ALGORITHM);\\n self.digestType = data.readUint8(offset + DS_DIGEST_TYPE);\\n self.digest = data.substring(offset + DS_DIGEST, length - DS_DIGEST);\\n }\\n\\n function isSubdomainOf(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (bool) {\\n uint256 off = 0;\\n uint256 counts = labelCount(self, 0);\\n uint256 othercounts = labelCount(other, 0);\\n\\n while (counts > othercounts) {\\n off = progress(self, off);\\n counts--;\\n }\\n\\n return self.equals(off, other, 0);\\n }\\n\\n function compareNames(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (int256) {\\n if (self.equals(other)) {\\n return 0;\\n }\\n\\n uint256 off;\\n uint256 otheroff;\\n uint256 prevoff;\\n uint256 otherprevoff;\\n uint256 counts = labelCount(self, 0);\\n uint256 othercounts = labelCount(other, 0);\\n\\n // Keep removing labels from the front of the name until both names are equal length\\n while (counts > othercounts) {\\n prevoff = off;\\n off = progress(self, off);\\n counts--;\\n }\\n\\n while (othercounts > counts) {\\n otherprevoff = otheroff;\\n otheroff = progress(other, otheroff);\\n othercounts--;\\n }\\n\\n // Compare the last nonequal labels to each other\\n while (counts > 0 && !self.equals(off, other, otheroff)) {\\n prevoff = off;\\n off = progress(self, off);\\n otherprevoff = otheroff;\\n otheroff = progress(other, otheroff);\\n counts -= 1;\\n }\\n\\n if (off == 0) {\\n return -1;\\n }\\n if (otheroff == 0) {\\n return 1;\\n }\\n\\n return\\n self.compare(\\n prevoff + 1,\\n self.readUint8(prevoff),\\n other,\\n otherprevoff + 1,\\n other.readUint8(otherprevoff)\\n );\\n }\\n\\n /**\\n * @dev Compares two serial numbers using RFC1982 serial number math.\\n */\\n function serialNumberGte(\\n uint32 i1,\\n uint32 i2\\n ) internal pure returns (bool) {\\n unchecked {\\n return int32(i1) - int32(i2) >= 0;\\n }\\n }\\n\\n function progress(\\n bytes memory body,\\n uint256 off\\n ) internal pure returns (uint256) {\\n return off + 1 + body.readUint8(off);\\n }\\n\\n /**\\n * @dev Computes the keytag for a chunk of data.\\n * @param data The data to compute a keytag for.\\n * @return The computed key tag.\\n */\\n function computeKeytag(bytes memory data) internal pure returns (uint16) {\\n /* This function probably deserves some explanation.\\n * The DNSSEC keytag function is a checksum that relies on summing up individual bytes\\n * from the input string, with some mild bitshifting. Here's a Naive solidity implementation:\\n *\\n * function computeKeytag(bytes memory data) internal pure returns (uint16) {\\n * uint ac;\\n * for (uint i = 0; i < data.length; i++) {\\n * ac += i & 1 == 0 ? uint16(data.readUint8(i)) << 8 : data.readUint8(i);\\n * }\\n * return uint16(ac + (ac >> 16));\\n * }\\n *\\n * The EVM, with its 256 bit words, is exceedingly inefficient at doing byte-by-byte operations;\\n * the code above, on reasonable length inputs, consumes over 100k gas. But we can make the EVM's\\n * large words work in our favour.\\n *\\n * The code below works by treating the input as a series of 256 bit words. It first masks out\\n * even and odd bytes from each input word, adding them to two separate accumulators `ac1` and `ac2`.\\n * The bytes are separated by empty bytes, so as long as no individual sum exceeds 2^16-1, we're\\n * effectively summing 16 different numbers with each EVM ADD opcode.\\n *\\n * Once it's added up all the inputs, it has to add all the 16 bit values in `ac1` and `ac2` together.\\n * It does this using the same trick - mask out every other value, shift to align them, add them together.\\n * After the first addition on both accumulators, there's enough room to add the two accumulators together,\\n * and the remaining sums can be done just on ac1.\\n */\\n unchecked {\\n require(data.length <= 8192, \\\"Long keys not permitted\\\");\\n uint256 ac1;\\n uint256 ac2;\\n for (uint256 i = 0; i < data.length + 31; i += 32) {\\n uint256 word;\\n assembly {\\n word := mload(add(add(data, 32), i))\\n }\\n if (i + 32 > data.length) {\\n uint256 unused = 256 - (data.length - i) * 8;\\n word = (word >> unused) << unused;\\n }\\n ac1 +=\\n (word &\\n 0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00) >>\\n 8;\\n ac2 += (word &\\n 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF);\\n }\\n ac1 =\\n (ac1 &\\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\\n ((ac1 &\\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\\n 16);\\n ac2 =\\n (ac2 &\\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\\n ((ac2 &\\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\\n 16);\\n ac1 = (ac1 << 8) + ac2;\\n ac1 =\\n (ac1 &\\n 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) +\\n ((ac1 &\\n 0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000) >>\\n 32);\\n ac1 =\\n (ac1 &\\n 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) +\\n ((ac1 &\\n 0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000) >>\\n 64);\\n ac1 =\\n (ac1 &\\n 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) +\\n (ac1 >> 128);\\n ac1 += (ac1 >> 16) & 0xFFFF;\\n return uint16(ac1);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4dd68a6efd7c38f6b0e95ca0c056ecb74f88583da650b1a8639e6e78be36fede\"},\"contracts/resolvers/OwnedResolver.sol\":{\"content\":\"pragma solidity >=0.8.4;\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./profiles/ABIResolver.sol\\\";\\nimport \\\"./profiles/AddrResolver.sol\\\";\\nimport \\\"./profiles/ContentHashResolver.sol\\\";\\nimport \\\"./profiles/DNSResolver.sol\\\";\\nimport \\\"./profiles/InterfaceResolver.sol\\\";\\nimport \\\"./profiles/NameResolver.sol\\\";\\nimport \\\"./profiles/PubkeyResolver.sol\\\";\\nimport \\\"./profiles/TextResolver.sol\\\";\\nimport \\\"./profiles/ExtendedResolver.sol\\\";\\n\\n/**\\n * A simple resolver anyone can use; only allows the owner of a node to set its\\n * address.\\n */\\ncontract OwnedResolver is\\n Ownable,\\n ABIResolver,\\n AddrResolver,\\n ContentHashResolver,\\n DNSResolver,\\n InterfaceResolver,\\n NameResolver,\\n PubkeyResolver,\\n TextResolver,\\n ExtendedResolver\\n{\\n function isAuthorised(bytes32) internal view override returns (bool) {\\n return msg.sender == owner();\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n )\\n public\\n view\\n virtual\\n override(\\n ABIResolver,\\n AddrResolver,\\n ContentHashResolver,\\n DNSResolver,\\n InterfaceResolver,\\n NameResolver,\\n PubkeyResolver,\\n TextResolver\\n )\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x598216380f029db0101c75ebb00a7ccc04bd26c738537238d7f67d9e35603e8b\"},\"contracts/resolvers/ResolverBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\nimport \\\"./profiles/IVersionableResolver.sol\\\";\\n\\nabstract contract ResolverBase is ERC165, IVersionableResolver {\\n mapping(bytes32 => uint64) public recordVersions;\\n\\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\\n\\n modifier authorised(bytes32 node) {\\n require(isAuthorised(node));\\n _;\\n }\\n\\n /**\\n * Increments the record version associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n */\\n function clearRecords(bytes32 node) public virtual authorised(node) {\\n recordVersions[node]++;\\n emit VersionChanged(node, recordVersions[node]);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IVersionableResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x893049fffd6feee06d7acef1680f6e26505bedff62a9f7a17e921c0ba2f66307\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"./IABIResolver.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\n\\nabstract contract ABIResolver is IABIResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_abis;\\n\\n /**\\n * Sets the ABI associated with an ENS node.\\n * Nodes may have one ABI of each content type. To remove an ABI, set it to\\n * the empty string.\\n * @param node The node to update.\\n * @param contentType The content type of the ABI\\n * @param data The ABI data.\\n */\\n function setABI(\\n bytes32 node,\\n uint256 contentType,\\n bytes calldata data\\n ) external virtual authorised(node) {\\n // Content types must be powers of 2\\n require(((contentType - 1) & contentType) == 0);\\n\\n versionable_abis[recordVersions[node]][node][contentType] = data;\\n emit ABIChanged(node, contentType);\\n }\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view virtual override returns (uint256, bytes memory) {\\n mapping(uint256 => bytes) storage abiset = versionable_abis[\\n recordVersions[node]\\n ][node];\\n\\n for (\\n uint256 contentType = 1;\\n contentType <= contentTypes;\\n contentType <<= 1\\n ) {\\n if (\\n (contentType & contentTypes) != 0 &&\\n abiset[contentType].length > 0\\n ) {\\n return (contentType, abiset[contentType]);\\n }\\n }\\n\\n return (0, bytes(\\\"\\\"));\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IABIResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x2da96d7750786afe3be019fc6ff768e2d98a5e61d360bd92d8d7bc3c7c1dcc27\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/AddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IAddrResolver.sol\\\";\\nimport \\\"./IAddressResolver.sol\\\";\\n\\nabstract contract AddrResolver is\\n IAddrResolver,\\n IAddressResolver,\\n ResolverBase\\n{\\n uint256 private constant COIN_TYPE_ETH = 60;\\n\\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;\\n\\n /**\\n * Sets the address associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param a The address to set.\\n */\\n function setAddr(\\n bytes32 node,\\n address a\\n ) external virtual authorised(node) {\\n setAddr(node, COIN_TYPE_ETH, addressToBytes(a));\\n }\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(\\n bytes32 node\\n ) public view virtual override returns (address payable) {\\n bytes memory a = addr(node, COIN_TYPE_ETH);\\n if (a.length == 0) {\\n return payable(0);\\n }\\n return bytesToAddress(a);\\n }\\n\\n function setAddr(\\n bytes32 node,\\n uint256 coinType,\\n bytes memory a\\n ) public virtual authorised(node) {\\n emit AddressChanged(node, coinType, a);\\n if (coinType == COIN_TYPE_ETH) {\\n emit AddrChanged(node, bytesToAddress(a));\\n }\\n versionable_addresses[recordVersions[node]][node][coinType] = a;\\n }\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) public view virtual override returns (bytes memory) {\\n return versionable_addresses[recordVersions[node]][node][coinType];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IAddrResolver).interfaceId ||\\n interfaceID == type(IAddressResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n\\n function bytesToAddress(\\n bytes memory b\\n ) internal pure returns (address payable a) {\\n require(b.length == 20);\\n assembly {\\n a := div(mload(add(b, 32)), exp(256, 12))\\n }\\n }\\n\\n function addressToBytes(address a) internal pure returns (bytes memory b) {\\n b = new bytes(20);\\n assembly {\\n mstore(add(b, 32), mul(a, exp(256, 12)))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7f6ebb3144530a02db03379f33ade869c8408eceed36dfbd751aaff198735b55\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IContentHashResolver.sol\\\";\\n\\nabstract contract ContentHashResolver is IContentHashResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => bytes)) versionable_hashes;\\n\\n /**\\n * Sets the contenthash associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param hash The contenthash to set\\n */\\n function setContenthash(\\n bytes32 node,\\n bytes calldata hash\\n ) external virtual authorised(node) {\\n versionable_hashes[recordVersions[node]][node] = hash;\\n emit ContenthashChanged(node, hash);\\n }\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(\\n bytes32 node\\n ) external view virtual override returns (bytes memory) {\\n return versionable_hashes[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IContentHashResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xc9755bfb77985375ded880ecab5af41f2b9e8280f30d3e523fe5042ea59f93ea\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/DNSResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"../../dnssec-oracle/RRUtils.sol\\\";\\nimport \\\"./IDNSRecordResolver.sol\\\";\\nimport \\\"./IDNSZoneResolver.sol\\\";\\n\\nabstract contract DNSResolver is\\n IDNSRecordResolver,\\n IDNSZoneResolver,\\n ResolverBase\\n{\\n using RRUtils for *;\\n using BytesUtils for bytes;\\n\\n // Zone hashes for the domains.\\n // A zone hash is an EIP-1577 content hash in binary format that should point to a\\n // resource containing a single zonefile.\\n // node => contenthash\\n mapping(uint64 => mapping(bytes32 => bytes)) private versionable_zonehashes;\\n\\n // The records themselves. Stored as binary RRSETs\\n // node => version => name => resource => data\\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))\\n private versionable_records;\\n\\n // Count of number of entries for a given name. Required for DNS resolvers\\n // when resolving wildcards.\\n // node => version => name => number of records\\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))\\n private versionable_nameEntriesCount;\\n\\n /**\\n * Set one or more DNS records. Records are supplied in wire-format.\\n * Records with the same node/name/resource must be supplied one after the\\n * other to ensure the data is updated correctly. For example, if the data\\n * was supplied:\\n * a.example.com IN A 1.2.3.4\\n * a.example.com IN A 5.6.7.8\\n * www.example.com IN CNAME a.example.com.\\n * then this would store the two A records for a.example.com correctly as a\\n * single RRSET, however if the data was supplied:\\n * a.example.com IN A 1.2.3.4\\n * www.example.com IN CNAME a.example.com.\\n * a.example.com IN A 5.6.7.8\\n * then this would store the first A record, the CNAME, then the second A\\n * record which would overwrite the first.\\n *\\n * @param node the namehash of the node for which to set the records\\n * @param data the DNS wire format records to set\\n */\\n function setDNSRecords(\\n bytes32 node,\\n bytes calldata data\\n ) external virtual authorised(node) {\\n uint16 resource = 0;\\n uint256 offset = 0;\\n bytes memory name;\\n bytes memory value;\\n bytes32 nameHash;\\n uint64 version = recordVersions[node];\\n // Iterate over the data to add the resource records\\n for (\\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\\n !iter.done();\\n iter.next()\\n ) {\\n if (resource == 0) {\\n resource = iter.dnstype;\\n name = iter.name();\\n nameHash = keccak256(abi.encodePacked(name));\\n value = bytes(iter.rdata());\\n } else {\\n bytes memory newName = iter.name();\\n if (resource != iter.dnstype || !name.equals(newName)) {\\n setDNSRRSet(\\n node,\\n name,\\n resource,\\n data,\\n offset,\\n iter.offset - offset,\\n value.length == 0,\\n version\\n );\\n resource = iter.dnstype;\\n offset = iter.offset;\\n name = newName;\\n nameHash = keccak256(name);\\n value = bytes(iter.rdata());\\n }\\n }\\n }\\n if (name.length > 0) {\\n setDNSRRSet(\\n node,\\n name,\\n resource,\\n data,\\n offset,\\n data.length - offset,\\n value.length == 0,\\n version\\n );\\n }\\n }\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) public view virtual override returns (bytes memory) {\\n return versionable_records[recordVersions[node]][node][name][resource];\\n }\\n\\n /**\\n * Check if a given node has records.\\n * @param node the namehash of the node for which to check the records\\n * @param name the namehash of the node for which to check the records\\n */\\n function hasDNSRecords(\\n bytes32 node,\\n bytes32 name\\n ) public view virtual returns (bool) {\\n return (versionable_nameEntriesCount[recordVersions[node]][node][\\n name\\n ] != 0);\\n }\\n\\n /**\\n * setZonehash sets the hash for the zone.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param hash The zonehash to set\\n */\\n function setZonehash(\\n bytes32 node,\\n bytes calldata hash\\n ) external virtual authorised(node) {\\n uint64 currentRecordVersion = recordVersions[node];\\n bytes memory oldhash = versionable_zonehashes[currentRecordVersion][\\n node\\n ];\\n versionable_zonehashes[currentRecordVersion][node] = hash;\\n emit DNSZonehashChanged(node, oldhash, hash);\\n }\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(\\n bytes32 node\\n ) external view virtual override returns (bytes memory) {\\n return versionable_zonehashes[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IDNSRecordResolver).interfaceId ||\\n interfaceID == type(IDNSZoneResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n\\n function setDNSRRSet(\\n bytes32 node,\\n bytes memory name,\\n uint16 resource,\\n bytes memory data,\\n uint256 offset,\\n uint256 size,\\n bool deleteRecord,\\n uint64 version\\n ) private {\\n bytes32 nameHash = keccak256(name);\\n bytes memory rrData = data.substring(offset, size);\\n if (deleteRecord) {\\n if (\\n versionable_records[version][node][nameHash][resource].length !=\\n 0\\n ) {\\n versionable_nameEntriesCount[version][node][nameHash]--;\\n }\\n delete (versionable_records[version][node][nameHash][resource]);\\n emit DNSRecordDeleted(node, name, resource);\\n } else {\\n if (\\n versionable_records[version][node][nameHash][resource].length ==\\n 0\\n ) {\\n versionable_nameEntriesCount[version][node][nameHash]++;\\n }\\n versionable_records[version][node][nameHash][resource] = rrData;\\n emit DNSRecordChanged(node, name, resource, rrData);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7233e4d2edca222ce6e1cdb07adf127ab52ecaea599fa5369971a7b28dbc59ac\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ExtendedResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ncontract ExtendedResolver {\\n function resolve(\\n bytes memory /* name */,\\n bytes memory data\\n ) external view returns (bytes memory) {\\n (bool success, bytes memory result) = address(this).staticcall(data);\\n if (success) {\\n return result;\\n } else {\\n // Revert with the reason provided by the call\\n assembly {\\n revert(add(result, 0x20), mload(result))\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd0e5c93ac9f4d21a0278282e2a32a9c5606a0053ce4781773b7faade57a4a54e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IABIResolver {\\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0x85b373d02d19374fe570af407f459768285704bf7f30ab17c30eabfb5a10e4c3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the legacy (ETH-only) addr function.\\n */\\ninterface IAddrResolver {\\n event AddrChanged(bytes32 indexed node, address a);\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0x2ad7f2fc60ebe0f93745fe70247f6a854f66af732483fda2a3c5e055614445e8\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the new (multicoin) addr function.\\n */\\ninterface IAddressResolver {\\n event AddressChanged(\\n bytes32 indexed node,\\n uint256 coinType,\\n bytes newAddress\\n );\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x411447c1e90c51e09702815a85ec725ffbbe37cf96e8cc4d2a8bd4ad8a59d73e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IContentHashResolver {\\n event ContenthashChanged(bytes32 indexed node, bytes hash);\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xd95cd77684ba5752c428d7dceb4ecc6506ac94f4fbb910489637eb68dcd8e366\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSRecordResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSRecordResolver {\\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\\n event DNSRecordChanged(\\n bytes32 indexed node,\\n bytes name,\\n uint16 resource,\\n bytes record\\n );\\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xcfa52200edd337f2c6c5bf402352600584da033b21323603e53de33051a3e25d\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSZoneResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSZoneResolver {\\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\\n event DNSZonehashChanged(\\n bytes32 indexed node,\\n bytes lastzonehash,\\n bytes zonehash\\n );\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xca1b3a16e7005533f2800a3e66fcdccf7c574deac7913d8c810f40aec1d58dc0\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IInterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IInterfaceResolver {\\n event InterfaceChanged(\\n bytes32 indexed node,\\n bytes4 indexed interfaceID,\\n address implementer\\n );\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view returns (address);\\n}\\n\",\"keccak256\":\"0x390321fb58f7b927df9562450981e74b4be3907e7c09df321fd3b7409b63ae28\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/INameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface INameResolver {\\n event NameChanged(bytes32 indexed node, string name);\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(bytes32 node) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x9ec392b612447b1acbdc01114f2da2837a658d3f3157f60a99c5269f0b623346\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IPubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IPubkeyResolver {\\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\\n}\\n\",\"keccak256\":\"0x69748947093dd2fda9ddcebd0adf19a6d1e7600df1d4b1462a0417156caddca7\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ITextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface ITextResolver {\\n event TextChanged(\\n bytes32 indexed node,\\n string indexed indexedKey,\\n string key,\\n string value\\n );\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x7c5debb3c42cd9f5de2274ea7aa053f238608314b62db441c40e31cea2543fd5\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IVersionableResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IVersionableResolver {\\n event VersionChanged(bytes32 indexed node, uint64 newVersion);\\n\\n function recordVersions(bytes32 node) external view returns (uint64);\\n}\\n\",\"keccak256\":\"0xd0d09596f20c57bafb2ffa8521a8c57120e9af6c6b194f9c689d4da56f91a57c\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/InterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./AddrResolver.sol\\\";\\nimport \\\"./IInterfaceResolver.sol\\\";\\n\\nabstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {\\n mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address))) versionable_interfaces;\\n\\n /**\\n * Sets an interface associated with a name.\\n * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.\\n * @param node The node to update.\\n * @param interfaceID The EIP 165 interface ID.\\n * @param implementer The address of a contract that implements this interface for this node.\\n */\\n function setInterface(\\n bytes32 node,\\n bytes4 interfaceID,\\n address implementer\\n ) external virtual authorised(node) {\\n versionable_interfaces[recordVersions[node]][node][\\n interfaceID\\n ] = implementer;\\n emit InterfaceChanged(node, interfaceID, implementer);\\n }\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view virtual override returns (address) {\\n address implementer = versionable_interfaces[recordVersions[node]][\\n node\\n ][interfaceID];\\n if (implementer != address(0)) {\\n return implementer;\\n }\\n\\n address a = addr(node);\\n if (a == address(0)) {\\n return address(0);\\n }\\n\\n (bool success, bytes memory returnData) = a.staticcall(\\n abi.encodeWithSignature(\\n \\\"supportsInterface(bytes4)\\\",\\n type(IERC165).interfaceId\\n )\\n );\\n if (!success || returnData.length < 32 || returnData[31] == 0) {\\n // EIP 165 not supported by target\\n return address(0);\\n }\\n\\n (success, returnData) = a.staticcall(\\n abi.encodeWithSignature(\\\"supportsInterface(bytes4)\\\", interfaceID)\\n );\\n if (!success || returnData.length < 32 || returnData[31] == 0) {\\n // Specified interface not supported by target\\n return address(0);\\n }\\n\\n return a;\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IInterfaceResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x820ec60183e7a49a4ee399cf4708acb776725c8e4ad275d1f316c152eace0a59\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/NameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./INameResolver.sol\\\";\\n\\nabstract contract NameResolver is INameResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => string)) versionable_names;\\n\\n /**\\n * Sets the name associated with an ENS node, for reverse records.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n */\\n function setName(\\n bytes32 node,\\n string calldata newName\\n ) external virtual authorised(node) {\\n versionable_names[recordVersions[node]][node] = newName;\\n emit NameChanged(node, newName);\\n }\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(\\n bytes32 node\\n ) external view virtual override returns (string memory) {\\n return versionable_names[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(INameResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x52d0bbb8f9dd33fae471ef2f5f6b3118b221954e5bb7ba724885d4562e75b8e2\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/PubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IPubkeyResolver.sol\\\";\\n\\nabstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {\\n struct PublicKey {\\n bytes32 x;\\n bytes32 y;\\n }\\n\\n mapping(uint64 => mapping(bytes32 => PublicKey)) versionable_pubkeys;\\n\\n /**\\n * Sets the SECP256k1 public key associated with an ENS node.\\n * @param node The ENS node to query\\n * @param x the X coordinate of the curve point for the public key.\\n * @param y the Y coordinate of the curve point for the public key.\\n */\\n function setPubkey(\\n bytes32 node,\\n bytes32 x,\\n bytes32 y\\n ) external virtual authorised(node) {\\n versionable_pubkeys[recordVersions[node]][node] = PublicKey(x, y);\\n emit PubkeyChanged(node, x, y);\\n }\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(\\n bytes32 node\\n ) external view virtual override returns (bytes32 x, bytes32 y) {\\n uint64 currentRecordVersion = recordVersions[node];\\n return (\\n versionable_pubkeys[currentRecordVersion][node].x,\\n versionable_pubkeys[currentRecordVersion][node].y\\n );\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IPubkeyResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x1a1f10a0e40520c998a9296fc81c092c81521e05a784e9bd9ee44cc4c62c8c78\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/TextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./ITextResolver.sol\\\";\\n\\nabstract contract TextResolver is ITextResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => mapping(string => string))) versionable_texts;\\n\\n /**\\n * Sets the text data associated with an ENS node and key.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param key The key to set.\\n * @param value The text data value to set.\\n */\\n function setText(\\n bytes32 node,\\n string calldata key,\\n string calldata value\\n ) external virtual authorised(node) {\\n versionable_texts[recordVersions[node]][node][key] = value;\\n emit TextChanged(node, key, key, value);\\n }\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view virtual override returns (string memory) {\\n return versionable_texts[recordVersions[node]][node][key];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(ITextResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xf9bedd807add38136779d84083ac2fa4f8c92d017c9e1a72fbc9003fa5074379\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61292b8061007e6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063c869023311610097578063d700ff3311610071578063d700ff3314610450578063e59d895d14610493578063f1cb7e06146104a6578063f2fde38b146104b957600080fd5b8063c8690233146103d0578063ce3decdc1461042a578063d5fa2b001461043d57600080fd5b80638da5cb5b116100d35780638da5cb5b146103865780639061b92314610397578063a8fa5682146103aa578063bc1c58d1146103bd57600080fd5b8063715018a61461035857806377372213146103605780638b95dd711461037357600080fd5b80633603d7581161016657806359d1d43c1161014057806359d1d43c146102ff5780635c98042b1461031f578063623195b014610332578063691f34311461034557600080fd5b80633603d7581461028b5780633b3b57de1461029e5780634cbf6ba4146102b157600080fd5b8063124a319c116101a2578063124a319c146102195780632203ab561461024457806329cd62ea14610265578063304e6ade1461027857600080fd5b806301ffc9a7146101c95780630af179d7146101f157806310f13a8c14610206575b600080fd5b6101dc6101d736600461205c565b6104cc565b60405190151581526020015b60405180910390f35b6102046101ff3660046120b9565b6104dd565b005b610204610214366004612105565b6106ef565b61022c61022736600461217f565b6107c4565b6040516001600160a01b0390911681526020016101e8565b6102576102523660046121ab565b610a72565b6040516101e892919061221d565b610204610273366004612236565b610baa565b6102046102863660046120b9565b610c52565b610204610299366004612262565b610cd6565b61022c6102ac366004612262565b610d81565b6101dc6102bf3660046121ab565b60008281526001602090815260408083205467ffffffffffffffff1683526007825280832094835293815283822092825291909152205461ffff16151590565b61031261030d3660046120b9565b610db3565b6040516101e8919061227b565b61031261032d366004612262565b610e95565b61020461034036600461228e565b610f56565b610312610353366004612262565b610ffb565b610204611037565b61020461036e3660046120b9565b61104b565b610204610381366004612384565b6110cf565b6000546001600160a01b031661022c565b6103126103a53660046123d4565b6111b7565b6103126103b8366004612438565b611230565b6103126103cb366004612262565b611280565b6104156103de366004612262565b60008181526001602081815260408084205467ffffffffffffffff168452600a825280842094845293905291902080549101549091565b604080519283526020830191909152016101e8565b6102046104383660046120b9565b6112bc565b61020461044b36600461248f565b611407565b61047a61045e366004612262565b60016020526000908152604090205467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016101e8565b6102046104a13660046124b2565b611434565b6103126104b43660046121ab565b6114f0565b6102046104c73660046124ee565b6115ba565b60006104d78261164f565b92915050565b60005483906001600160a01b031633146104f657600080fd5b6000848152600160209081526040808320548151601f870184900484028101840190925285825283926060928392859267ffffffffffffffff90911691839161055e9183918d908d9081908401838280828437600092019190915250929392505061168d9050565b90505b80515160208201511015610688578661ffff166000036105c6578060400151965061058b816116ee565b94508460405160200161059e9190612509565b6040516020818303038152906040528051906020012092506105bf8161170f565b935061067a565b60006105d1826116ee565b9050816040015161ffff168861ffff161415806105f557506105f3868261172b565b155b15610678576106518c878a8e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518d915061064890829061253b565b8b51158a611749565b8160400151975081602001519650809550858051906020012093506106758261170f565b94505b505b610683816119b6565b610561565b508351156106e3576106e38a85888c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92506106da91508290508f61253b565b89511588611749565b50505050505050505050565b60005485906001600160a01b0316331461070857600080fd5b60008681526001602090815260408083205467ffffffffffffffff168352600b82528083208984529091529081902090518491849161074a908990899061254e565b908152602001604051809103902091826107659291906125e6565b50848460405161077692919061254e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516107b494939291906126cf565b60405180910390a3505050505050565b60008281526001602090815260408083205467ffffffffffffffff1683526008825280832085845282528083206001600160e01b0319851684529091528120546001600160a01b0316801561081a5790506104d7565b600061082585610d81565b90506001600160a01b038116610840576000925050506104d7565b6040516301ffc9a760e01b602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516108ad9190612509565b600060405180830381855afa9150503d80600081146108e8576040519150601f19603f3d011682016040523d82523d6000602084013e6108ed565b606091505b5091509150811580610900575060208151105b80610942575080601f8151811061091957610919612701565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109545760009450505050506104d7565b6040516001600160e01b0319871660248201526001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516109bf9190612509565b600060405180830381855afa9150503d80600081146109fa576040519150601f19603f3d011682016040523d82523d6000602084013e6109ff565b606091505b509092509050811580610a13575060208151105b80610a55575080601f81518110610a2c57610a2c612701565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610a675760009450505050506104d7565b509095945050505050565b60008281526001602081815260408084205467ffffffffffffffff1684526002825280842086855290915282206060915b848111610b8a5780851615801590610ad3575060008181526020839052604081208054610acf9061255e565b9050115b15610b825780826000838152602001908152602001600020808054610af79061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b239061255e565b8015610b705780601f10610b4557610100808354040283529160200191610b70565b820191906000526020600020905b815481529060010190602001808311610b5357829003601f168201915b50505050509050935093505050610ba3565b60011b610aa3565b5060006040518060200160405280600081525092509250505b9250929050565b60005483906001600160a01b03163314610bc357600080fd5b6040805180820182528481526020808201858152600088815260018084528582205467ffffffffffffffff168252600a84528582208a835290935284902092518355519101555184907f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4690610c449086908690918252602082015260400190565b60405180910390a250505050565b60005483906001600160a01b03163314610c6b57600080fd5b60008481526001602090815260408083205467ffffffffffffffff168352600482528083208784529091529020610ca38385836125e6565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610c44929190612717565b60005481906001600160a01b03163314610cef57600080fd5b6000828152600160205260408120805467ffffffffffffffff1691610d138361272b565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556000848152600160209081526040918290205491519190921681528492507fc6621ccb8f3f5a04bb6502154b2caf6adf5983fe76dfef1cfc9c42e3579db444910160405180910390a25050565b600080610d8f83603c6114f0565b90508051600003610da35750600092915050565b610dac81611a9e565b9392505050565b60008381526001602090815260408083205467ffffffffffffffff168352600b825280832086845290915290819020905160609190610df5908590859061254e565b90815260200160405180910390208054610e0e9061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3a9061255e565b8015610e875780601f10610e5c57610100808354040283529160200191610e87565b820191906000526020600020905b815481529060010190602001808311610e6a57829003601f168201915b505050505090509392505050565b60008181526001602090815260408083205467ffffffffffffffff168352600582528083208484529091529020805460609190610ed19061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610efd9061255e565b8015610f4a5780601f10610f1f57610100808354040283529160200191610f4a565b820191906000526020600020905b815481529060010190602001808311610f2d57829003601f168201915b50505050509050919050565b60005484906001600160a01b03163314610f6f57600080fd5b83610f7b60018261253b565b1615610f8657600080fd5b60008581526001602090815260408083205467ffffffffffffffff1683526002825280832088845282528083208784529091529020610fc68385836125e6565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b60008181526001602090815260408083205467ffffffffffffffff168352600982528083208484529091529020805460609190610ed19061255e565b61103f611ac6565b6110496000611b20565b565b60005483906001600160a01b0316331461106457600080fd5b60008481526001602090815260408083205467ffffffffffffffff16835260098252808320878452909152902061109c8385836125e6565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610c44929190612717565b60005483906001600160a01b031633146110e857600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af752848460405161111a92919061221d565b60405180910390a2603c830361117157837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd261115584611a9e565b6040516001600160a01b03909116815260200160405180910390a25b60008481526001602090815260408083205467ffffffffffffffff16835260038252808320878452825280832086845290915290206111b08382612752565b5050505050565b6060600080306001600160a01b0316846040516111d49190612509565b600060405180830381855afa9150503d806000811461120f576040519150601f19603f3d011682016040523d82523d6000602084013e611214565b606091505b509150915081156112285791506104d79050565b805160208201fd5b60008381526001602090815260408083205467ffffffffffffffff168352600682528083208684528252808320858452825280832061ffff851684529091529020805460609190610e0e9061255e565b60008181526001602090815260408083205467ffffffffffffffff168352600482528083208484529091529020805460609190610ed19061255e565b60005483906001600160a01b031633146112d557600080fd5b60008481526001602090815260408083205467ffffffffffffffff1680845260058352818420888552909252822080549192916113119061255e565b80601f016020809104026020016040519081016040528092919081815260200182805461133d9061255e565b801561138a5780601f1061135f5761010080835404028352916020019161138a565b820191906000526020600020905b81548152906001019060200180831161136d57829003601f168201915b5050505067ffffffffffffffff841660009081526005602090815260408083208b845290915290209192506113c290508587836125e6565b50857f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f858287876040516113f793929190612812565b60405180910390a2505050505050565b60005482906001600160a01b0316331461142057600080fd5b61142f83603c61038185611b7d565b505050565b60005483906001600160a01b0316331461144d57600080fd5b60008481526001602090815260408083205467ffffffffffffffff1683526008825280832087845282528083206001600160e01b0319871680855290835292819020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b60008281526001602090815260408083205467ffffffffffffffff16835260038252808320858452825280832084845290915290208054606091906115349061255e565b80601f01602080910402602001604051908101604052809291908181526020018280546115609061255e565b80156115ad5780601f10611582576101008083540402835291602001916115ad565b820191906000526020600020905b81548152906001019060200180831161159057829003601f168201915b5050505050905092915050565b6115c2611ac6565b6001600160a01b0381166116435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61164c81611b20565b50565b60006001600160e01b031982167f59d1d43c0000000000000000000000000000000000000000000000000000000014806104d757506104d782611bb6565b6116db6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526104d7816119b6565b602081015181516060916104d7916117069082611bf4565b84519190611c56565b60a081015160c08201516060916104d79161170690829061253b565b600081518351148015610dac5750610dac8360008460008751611ccd565b86516020880120600061175d878787611c56565b905083156118875767ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902080546117a89061255e565b1590506118075767ffffffffffffffff831660009081526007602090815260408083208d845282528083208584529091528120805461ffff16916117eb83612842565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152812061184891611ff1565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a60405161187a929190612860565b60405180910390a26106e3565b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902080546118ca9061255e565b905060000361192b5767ffffffffffffffff831660009081526007602090815260408083208d845282528083208584529091528120805461ffff169161190f83612886565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902061196d8282612752565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a846040516119a29392919061289d565b60405180910390a250505050505050505050565b60c081015160208201819052815151116119cd5750565b60006119e182600001518360200151611bf4565b82602001516119f091906128cc565b82519091506119ff9082611cf0565b61ffff166040830152611a136002826128cc565b8251909150611a229082611cf0565b61ffff166060830152611a366002826128cc565b8251909150611a459082611d18565b63ffffffff166080830152611a5b6004826128cc565b8251909150600090611a6d9083611cf0565b61ffff169050611a7e6002836128cc565b60a084018190529150611a9181836128cc565b60c0909301929092525050565b60008151601414611aae57600080fd5b50602001516c01000000000000000000000000900490565b6000546001600160a01b031633146110495760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161163a565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60006001600160e01b031982167fc86902330000000000000000000000000000000000000000000000000000000014806104d757506104d782611d42565b6000815b83518110611c0857611c086128df565b6000611c148583611d80565b60ff169050611c248160016128cc565b611c2e90836128cc565b915080600003611c3e5750611c44565b50611bf8565b611c4e838261253b565b949350505050565b8251606090611c6583856128cc565b1115611c7057600080fd5b60008267ffffffffffffffff811115611c8b57611c8b6122e1565b6040519080825280601f01601f191660200182016040528015611cb5576020820181803683370190505b50905060208082019086860101610a67828287611da4565b6000611cda848484611dfa565b611ce5878785611dfa565b149695505050505050565b8151600090611d008360026128cc565b1115611d0b57600080fd5b50016002015161ffff1690565b8151600090611d288360046128cc565b1115611d3357600080fd5b50016004015163ffffffff1690565b60006001600160e01b031982167f691f34310000000000000000000000000000000000000000000000000000000014806104d757506104d782611e1e565b6000828281518110611d9457611d94612701565b016020015160f81c905092915050565b60208110611ddc5781518352611dbb6020846128cc565b9250611dc86020836128cc565b9150611dd560208261253b565b9050611da4565b905182516020929092036101000a6000190180199091169116179052565b8251600090611e0983856128cc565b1115611e1457600080fd5b5091016020012090565b60006001600160e01b031982167f124a319c0000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167fa8fa5682000000000000000000000000000000000000000000000000000000001480611eba57506001600160e01b031982167f5c98042b00000000000000000000000000000000000000000000000000000000145b806104d757506104d78260006001600160e01b031982167fbc1c58d10000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167f3b3b57de000000000000000000000000000000000000000000000000000000001480611f6057506001600160e01b031982167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b806104d757506104d78260006001600160e01b031982167f2203ab560000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167fd700ff330000000000000000000000000000000000000000000000000000000014806104d757506301ffc9a760e01b6001600160e01b03198316146104d7565b508054611ffd9061255e565b6000825580601f1061200d575050565b601f01602090049060005260206000209081019061164c91905b8082111561203b5760008155600101612027565b5090565b80356001600160e01b03198116811461205757600080fd5b919050565b60006020828403121561206e57600080fd5b610dac8261203f565b60008083601f84011261208957600080fd5b50813567ffffffffffffffff8111156120a157600080fd5b602083019150836020828501011115610ba357600080fd5b6000806000604084860312156120ce57600080fd5b83359250602084013567ffffffffffffffff8111156120ec57600080fd5b6120f886828701612077565b9497909650939450505050565b60008060008060006060868803121561211d57600080fd5b85359450602086013567ffffffffffffffff8082111561213c57600080fd5b61214889838a01612077565b9096509450604088013591508082111561216157600080fd5b5061216e88828901612077565b969995985093965092949392505050565b6000806040838503121561219257600080fd5b823591506121a26020840161203f565b90509250929050565b600080604083850312156121be57600080fd5b50508035926020909101359150565b60005b838110156121e85781810151838201526020016121d0565b50506000910152565b600081518084526122098160208601602086016121cd565b601f01601f19169290920160200192915050565b828152604060208201526000611c4e60408301846121f1565b60008060006060848603121561224b57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561227457600080fd5b5035919050565b602081526000610dac60208301846121f1565b600080600080606085870312156122a457600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156122c957600080fd5b6122d587828801612077565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261230857600080fd5b813567ffffffffffffffff80821115612323576123236122e1565b604051601f8301601f19908116603f0116810190828211818310171561234b5761234b6122e1565b8160405283815286602085880101111561236457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561239957600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156123be57600080fd5b6123ca868287016122f7565b9150509250925092565b600080604083850312156123e757600080fd5b823567ffffffffffffffff808211156123ff57600080fd5b61240b868387016122f7565b9350602085013591508082111561242157600080fd5b5061242e858286016122f7565b9150509250929050565b60008060006060848603121561244d57600080fd5b8335925060208401359150604084013561ffff8116811461246d57600080fd5b809150509250925092565b80356001600160a01b038116811461205757600080fd5b600080604083850312156124a257600080fd5b823591506121a260208401612478565b6000806000606084860312156124c757600080fd5b833592506124d76020850161203f565b91506124e560408501612478565b90509250925092565b60006020828403121561250057600080fd5b610dac82612478565b6000825161251b8184602087016121cd565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104d7576104d7612525565b8183823760009101908152919050565b600181811c9082168061257257607f821691505b60208210810361259257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561142f57600081815260208120601f850160051c810160208610156125bf5750805b601f850160051c820191505b818110156125de578281556001016125cb565b505050505050565b67ffffffffffffffff8311156125fe576125fe6122e1565b6126128361260c835461255e565b83612598565b6000601f841160018114612646576000851561262e5750838201355b600019600387901b1c1916600186901b1783556111b0565b600083815260209020601f19861690835b828110156126775786850135825560209485019460019092019101612657565b50868210156126945760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260006126e36040830186886126a6565b82810360208401526126f68185876126a6565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b602081526000611c4e6020830184866126a6565b600067ffffffffffffffff80831681810361274857612748612525565b6001019392505050565b815167ffffffffffffffff81111561276c5761276c6122e1565b6127808161277a845461255e565b84612598565b602080601f8311600181146127b5576000841561279d5750858301515b600019600386901b1c1916600185901b1785556125de565b600085815260208120601f198616915b828110156127e4578886015182559484019460019091019084016127c5565b50858210156128025787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60408152600061282560408301866121f1565b82810360208401526128388185876126a6565b9695505050505050565b600061ffff82168061285657612856612525565b6000190192915050565b60408152600061287360408301856121f1565b905061ffff831660208301529392505050565b600061ffff80831681810361274857612748612525565b6060815260006128b060608301866121f1565b61ffff85166020840152828103604084015261283881856121f1565b808201808211156104d7576104d7612525565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220d63de109e6c80b38d1403d6423ad4efae0eced77107190ecf76f02ee79060a1864736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063c869023311610097578063d700ff3311610071578063d700ff3314610450578063e59d895d14610493578063f1cb7e06146104a6578063f2fde38b146104b957600080fd5b8063c8690233146103d0578063ce3decdc1461042a578063d5fa2b001461043d57600080fd5b80638da5cb5b116100d35780638da5cb5b146103865780639061b92314610397578063a8fa5682146103aa578063bc1c58d1146103bd57600080fd5b8063715018a61461035857806377372213146103605780638b95dd711461037357600080fd5b80633603d7581161016657806359d1d43c1161014057806359d1d43c146102ff5780635c98042b1461031f578063623195b014610332578063691f34311461034557600080fd5b80633603d7581461028b5780633b3b57de1461029e5780634cbf6ba4146102b157600080fd5b8063124a319c116101a2578063124a319c146102195780632203ab561461024457806329cd62ea14610265578063304e6ade1461027857600080fd5b806301ffc9a7146101c95780630af179d7146101f157806310f13a8c14610206575b600080fd5b6101dc6101d736600461205c565b6104cc565b60405190151581526020015b60405180910390f35b6102046101ff3660046120b9565b6104dd565b005b610204610214366004612105565b6106ef565b61022c61022736600461217f565b6107c4565b6040516001600160a01b0390911681526020016101e8565b6102576102523660046121ab565b610a72565b6040516101e892919061221d565b610204610273366004612236565b610baa565b6102046102863660046120b9565b610c52565b610204610299366004612262565b610cd6565b61022c6102ac366004612262565b610d81565b6101dc6102bf3660046121ab565b60008281526001602090815260408083205467ffffffffffffffff1683526007825280832094835293815283822092825291909152205461ffff16151590565b61031261030d3660046120b9565b610db3565b6040516101e8919061227b565b61031261032d366004612262565b610e95565b61020461034036600461228e565b610f56565b610312610353366004612262565b610ffb565b610204611037565b61020461036e3660046120b9565b61104b565b610204610381366004612384565b6110cf565b6000546001600160a01b031661022c565b6103126103a53660046123d4565b6111b7565b6103126103b8366004612438565b611230565b6103126103cb366004612262565b611280565b6104156103de366004612262565b60008181526001602081815260408084205467ffffffffffffffff168452600a825280842094845293905291902080549101549091565b604080519283526020830191909152016101e8565b6102046104383660046120b9565b6112bc565b61020461044b36600461248f565b611407565b61047a61045e366004612262565b60016020526000908152604090205467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016101e8565b6102046104a13660046124b2565b611434565b6103126104b43660046121ab565b6114f0565b6102046104c73660046124ee565b6115ba565b60006104d78261164f565b92915050565b60005483906001600160a01b031633146104f657600080fd5b6000848152600160209081526040808320548151601f870184900484028101840190925285825283926060928392859267ffffffffffffffff90911691839161055e9183918d908d9081908401838280828437600092019190915250929392505061168d9050565b90505b80515160208201511015610688578661ffff166000036105c6578060400151965061058b816116ee565b94508460405160200161059e9190612509565b6040516020818303038152906040528051906020012092506105bf8161170f565b935061067a565b60006105d1826116ee565b9050816040015161ffff168861ffff161415806105f557506105f3868261172b565b155b15610678576106518c878a8e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518d915061064890829061253b565b8b51158a611749565b8160400151975081602001519650809550858051906020012093506106758261170f565b94505b505b610683816119b6565b610561565b508351156106e3576106e38a85888c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92506106da91508290508f61253b565b89511588611749565b50505050505050505050565b60005485906001600160a01b0316331461070857600080fd5b60008681526001602090815260408083205467ffffffffffffffff168352600b82528083208984529091529081902090518491849161074a908990899061254e565b908152602001604051809103902091826107659291906125e6565b50848460405161077692919061254e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516107b494939291906126cf565b60405180910390a3505050505050565b60008281526001602090815260408083205467ffffffffffffffff1683526008825280832085845282528083206001600160e01b0319851684529091528120546001600160a01b0316801561081a5790506104d7565b600061082585610d81565b90506001600160a01b038116610840576000925050506104d7565b6040516301ffc9a760e01b602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516108ad9190612509565b600060405180830381855afa9150503d80600081146108e8576040519150601f19603f3d011682016040523d82523d6000602084013e6108ed565b606091505b5091509150811580610900575060208151105b80610942575080601f8151811061091957610919612701565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109545760009450505050506104d7565b6040516001600160e01b0319871660248201526001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516109bf9190612509565b600060405180830381855afa9150503d80600081146109fa576040519150601f19603f3d011682016040523d82523d6000602084013e6109ff565b606091505b509092509050811580610a13575060208151105b80610a55575080601f81518110610a2c57610a2c612701565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610a675760009450505050506104d7565b509095945050505050565b60008281526001602081815260408084205467ffffffffffffffff1684526002825280842086855290915282206060915b848111610b8a5780851615801590610ad3575060008181526020839052604081208054610acf9061255e565b9050115b15610b825780826000838152602001908152602001600020808054610af79061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b239061255e565b8015610b705780601f10610b4557610100808354040283529160200191610b70565b820191906000526020600020905b815481529060010190602001808311610b5357829003601f168201915b50505050509050935093505050610ba3565b60011b610aa3565b5060006040518060200160405280600081525092509250505b9250929050565b60005483906001600160a01b03163314610bc357600080fd5b6040805180820182528481526020808201858152600088815260018084528582205467ffffffffffffffff168252600a84528582208a835290935284902092518355519101555184907f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4690610c449086908690918252602082015260400190565b60405180910390a250505050565b60005483906001600160a01b03163314610c6b57600080fd5b60008481526001602090815260408083205467ffffffffffffffff168352600482528083208784529091529020610ca38385836125e6565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610c44929190612717565b60005481906001600160a01b03163314610cef57600080fd5b6000828152600160205260408120805467ffffffffffffffff1691610d138361272b565b82546101009290920a67ffffffffffffffff8181021990931691831602179091556000848152600160209081526040918290205491519190921681528492507fc6621ccb8f3f5a04bb6502154b2caf6adf5983fe76dfef1cfc9c42e3579db444910160405180910390a25050565b600080610d8f83603c6114f0565b90508051600003610da35750600092915050565b610dac81611a9e565b9392505050565b60008381526001602090815260408083205467ffffffffffffffff168352600b825280832086845290915290819020905160609190610df5908590859061254e565b90815260200160405180910390208054610e0e9061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3a9061255e565b8015610e875780601f10610e5c57610100808354040283529160200191610e87565b820191906000526020600020905b815481529060010190602001808311610e6a57829003601f168201915b505050505090509392505050565b60008181526001602090815260408083205467ffffffffffffffff168352600582528083208484529091529020805460609190610ed19061255e565b80601f0160208091040260200160405190810160405280929190818152602001828054610efd9061255e565b8015610f4a5780601f10610f1f57610100808354040283529160200191610f4a565b820191906000526020600020905b815481529060010190602001808311610f2d57829003601f168201915b50505050509050919050565b60005484906001600160a01b03163314610f6f57600080fd5b83610f7b60018261253b565b1615610f8657600080fd5b60008581526001602090815260408083205467ffffffffffffffff1683526002825280832088845282528083208784529091529020610fc68385836125e6565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b60008181526001602090815260408083205467ffffffffffffffff168352600982528083208484529091529020805460609190610ed19061255e565b61103f611ac6565b6110496000611b20565b565b60005483906001600160a01b0316331461106457600080fd5b60008481526001602090815260408083205467ffffffffffffffff16835260098252808320878452909152902061109c8385836125e6565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610c44929190612717565b60005483906001600160a01b031633146110e857600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af752848460405161111a92919061221d565b60405180910390a2603c830361117157837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd261115584611a9e565b6040516001600160a01b03909116815260200160405180910390a25b60008481526001602090815260408083205467ffffffffffffffff16835260038252808320878452825280832086845290915290206111b08382612752565b5050505050565b6060600080306001600160a01b0316846040516111d49190612509565b600060405180830381855afa9150503d806000811461120f576040519150601f19603f3d011682016040523d82523d6000602084013e611214565b606091505b509150915081156112285791506104d79050565b805160208201fd5b60008381526001602090815260408083205467ffffffffffffffff168352600682528083208684528252808320858452825280832061ffff851684529091529020805460609190610e0e9061255e565b60008181526001602090815260408083205467ffffffffffffffff168352600482528083208484529091529020805460609190610ed19061255e565b60005483906001600160a01b031633146112d557600080fd5b60008481526001602090815260408083205467ffffffffffffffff1680845260058352818420888552909252822080549192916113119061255e565b80601f016020809104026020016040519081016040528092919081815260200182805461133d9061255e565b801561138a5780601f1061135f5761010080835404028352916020019161138a565b820191906000526020600020905b81548152906001019060200180831161136d57829003601f168201915b5050505067ffffffffffffffff841660009081526005602090815260408083208b845290915290209192506113c290508587836125e6565b50857f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f858287876040516113f793929190612812565b60405180910390a2505050505050565b60005482906001600160a01b0316331461142057600080fd5b61142f83603c61038185611b7d565b505050565b60005483906001600160a01b0316331461144d57600080fd5b60008481526001602090815260408083205467ffffffffffffffff1683526008825280832087845282528083206001600160e01b0319871680855290835292819020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b60008281526001602090815260408083205467ffffffffffffffff16835260038252808320858452825280832084845290915290208054606091906115349061255e565b80601f01602080910402602001604051908101604052809291908181526020018280546115609061255e565b80156115ad5780601f10611582576101008083540402835291602001916115ad565b820191906000526020600020905b81548152906001019060200180831161159057829003601f168201915b5050505050905092915050565b6115c2611ac6565b6001600160a01b0381166116435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61164c81611b20565b50565b60006001600160e01b031982167f59d1d43c0000000000000000000000000000000000000000000000000000000014806104d757506104d782611bb6565b6116db6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526104d7816119b6565b602081015181516060916104d7916117069082611bf4565b84519190611c56565b60a081015160c08201516060916104d79161170690829061253b565b600081518351148015610dac5750610dac8360008460008751611ccd565b86516020880120600061175d878787611c56565b905083156118875767ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902080546117a89061255e565b1590506118075767ffffffffffffffff831660009081526007602090815260408083208d845282528083208584529091528120805461ffff16916117eb83612842565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152812061184891611ff1565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a60405161187a929190612860565b60405180910390a26106e3565b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902080546118ca9061255e565b905060000361192b5767ffffffffffffffff831660009081526007602090815260408083208d845282528083208584529091528120805461ffff169161190f83612886565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526006602090815260408083208d84528252808320858452825280832061ffff8c168452909152902061196d8282612752565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a846040516119a29392919061289d565b60405180910390a250505050505050505050565b60c081015160208201819052815151116119cd5750565b60006119e182600001518360200151611bf4565b82602001516119f091906128cc565b82519091506119ff9082611cf0565b61ffff166040830152611a136002826128cc565b8251909150611a229082611cf0565b61ffff166060830152611a366002826128cc565b8251909150611a459082611d18565b63ffffffff166080830152611a5b6004826128cc565b8251909150600090611a6d9083611cf0565b61ffff169050611a7e6002836128cc565b60a084018190529150611a9181836128cc565b60c0909301929092525050565b60008151601414611aae57600080fd5b50602001516c01000000000000000000000000900490565b6000546001600160a01b031633146110495760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161163a565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60006001600160e01b031982167fc86902330000000000000000000000000000000000000000000000000000000014806104d757506104d782611d42565b6000815b83518110611c0857611c086128df565b6000611c148583611d80565b60ff169050611c248160016128cc565b611c2e90836128cc565b915080600003611c3e5750611c44565b50611bf8565b611c4e838261253b565b949350505050565b8251606090611c6583856128cc565b1115611c7057600080fd5b60008267ffffffffffffffff811115611c8b57611c8b6122e1565b6040519080825280601f01601f191660200182016040528015611cb5576020820181803683370190505b50905060208082019086860101610a67828287611da4565b6000611cda848484611dfa565b611ce5878785611dfa565b149695505050505050565b8151600090611d008360026128cc565b1115611d0b57600080fd5b50016002015161ffff1690565b8151600090611d288360046128cc565b1115611d3357600080fd5b50016004015163ffffffff1690565b60006001600160e01b031982167f691f34310000000000000000000000000000000000000000000000000000000014806104d757506104d782611e1e565b6000828281518110611d9457611d94612701565b016020015160f81c905092915050565b60208110611ddc5781518352611dbb6020846128cc565b9250611dc86020836128cc565b9150611dd560208261253b565b9050611da4565b905182516020929092036101000a6000190180199091169116179052565b8251600090611e0983856128cc565b1115611e1457600080fd5b5091016020012090565b60006001600160e01b031982167f124a319c0000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167fa8fa5682000000000000000000000000000000000000000000000000000000001480611eba57506001600160e01b031982167f5c98042b00000000000000000000000000000000000000000000000000000000145b806104d757506104d78260006001600160e01b031982167fbc1c58d10000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167f3b3b57de000000000000000000000000000000000000000000000000000000001480611f6057506001600160e01b031982167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b806104d757506104d78260006001600160e01b031982167f2203ab560000000000000000000000000000000000000000000000000000000014806104d757506104d78260006001600160e01b031982167fd700ff330000000000000000000000000000000000000000000000000000000014806104d757506301ffc9a760e01b6001600160e01b03198316146104d7565b508054611ffd9061255e565b6000825580601f1061200d575050565b601f01602090049060005260206000209081019061164c91905b8082111561203b5760008155600101612027565b5090565b80356001600160e01b03198116811461205757600080fd5b919050565b60006020828403121561206e57600080fd5b610dac8261203f565b60008083601f84011261208957600080fd5b50813567ffffffffffffffff8111156120a157600080fd5b602083019150836020828501011115610ba357600080fd5b6000806000604084860312156120ce57600080fd5b83359250602084013567ffffffffffffffff8111156120ec57600080fd5b6120f886828701612077565b9497909650939450505050565b60008060008060006060868803121561211d57600080fd5b85359450602086013567ffffffffffffffff8082111561213c57600080fd5b61214889838a01612077565b9096509450604088013591508082111561216157600080fd5b5061216e88828901612077565b969995985093965092949392505050565b6000806040838503121561219257600080fd5b823591506121a26020840161203f565b90509250929050565b600080604083850312156121be57600080fd5b50508035926020909101359150565b60005b838110156121e85781810151838201526020016121d0565b50506000910152565b600081518084526122098160208601602086016121cd565b601f01601f19169290920160200192915050565b828152604060208201526000611c4e60408301846121f1565b60008060006060848603121561224b57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561227457600080fd5b5035919050565b602081526000610dac60208301846121f1565b600080600080606085870312156122a457600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156122c957600080fd5b6122d587828801612077565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261230857600080fd5b813567ffffffffffffffff80821115612323576123236122e1565b604051601f8301601f19908116603f0116810190828211818310171561234b5761234b6122e1565b8160405283815286602085880101111561236457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561239957600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156123be57600080fd5b6123ca868287016122f7565b9150509250925092565b600080604083850312156123e757600080fd5b823567ffffffffffffffff808211156123ff57600080fd5b61240b868387016122f7565b9350602085013591508082111561242157600080fd5b5061242e858286016122f7565b9150509250929050565b60008060006060848603121561244d57600080fd5b8335925060208401359150604084013561ffff8116811461246d57600080fd5b809150509250925092565b80356001600160a01b038116811461205757600080fd5b600080604083850312156124a257600080fd5b823591506121a260208401612478565b6000806000606084860312156124c757600080fd5b833592506124d76020850161203f565b91506124e560408501612478565b90509250925092565b60006020828403121561250057600080fd5b610dac82612478565b6000825161251b8184602087016121cd565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104d7576104d7612525565b8183823760009101908152919050565b600181811c9082168061257257607f821691505b60208210810361259257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561142f57600081815260208120601f850160051c810160208610156125bf5750805b601f850160051c820191505b818110156125de578281556001016125cb565b505050505050565b67ffffffffffffffff8311156125fe576125fe6122e1565b6126128361260c835461255e565b83612598565b6000601f841160018114612646576000851561262e5750838201355b600019600387901b1c1916600186901b1783556111b0565b600083815260209020601f19861690835b828110156126775786850135825560209485019460019092019101612657565b50868210156126945760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260006126e36040830186886126a6565b82810360208401526126f68185876126a6565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b602081526000611c4e6020830184866126a6565b600067ffffffffffffffff80831681810361274857612748612525565b6001019392505050565b815167ffffffffffffffff81111561276c5761276c6122e1565b6127808161277a845461255e565b84612598565b602080601f8311600181146127b5576000841561279d5750858301515b600019600386901b1c1916600185901b1785556125de565b600085815260208120601f198616915b828110156127e4578886015182559484019460019091019084016127c5565b50858210156128025787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60408152600061282560408301866121f1565b82810360208401526128388185876126a6565b9695505050505050565b600061ffff82168061285657612856612525565b6000190192915050565b60408152600061287360408301856121f1565b905061ffff831660208301529392505050565b600061ffff80831681810361274857612748612525565b6060815260006128b060608301866121f1565b61ffff85166020840152828103604084015261283881856121f1565b808201808211156104d7576104d7612525565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220d63de109e6c80b38d1403d6423ad4efae0eced77107190ecf76f02ee79060a1864736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "ABI(bytes32,uint256)": { + "params": { + "contentTypes": "A bitwise OR of the ABI formats accepted by the caller.", + "node": "The ENS node to query" + }, + "returns": { + "_0": "contentType The content type of the return value", + "_1": "data The ABI data" + } + }, + "addr(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated address." + } + }, + "clearRecords(bytes32)": { + "params": { + "node": "The node to update." + } + }, + "contenthash(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated contenthash." + } + }, + "dnsRecord(bytes32,bytes32,uint16)": { + "params": { + "name": "the keccak-256 hash of the fully-qualified name for which to fetch the record", + "node": "the namehash of the node for which to fetch the record", + "resource": "the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types" + }, + "returns": { + "_0": "the DNS record in wire format if present, otherwise empty" + } + }, + "hasDNSRecords(bytes32,bytes32)": { + "params": { + "name": "the namehash of the node for which to check the records", + "node": "the namehash of the node for which to check the records" + } + }, + "interfaceImplementer(bytes32,bytes4)": { + "params": { + "interfaceID": "The EIP 165 interface ID to check for.", + "node": "The ENS node to query." + }, + "returns": { + "_0": "The address that implements this interface, or 0 if the interface is unsupported." + } + }, + "name(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated name." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pubkey(bytes32)": { + "params": { + "node": "The ENS node to query" + }, + "returns": { + "x": "The X coordinate of the curve point for the public key.", + "y": "The Y coordinate of the curve point for the public key." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setABI(bytes32,uint256,bytes)": { + "params": { + "contentType": "The content type of the ABI", + "data": "The ABI data.", + "node": "The node to update." + } + }, + "setAddr(bytes32,address)": { + "params": { + "a": "The address to set.", + "node": "The node to update." + } + }, + "setContenthash(bytes32,bytes)": { + "params": { + "hash": "The contenthash to set", + "node": "The node to update." + } + }, + "setDNSRecords(bytes32,bytes)": { + "params": { + "data": "the DNS wire format records to set", + "node": "the namehash of the node for which to set the records" + } + }, + "setInterface(bytes32,bytes4,address)": { + "params": { + "implementer": "The address of a contract that implements this interface for this node.", + "interfaceID": "The EIP 165 interface ID.", + "node": "The node to update." + } + }, + "setName(bytes32,string)": { + "params": { + "node": "The node to update." + } + }, + "setPubkey(bytes32,bytes32,bytes32)": { + "params": { + "node": "The ENS node to query", + "x": "the X coordinate of the curve point for the public key.", + "y": "the Y coordinate of the curve point for the public key." + } + }, + "setText(bytes32,string,string)": { + "params": { + "key": "The key to set.", + "node": "The node to update.", + "value": "The text data value to set." + } + }, + "setZonehash(bytes32,bytes)": { + "params": { + "hash": "The zonehash to set", + "node": "The node to update." + } + }, + "text(bytes32,string)": { + "params": { + "key": "The text data key to query.", + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated text data." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "zonehash(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated contenthash." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "ABI(bytes32,uint256)": { + "notice": "Returns the ABI associated with an ENS node. Defined in EIP205." + }, + "addr(bytes32)": { + "notice": "Returns the address associated with an ENS node." + }, + "clearRecords(bytes32)": { + "notice": "Increments the record version associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "contenthash(bytes32)": { + "notice": "Returns the contenthash associated with an ENS node." + }, + "dnsRecord(bytes32,bytes32,uint16)": { + "notice": "Obtain a DNS record." + }, + "hasDNSRecords(bytes32,bytes32)": { + "notice": "Check if a given node has records." + }, + "interfaceImplementer(bytes32,bytes4)": { + "notice": "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." + }, + "name(bytes32)": { + "notice": "Returns the name associated with an ENS node, for reverse records. Defined in EIP181." + }, + "pubkey(bytes32)": { + "notice": "Returns the SECP256k1 public key associated with an ENS node. Defined in EIP 619." + }, + "setABI(bytes32,uint256,bytes)": { + "notice": "Sets the ABI associated with an ENS node. Nodes may have one ABI of each content type. To remove an ABI, set it to the empty string." + }, + "setAddr(bytes32,address)": { + "notice": "Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "setContenthash(bytes32,bytes)": { + "notice": "Sets the contenthash associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "setDNSRecords(bytes32,bytes)": { + "notice": "Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first." + }, + "setInterface(bytes32,bytes4,address)": { + "notice": "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." + }, + "setName(bytes32,string)": { + "notice": "Sets the name associated with an ENS node, for reverse records. May only be called by the owner of that node in the ENS registry." + }, + "setPubkey(bytes32,bytes32,bytes32)": { + "notice": "Sets the SECP256k1 public key associated with an ENS node." + }, + "setText(bytes32,string,string)": { + "notice": "Sets the text data associated with an ENS node and key. May only be called by the owner of that node in the ENS registry." + }, + "setZonehash(bytes32,bytes)": { + "notice": "setZonehash sets the hash for the zone. May only be called by the owner of that node in the ENS registry." + }, + "text(bytes32,string)": { + "notice": "Returns the text data associated with an ENS node and key." + }, + "zonehash(bytes32)": { + "notice": "zonehash obtains the hash for the zone." + } + }, + "notice": "A simple resolver anyone can use; only allows the owner of a node to set its address.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 15571, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "recordVersions", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint64)" + }, + { + "astId": 15665, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_abis", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))" + }, + { + "astId": 15819, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_addresses", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))" + }, + { + "astId": 16010, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_hashes", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))" + }, + { + "astId": 16100, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_zonehashes", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))" + }, + { + "astId": 16110, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_records", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))" + }, + { + "astId": 16118, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_nameEntriesCount", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16)))" + }, + { + "astId": 16856, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_interfaces", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes4,t_address)))" + }, + { + "astId": 17048, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_names", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_string_storage))" + }, + { + "astId": 17135, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_pubkeys", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_struct(PublicKey)17128_storage))" + }, + { + "astId": 17238, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "versionable_texts", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage)))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes32 => uint16))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_uint16)" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes4,t_address))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes4 => address))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes4,t_address)" + }, + "t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(string => string))", + "numberOfBytes": "32", + "value": "t_mapping(t_string_memory_ptr,t_string_storage)" + }, + "t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint16 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint16,t_bytes_storage)" + }, + "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint256 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_bytes_storage)" + }, + "t_mapping(t_bytes32,t_string_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_bytes32,t_struct(PublicKey)17128_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct PubkeyResolver.PublicKey)", + "numberOfBytes": "32", + "value": "t_struct(PublicKey)17128_storage" + }, + "t_mapping(t_bytes32,t_uint16)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint16)", + "numberOfBytes": "32", + "value": "t_uint16" + }, + "t_mapping(t_bytes32,t_uint64)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint64)", + "numberOfBytes": "32", + "value": "t_uint64" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_string_memory_ptr,t_string_storage)": { + "encoding": "mapping", + "key": "t_string_memory_ptr", + "label": "mapping(string => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_uint16,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint16", + "label": "mapping(uint16 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint256,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_bytes_storage)" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes4,t_address)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes4,t_address))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(string => string)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_string_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => string))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_string_storage)" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_struct(PublicKey)17128_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => struct PubkeyResolver.PublicKey))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_struct(PublicKey)17128_storage)" + }, + "t_string_memory_ptr": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(PublicKey)17128_storage": { + "encoding": "inplace", + "label": "struct PubkeyResolver.PublicKey", + "members": [ + { + "astId": 17125, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "x", + "offset": 0, + "slot": "0", + "type": "t_bytes32" + }, + { + "astId": 17127, + "contract": "contracts/resolvers/OwnedResolver.sol:OwnedResolver", + "label": "y", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/PublicResolver.json b/deployments/sepolia/PublicResolver.json new file mode 100644 index 00000000..07fa1e4e --- /dev/null +++ b/deployments/sepolia/PublicResolver.json @@ -0,0 +1,1676 @@ +{ + "address": "0x8FADE66B79cC9f707aB26799354482EB93a5B7dD", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + }, + { + "internalType": "contract INameWrapper", + "name": "wrapperAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_trustedETHController", + "type": "address" + }, + { + "internalType": "address", + "name": "_trustedReverseRegistrar", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + } + ], + "name": "ABIChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "AddrChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "newAddress", + "type": "bytes" + } + ], + "name": "AddressChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "Approved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "ContenthashChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "record", + "type": "bytes" + } + ], + "name": "DNSRecordChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "DNSRecordDeleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "lastzonehash", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "zonehash", + "type": "bytes" + } + ], + "name": "DNSZonehashChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "InterfaceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "NameChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "PubkeyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "string", + "name": "indexedKey", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "TextChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "newVersion", + "type": "uint64" + } + ], + "name": "VersionChanged", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentTypes", + "type": "uint256" + } + ], + "name": "ABI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + } + ], + "name": "addr", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "clearRecords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "contenthash", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "resource", + "type": "uint16" + } + ], + "name": "dnsRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "name", + "type": "bytes32" + } + ], + "name": "hasDNSRecords", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "interfaceImplementer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "isApprovedFor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "nodehash", + "type": "bytes32" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicallWithNodeCheck", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "pubkey", + "outputs": [ + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "recordVersions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "contentType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setABI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "coinType", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "a", + "type": "bytes" + } + ], + "name": "setAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "setAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "setContenthash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "setDNSRecords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "implementer", + "type": "address" + } + ], + "name": "setInterface", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "x", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "y", + "type": "bytes32" + } + ], + "name": "setPubkey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "string", + "name": "value", + "type": "string" + } + ], + "name": "setText", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "hash", + "type": "bytes" + } + ], + "name": "setZonehash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "text", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "zonehash", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xf613ca298ad5405e61f8f0e52e550e3b99fb120c8cb762bc2acabdca0a1d9643", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x8FADE66B79cC9f707aB26799354482EB93a5B7dD", + "transactionIndex": 40, + "gasUsed": "2764151", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000004080000000000000000000000001000010000000000000000000000000000000000000000000008000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000010200000000000000000000000000000040000000018000000000000000000000000008000040000000000000000000000000000020000005000000000000000000100000000000000000000000400000000000020000100000000200000001000000000080000000000", + "blockHash": "0x574928ca607e35eb33265beb0b585f66f05e6f8f8ceb4329a1e17f89d1d8fd89", + "transactionHash": "0xf613ca298ad5405e61f8f0e52e550e3b99fb120c8cb762bc2acabdca0a1d9643", + "logs": [ + { + "transactionIndex": 40, + "blockNumber": 3790251, + "transactionHash": "0xf613ca298ad5405e61f8f0e52e550e3b99fb120c8cb762bc2acabdca0a1d9643", + "address": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "topics": [ + "0x6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e92", + "0x0000000000000000000000008fade66b79cc9f707ab26799354482eb93a5b7dd", + "0x98dd6c4977da46b36248a3187e784448ad54166b4b5ee41160f52f31e87c51a5" + ], + "data": "0x", + "logIndex": 95, + "blockHash": "0x574928ca607e35eb33265beb0b585f66f05e6f8f8ceb4329a1e17f89d1d8fd89" + }, + { + "transactionIndex": 40, + "blockNumber": 3790251, + "transactionHash": "0xf613ca298ad5405e61f8f0e52e550e3b99fb120c8cb762bc2acabdca0a1d9643", + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "topics": [ + "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", + "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2", + "0xbbcf857a065936fbc59ed33e4bc898ed6a35991ec8a87400a8e5bae21ec29e4a" + ], + "data": "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "logIndex": 96, + "blockHash": "0x574928ca607e35eb33265beb0b585f66f05e6f8f8ceb4329a1e17f89d1d8fd89" + } + ], + "blockNumber": 3790251, + "cumulativeGasUsed": "8834286", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0x0635513f179D50A207757E05759CbD106d7dFcE8", + "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72", + "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"},{\"internalType\":\"contract INameWrapper\",\"name\":\"wrapperAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trustedETHController\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_trustedReverseRegistrar\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"contentType\",\"type\":\"uint256\"}],\"name\":\"ABIChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"AddrChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"newAddress\",\"type\":\"bytes\"}],\"name\":\"AddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"Approved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"ContenthashChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"record\",\"type\":\"bytes\"}],\"name\":\"DNSRecordChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"}],\"name\":\"DNSRecordDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"lastzonehash\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"zonehash\",\"type\":\"bytes\"}],\"name\":\"DNSZonehashChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"implementer\",\"type\":\"address\"}],\"name\":\"InterfaceChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NameChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"PubkeyChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"indexedKey\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"name\":\"TextChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newVersion\",\"type\":\"uint64\"}],\"name\":\"VersionChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"contentTypes\",\"type\":\"uint256\"}],\"name\":\"ABI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"addr\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"}],\"name\":\"addr\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"clearRecords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"contenthash\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"uint16\",\"name\":\"resource\",\"type\":\"uint16\"}],\"name\":\"dnsRecord\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"hasDNSRecords\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"interfaceImplementer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"isApprovedFor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nodehash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicallWithNodeCheck\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"pubkey\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"recordVersions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"contentType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setABI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"coinType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"a\",\"type\":\"bytes\"}],\"name\":\"setAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"setAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"setContenthash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setDNSRecords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"implementer\",\"type\":\"address\"}],\"name\":\"setInterface\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"x\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"setPubkey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"}],\"name\":\"setText\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"hash\",\"type\":\"bytes\"}],\"name\":\"setZonehash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"}],\"name\":\"text\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"zonehash\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"ABI(bytes32,uint256)\":{\"params\":{\"contentTypes\":\"A bitwise OR of the ABI formats accepted by the caller.\",\"node\":\"The ENS node to query\"},\"returns\":{\"_0\":\"contentType The content type of the return value\",\"_1\":\"data The ABI data\"}},\"addr(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated address.\"}},\"approve(bytes32,address,bool)\":{\"details\":\"Approve a delegate to be able to updated records on a node.\"},\"clearRecords(bytes32)\":{\"params\":{\"node\":\"The node to update.\"}},\"contenthash(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated contenthash.\"}},\"dnsRecord(bytes32,bytes32,uint16)\":{\"params\":{\"name\":\"the keccak-256 hash of the fully-qualified name for which to fetch the record\",\"node\":\"the namehash of the node for which to fetch the record\",\"resource\":\"the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\"},\"returns\":{\"_0\":\"the DNS record in wire format if present, otherwise empty\"}},\"hasDNSRecords(bytes32,bytes32)\":{\"params\":{\"name\":\"the namehash of the node for which to check the records\",\"node\":\"the namehash of the node for which to check the records\"}},\"interfaceImplementer(bytes32,bytes4)\":{\"params\":{\"interfaceID\":\"The EIP 165 interface ID to check for.\",\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The address that implements this interface, or 0 if the interface is unsupported.\"}},\"isApprovedFor(address,bytes32,address)\":{\"details\":\"Check to see if the delegate has been approved by the owner for the node.\"},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC1155-isApprovedForAll}.\"},\"name(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated name.\"}},\"pubkey(bytes32)\":{\"params\":{\"node\":\"The ENS node to query\"},\"returns\":{\"x\":\"The X coordinate of the curve point for the public key.\",\"y\":\"The Y coordinate of the curve point for the public key.\"}},\"setABI(bytes32,uint256,bytes)\":{\"params\":{\"contentType\":\"The content type of the ABI\",\"data\":\"The ABI data.\",\"node\":\"The node to update.\"}},\"setAddr(bytes32,address)\":{\"params\":{\"a\":\"The address to set.\",\"node\":\"The node to update.\"}},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC1155-setApprovalForAll}.\"},\"setContenthash(bytes32,bytes)\":{\"params\":{\"hash\":\"The contenthash to set\",\"node\":\"The node to update.\"}},\"setDNSRecords(bytes32,bytes)\":{\"params\":{\"data\":\"the DNS wire format records to set\",\"node\":\"the namehash of the node for which to set the records\"}},\"setInterface(bytes32,bytes4,address)\":{\"params\":{\"implementer\":\"The address of a contract that implements this interface for this node.\",\"interfaceID\":\"The EIP 165 interface ID.\",\"node\":\"The node to update.\"}},\"setName(bytes32,string)\":{\"params\":{\"node\":\"The node to update.\"}},\"setPubkey(bytes32,bytes32,bytes32)\":{\"params\":{\"node\":\"The ENS node to query\",\"x\":\"the X coordinate of the curve point for the public key.\",\"y\":\"the Y coordinate of the curve point for the public key.\"}},\"setText(bytes32,string,string)\":{\"params\":{\"key\":\"The key to set.\",\"node\":\"The node to update.\",\"value\":\"The text data value to set.\"}},\"setZonehash(bytes32,bytes)\":{\"params\":{\"hash\":\"The zonehash to set\",\"node\":\"The node to update.\"}},\"text(bytes32,string)\":{\"params\":{\"key\":\"The text data key to query.\",\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated text data.\"}},\"zonehash(bytes32)\":{\"params\":{\"node\":\"The ENS node to query.\"},\"returns\":{\"_0\":\"The associated contenthash.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"ABI(bytes32,uint256)\":{\"notice\":\"Returns the ABI associated with an ENS node. Defined in EIP205.\"},\"addr(bytes32)\":{\"notice\":\"Returns the address associated with an ENS node.\"},\"clearRecords(bytes32)\":{\"notice\":\"Increments the record version associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"contenthash(bytes32)\":{\"notice\":\"Returns the contenthash associated with an ENS node.\"},\"dnsRecord(bytes32,bytes32,uint16)\":{\"notice\":\"Obtain a DNS record.\"},\"hasDNSRecords(bytes32,bytes32)\":{\"notice\":\"Check if a given node has records.\"},\"interfaceImplementer(bytes32,bytes4)\":{\"notice\":\"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.\"},\"name(bytes32)\":{\"notice\":\"Returns the name associated with an ENS node, for reverse records. Defined in EIP181.\"},\"pubkey(bytes32)\":{\"notice\":\"Returns the SECP256k1 public key associated with an ENS node. Defined in EIP 619.\"},\"setABI(bytes32,uint256,bytes)\":{\"notice\":\"Sets the ABI associated with an ENS node. Nodes may have one ABI of each content type. To remove an ABI, set it to the empty string.\"},\"setAddr(bytes32,address)\":{\"notice\":\"Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"setContenthash(bytes32,bytes)\":{\"notice\":\"Sets the contenthash associated with an ENS node. May only be called by the owner of that node in the ENS registry.\"},\"setDNSRecords(bytes32,bytes)\":{\"notice\":\"Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first.\"},\"setInterface(bytes32,bytes4,address)\":{\"notice\":\"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.\"},\"setName(bytes32,string)\":{\"notice\":\"Sets the name associated with an ENS node, for reverse records. May only be called by the owner of that node in the ENS registry.\"},\"setPubkey(bytes32,bytes32,bytes32)\":{\"notice\":\"Sets the SECP256k1 public key associated with an ENS node.\"},\"setText(bytes32,string,string)\":{\"notice\":\"Sets the text data associated with an ENS node and key. May only be called by the owner of that node in the ENS registry.\"},\"setZonehash(bytes32,bytes)\":{\"notice\":\"setZonehash sets the hash for the zone. May only be called by the owner of that node in the ENS registry.\"},\"text(bytes32,string)\":{\"notice\":\"Returns the text data associated with an ENS node and key.\"},\"zonehash(bytes32)\":{\"notice\":\"zonehash obtains the hash for the zone.\"}},\"notice\":\"A simple resolver anyone can use; only allows the owner of a node to set its address.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/resolvers/PublicResolver.sol\":\"PublicResolver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@ensdomains/buffer/contracts/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\\n\",\"keccak256\":\"0xd6dd3b0b327288f8e1b711a609f4040fea602e2ad4bba9febdf2f33b4e56eb0c\",\"license\":\"BSD-2-Clause\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/dnssec-oracle/BytesUtils.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nlibrary BytesUtils {\\n error OffsetOutOfBoundsError(uint256 offset, uint256 length);\\n\\n /*\\n * @dev Returns the keccak-256 hash of a byte range.\\n * @param self The byte string to hash.\\n * @param offset The position to start hashing at.\\n * @param len The number of bytes to hash.\\n * @return The hash of the byte range.\\n */\\n function keccak(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(offset + len <= self.length);\\n assembly {\\n ret := keccak256(add(add(self, 32), offset), len)\\n }\\n }\\n\\n /*\\n * @dev Returns a positive number if `other` comes lexicographically after\\n * `self`, a negative number if it comes before, or zero if the\\n * contents of the two bytes are equal.\\n * @param self The first bytes to compare.\\n * @param other The second bytes to compare.\\n * @return The result of the comparison.\\n */\\n function compare(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (int256) {\\n return compare(self, 0, self.length, other, 0, other.length);\\n }\\n\\n /*\\n * @dev Returns a positive number if `other` comes lexicographically after\\n * `self`, a negative number if it comes before, or zero if the\\n * contents of the two bytes are equal. Comparison is done per-rune,\\n * on unicode codepoints.\\n * @param self The first bytes to compare.\\n * @param offset The offset of self.\\n * @param len The length of self.\\n * @param other The second bytes to compare.\\n * @param otheroffset The offset of the other string.\\n * @param otherlen The length of the other string.\\n * @return The result of the comparison.\\n */\\n function compare(\\n bytes memory self,\\n uint256 offset,\\n uint256 len,\\n bytes memory other,\\n uint256 otheroffset,\\n uint256 otherlen\\n ) internal pure returns (int256) {\\n if (offset + len > self.length) {\\n revert OffsetOutOfBoundsError(offset + len, self.length);\\n }\\n if (otheroffset + otherlen > other.length) {\\n revert OffsetOutOfBoundsError(otheroffset + otherlen, other.length);\\n }\\n\\n uint256 shortest = len;\\n if (otherlen < len) shortest = otherlen;\\n\\n uint256 selfptr;\\n uint256 otherptr;\\n\\n assembly {\\n selfptr := add(self, add(offset, 32))\\n otherptr := add(other, add(otheroffset, 32))\\n }\\n for (uint256 idx = 0; idx < shortest; idx += 32) {\\n uint256 a;\\n uint256 b;\\n assembly {\\n a := mload(selfptr)\\n b := mload(otherptr)\\n }\\n if (a != b) {\\n // Mask out irrelevant bytes and check again\\n uint256 mask;\\n if (shortest - idx >= 32) {\\n mask = type(uint256).max;\\n } else {\\n mask = ~(2 ** (8 * (idx + 32 - shortest)) - 1);\\n }\\n int256 diff = int256(a & mask) - int256(b & mask);\\n if (diff != 0) return diff;\\n }\\n selfptr += 32;\\n otherptr += 32;\\n }\\n\\n return int256(len) - int256(otherlen);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @param otherOffset The offset into the second byte range.\\n * @param len The number of bytes to compare\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other,\\n uint256 otherOffset,\\n uint256 len\\n ) internal pure returns (bool) {\\n return keccak(self, offset, len) == keccak(other, otherOffset, len);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal with offsets.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @param otherOffset The offset into the second byte range.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other,\\n uint256 otherOffset\\n ) internal pure returns (bool) {\\n return\\n keccak(self, offset, self.length - offset) ==\\n keccak(other, otherOffset, other.length - otherOffset);\\n }\\n\\n /*\\n * @dev Compares a range of 'self' to all of 'other' and returns True iff\\n * they are equal.\\n * @param self The first byte range to compare.\\n * @param offset The offset into the first byte range.\\n * @param other The second byte range to compare.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n uint256 offset,\\n bytes memory other\\n ) internal pure returns (bool) {\\n return\\n self.length == offset + other.length &&\\n equals(self, offset, other, 0, other.length);\\n }\\n\\n /*\\n * @dev Returns true if the two byte ranges are equal.\\n * @param self The first byte range to compare.\\n * @param other The second byte range to compare.\\n * @return True if the byte ranges are equal, false otherwise.\\n */\\n function equals(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (bool) {\\n return\\n self.length == other.length &&\\n equals(self, 0, other, 0, self.length);\\n }\\n\\n /*\\n * @dev Returns the 8-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 8 bits of the string, interpreted as an integer.\\n */\\n function readUint8(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint8 ret) {\\n return uint8(self[idx]);\\n }\\n\\n /*\\n * @dev Returns the 16-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 16 bits of the string, interpreted as an integer.\\n */\\n function readUint16(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint16 ret) {\\n require(idx + 2 <= self.length);\\n assembly {\\n ret := and(mload(add(add(self, 2), idx)), 0xFFFF)\\n }\\n }\\n\\n /*\\n * @dev Returns the 32-bit number at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bits of the string, interpreted as an integer.\\n */\\n function readUint32(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (uint32 ret) {\\n require(idx + 4 <= self.length);\\n assembly {\\n ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF)\\n }\\n }\\n\\n /*\\n * @dev Returns the 32 byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytes32(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes32 ret) {\\n require(idx + 32 <= self.length);\\n assembly {\\n ret := mload(add(add(self, 32), idx))\\n }\\n }\\n\\n /*\\n * @dev Returns the 32 byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytes20(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes20 ret) {\\n require(idx + 20 <= self.length);\\n assembly {\\n ret := and(\\n mload(add(add(self, 32), idx)),\\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000\\n )\\n }\\n }\\n\\n /*\\n * @dev Returns the n byte value at the specified index of self.\\n * @param self The byte string.\\n * @param idx The index into the bytes.\\n * @param len The number of bytes.\\n * @return The specified 32 bytes of the string.\\n */\\n function readBytesN(\\n bytes memory self,\\n uint256 idx,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(len <= 32);\\n require(idx + len <= self.length);\\n assembly {\\n let mask := not(sub(exp(256, sub(32, len)), 1))\\n ret := and(mload(add(add(self, 32), idx)), mask)\\n }\\n }\\n\\n function memcpy(uint256 dest, uint256 src, uint256 len) private pure {\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint256 mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n }\\n\\n /*\\n * @dev Copies a substring into a new byte string.\\n * @param self The byte string to copy from.\\n * @param offset The offset to start copying at.\\n * @param len The number of bytes to copy.\\n */\\n function substring(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes memory) {\\n require(offset + len <= self.length);\\n\\n bytes memory ret = new bytes(len);\\n uint256 dest;\\n uint256 src;\\n\\n assembly {\\n dest := add(ret, 32)\\n src := add(add(self, 32), offset)\\n }\\n memcpy(dest, src, len);\\n\\n return ret;\\n }\\n\\n // Maps characters from 0x30 to 0x7A to their base32 values.\\n // 0xFF represents invalid characters in that range.\\n bytes constant base32HexTable =\\n hex\\\"00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F\\\";\\n\\n /**\\n * @dev Decodes unpadded base32 data of up to one word in length.\\n * @param self The data to decode.\\n * @param off Offset into the string to start at.\\n * @param len Number of characters to decode.\\n * @return The decoded data, left aligned.\\n */\\n function base32HexDecodeWord(\\n bytes memory self,\\n uint256 off,\\n uint256 len\\n ) internal pure returns (bytes32) {\\n require(len <= 52);\\n\\n uint256 ret = 0;\\n uint8 decoded;\\n for (uint256 i = 0; i < len; i++) {\\n bytes1 char = self[off + i];\\n require(char >= 0x30 && char <= 0x7A);\\n decoded = uint8(base32HexTable[uint256(uint8(char)) - 0x30]);\\n require(decoded <= 0x20);\\n if (i == len - 1) {\\n break;\\n }\\n ret = (ret << 5) | decoded;\\n }\\n\\n uint256 bitlen = len * 5;\\n if (len % 8 == 0) {\\n // Multiple of 8 characters, no padding\\n ret = (ret << 5) | decoded;\\n } else if (len % 8 == 2) {\\n // Two extra characters - 1 byte\\n ret = (ret << 3) | (decoded >> 2);\\n bitlen -= 2;\\n } else if (len % 8 == 4) {\\n // Four extra characters - 2 bytes\\n ret = (ret << 1) | (decoded >> 4);\\n bitlen -= 4;\\n } else if (len % 8 == 5) {\\n // Five extra characters - 3 bytes\\n ret = (ret << 4) | (decoded >> 1);\\n bitlen -= 1;\\n } else if (len % 8 == 7) {\\n // Seven extra characters - 4 bytes\\n ret = (ret << 2) | (decoded >> 3);\\n bitlen -= 3;\\n } else {\\n revert();\\n }\\n\\n return bytes32(ret << (256 - bitlen));\\n }\\n\\n /**\\n * @dev Finds the first occurrence of the byte `needle` in `self`.\\n * @param self The string to search\\n * @param off The offset to start searching at\\n * @param len The number of bytes to search\\n * @param needle The byte to search for\\n * @return The offset of `needle` in `self`, or 2**256-1 if it was not found.\\n */\\n function find(\\n bytes memory self,\\n uint256 off,\\n uint256 len,\\n bytes1 needle\\n ) internal pure returns (uint256) {\\n for (uint256 idx = off; idx < off + len; idx++) {\\n if (self[idx] == needle) {\\n return idx;\\n }\\n }\\n return type(uint256).max;\\n }\\n}\\n\",\"keccak256\":\"0x4f10902639b85a17ae10745264feff322e793bfb1bc130a9a90efa7dda47c6cc\"},\"contracts/dnssec-oracle/RRUtils.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"./BytesUtils.sol\\\";\\nimport \\\"@ensdomains/buffer/contracts/Buffer.sol\\\";\\n\\n/**\\n * @dev RRUtils is a library that provides utilities for parsing DNS resource records.\\n */\\nlibrary RRUtils {\\n using BytesUtils for *;\\n using Buffer for *;\\n\\n /**\\n * @dev Returns the number of bytes in the DNS name at 'offset' in 'self'.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return The length of the DNS name at 'offset', in bytes.\\n */\\n function nameLength(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (uint256) {\\n uint256 idx = offset;\\n while (true) {\\n assert(idx < self.length);\\n uint256 labelLen = self.readUint8(idx);\\n idx += labelLen + 1;\\n if (labelLen == 0) {\\n break;\\n }\\n }\\n return idx - offset;\\n }\\n\\n /**\\n * @dev Returns a DNS format name at the specified offset of self.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return ret The name.\\n */\\n function readName(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (bytes memory ret) {\\n uint256 len = nameLength(self, offset);\\n return self.substring(offset, len);\\n }\\n\\n /**\\n * @dev Returns the number of labels in the DNS name at 'offset' in 'self'.\\n * @param self The byte array to read a name from.\\n * @param offset The offset to start reading at.\\n * @return The number of labels in the DNS name at 'offset', in bytes.\\n */\\n function labelCount(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (uint256) {\\n uint256 count = 0;\\n while (true) {\\n assert(offset < self.length);\\n uint256 labelLen = self.readUint8(offset);\\n offset += labelLen + 1;\\n if (labelLen == 0) {\\n break;\\n }\\n count += 1;\\n }\\n return count;\\n }\\n\\n uint256 constant RRSIG_TYPE = 0;\\n uint256 constant RRSIG_ALGORITHM = 2;\\n uint256 constant RRSIG_LABELS = 3;\\n uint256 constant RRSIG_TTL = 4;\\n uint256 constant RRSIG_EXPIRATION = 8;\\n uint256 constant RRSIG_INCEPTION = 12;\\n uint256 constant RRSIG_KEY_TAG = 16;\\n uint256 constant RRSIG_SIGNER_NAME = 18;\\n\\n struct SignedSet {\\n uint16 typeCovered;\\n uint8 algorithm;\\n uint8 labels;\\n uint32 ttl;\\n uint32 expiration;\\n uint32 inception;\\n uint16 keytag;\\n bytes signerName;\\n bytes data;\\n bytes name;\\n }\\n\\n function readSignedSet(\\n bytes memory data\\n ) internal pure returns (SignedSet memory self) {\\n self.typeCovered = data.readUint16(RRSIG_TYPE);\\n self.algorithm = data.readUint8(RRSIG_ALGORITHM);\\n self.labels = data.readUint8(RRSIG_LABELS);\\n self.ttl = data.readUint32(RRSIG_TTL);\\n self.expiration = data.readUint32(RRSIG_EXPIRATION);\\n self.inception = data.readUint32(RRSIG_INCEPTION);\\n self.keytag = data.readUint16(RRSIG_KEY_TAG);\\n self.signerName = readName(data, RRSIG_SIGNER_NAME);\\n self.data = data.substring(\\n RRSIG_SIGNER_NAME + self.signerName.length,\\n data.length - RRSIG_SIGNER_NAME - self.signerName.length\\n );\\n }\\n\\n function rrs(\\n SignedSet memory rrset\\n ) internal pure returns (RRIterator memory) {\\n return iterateRRs(rrset.data, 0);\\n }\\n\\n /**\\n * @dev An iterator over resource records.\\n */\\n struct RRIterator {\\n bytes data;\\n uint256 offset;\\n uint16 dnstype;\\n uint16 class;\\n uint32 ttl;\\n uint256 rdataOffset;\\n uint256 nextOffset;\\n }\\n\\n /**\\n * @dev Begins iterating over resource records.\\n * @param self The byte string to read from.\\n * @param offset The offset to start reading at.\\n * @return ret An iterator object.\\n */\\n function iterateRRs(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (RRIterator memory ret) {\\n ret.data = self;\\n ret.nextOffset = offset;\\n next(ret);\\n }\\n\\n /**\\n * @dev Returns true iff there are more RRs to iterate.\\n * @param iter The iterator to check.\\n * @return True iff the iterator has finished.\\n */\\n function done(RRIterator memory iter) internal pure returns (bool) {\\n return iter.offset >= iter.data.length;\\n }\\n\\n /**\\n * @dev Moves the iterator to the next resource record.\\n * @param iter The iterator to advance.\\n */\\n function next(RRIterator memory iter) internal pure {\\n iter.offset = iter.nextOffset;\\n if (iter.offset >= iter.data.length) {\\n return;\\n }\\n\\n // Skip the name\\n uint256 off = iter.offset + nameLength(iter.data, iter.offset);\\n\\n // Read type, class, and ttl\\n iter.dnstype = iter.data.readUint16(off);\\n off += 2;\\n iter.class = iter.data.readUint16(off);\\n off += 2;\\n iter.ttl = iter.data.readUint32(off);\\n off += 4;\\n\\n // Read the rdata\\n uint256 rdataLength = iter.data.readUint16(off);\\n off += 2;\\n iter.rdataOffset = off;\\n iter.nextOffset = off + rdataLength;\\n }\\n\\n /**\\n * @dev Returns the name of the current record.\\n * @param iter The iterator.\\n * @return A new bytes object containing the owner name from the RR.\\n */\\n function name(RRIterator memory iter) internal pure returns (bytes memory) {\\n return\\n iter.data.substring(\\n iter.offset,\\n nameLength(iter.data, iter.offset)\\n );\\n }\\n\\n /**\\n * @dev Returns the rdata portion of the current record.\\n * @param iter The iterator.\\n * @return A new bytes object containing the RR's RDATA.\\n */\\n function rdata(\\n RRIterator memory iter\\n ) internal pure returns (bytes memory) {\\n return\\n iter.data.substring(\\n iter.rdataOffset,\\n iter.nextOffset - iter.rdataOffset\\n );\\n }\\n\\n uint256 constant DNSKEY_FLAGS = 0;\\n uint256 constant DNSKEY_PROTOCOL = 2;\\n uint256 constant DNSKEY_ALGORITHM = 3;\\n uint256 constant DNSKEY_PUBKEY = 4;\\n\\n struct DNSKEY {\\n uint16 flags;\\n uint8 protocol;\\n uint8 algorithm;\\n bytes publicKey;\\n }\\n\\n function readDNSKEY(\\n bytes memory data,\\n uint256 offset,\\n uint256 length\\n ) internal pure returns (DNSKEY memory self) {\\n self.flags = data.readUint16(offset + DNSKEY_FLAGS);\\n self.protocol = data.readUint8(offset + DNSKEY_PROTOCOL);\\n self.algorithm = data.readUint8(offset + DNSKEY_ALGORITHM);\\n self.publicKey = data.substring(\\n offset + DNSKEY_PUBKEY,\\n length - DNSKEY_PUBKEY\\n );\\n }\\n\\n uint256 constant DS_KEY_TAG = 0;\\n uint256 constant DS_ALGORITHM = 2;\\n uint256 constant DS_DIGEST_TYPE = 3;\\n uint256 constant DS_DIGEST = 4;\\n\\n struct DS {\\n uint16 keytag;\\n uint8 algorithm;\\n uint8 digestType;\\n bytes digest;\\n }\\n\\n function readDS(\\n bytes memory data,\\n uint256 offset,\\n uint256 length\\n ) internal pure returns (DS memory self) {\\n self.keytag = data.readUint16(offset + DS_KEY_TAG);\\n self.algorithm = data.readUint8(offset + DS_ALGORITHM);\\n self.digestType = data.readUint8(offset + DS_DIGEST_TYPE);\\n self.digest = data.substring(offset + DS_DIGEST, length - DS_DIGEST);\\n }\\n\\n function isSubdomainOf(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (bool) {\\n uint256 off = 0;\\n uint256 counts = labelCount(self, 0);\\n uint256 othercounts = labelCount(other, 0);\\n\\n while (counts > othercounts) {\\n off = progress(self, off);\\n counts--;\\n }\\n\\n return self.equals(off, other, 0);\\n }\\n\\n function compareNames(\\n bytes memory self,\\n bytes memory other\\n ) internal pure returns (int256) {\\n if (self.equals(other)) {\\n return 0;\\n }\\n\\n uint256 off;\\n uint256 otheroff;\\n uint256 prevoff;\\n uint256 otherprevoff;\\n uint256 counts = labelCount(self, 0);\\n uint256 othercounts = labelCount(other, 0);\\n\\n // Keep removing labels from the front of the name until both names are equal length\\n while (counts > othercounts) {\\n prevoff = off;\\n off = progress(self, off);\\n counts--;\\n }\\n\\n while (othercounts > counts) {\\n otherprevoff = otheroff;\\n otheroff = progress(other, otheroff);\\n othercounts--;\\n }\\n\\n // Compare the last nonequal labels to each other\\n while (counts > 0 && !self.equals(off, other, otheroff)) {\\n prevoff = off;\\n off = progress(self, off);\\n otherprevoff = otheroff;\\n otheroff = progress(other, otheroff);\\n counts -= 1;\\n }\\n\\n if (off == 0) {\\n return -1;\\n }\\n if (otheroff == 0) {\\n return 1;\\n }\\n\\n return\\n self.compare(\\n prevoff + 1,\\n self.readUint8(prevoff),\\n other,\\n otherprevoff + 1,\\n other.readUint8(otherprevoff)\\n );\\n }\\n\\n /**\\n * @dev Compares two serial numbers using RFC1982 serial number math.\\n */\\n function serialNumberGte(\\n uint32 i1,\\n uint32 i2\\n ) internal pure returns (bool) {\\n unchecked {\\n return int32(i1) - int32(i2) >= 0;\\n }\\n }\\n\\n function progress(\\n bytes memory body,\\n uint256 off\\n ) internal pure returns (uint256) {\\n return off + 1 + body.readUint8(off);\\n }\\n\\n /**\\n * @dev Computes the keytag for a chunk of data.\\n * @param data The data to compute a keytag for.\\n * @return The computed key tag.\\n */\\n function computeKeytag(bytes memory data) internal pure returns (uint16) {\\n /* This function probably deserves some explanation.\\n * The DNSSEC keytag function is a checksum that relies on summing up individual bytes\\n * from the input string, with some mild bitshifting. Here's a Naive solidity implementation:\\n *\\n * function computeKeytag(bytes memory data) internal pure returns (uint16) {\\n * uint ac;\\n * for (uint i = 0; i < data.length; i++) {\\n * ac += i & 1 == 0 ? uint16(data.readUint8(i)) << 8 : data.readUint8(i);\\n * }\\n * return uint16(ac + (ac >> 16));\\n * }\\n *\\n * The EVM, with its 256 bit words, is exceedingly inefficient at doing byte-by-byte operations;\\n * the code above, on reasonable length inputs, consumes over 100k gas. But we can make the EVM's\\n * large words work in our favour.\\n *\\n * The code below works by treating the input as a series of 256 bit words. It first masks out\\n * even and odd bytes from each input word, adding them to two separate accumulators `ac1` and `ac2`.\\n * The bytes are separated by empty bytes, so as long as no individual sum exceeds 2^16-1, we're\\n * effectively summing 16 different numbers with each EVM ADD opcode.\\n *\\n * Once it's added up all the inputs, it has to add all the 16 bit values in `ac1` and `ac2` together.\\n * It does this using the same trick - mask out every other value, shift to align them, add them together.\\n * After the first addition on both accumulators, there's enough room to add the two accumulators together,\\n * and the remaining sums can be done just on ac1.\\n */\\n unchecked {\\n require(data.length <= 8192, \\\"Long keys not permitted\\\");\\n uint256 ac1;\\n uint256 ac2;\\n for (uint256 i = 0; i < data.length + 31; i += 32) {\\n uint256 word;\\n assembly {\\n word := mload(add(add(data, 32), i))\\n }\\n if (i + 32 > data.length) {\\n uint256 unused = 256 - (data.length - i) * 8;\\n word = (word >> unused) << unused;\\n }\\n ac1 +=\\n (word &\\n 0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00) >>\\n 8;\\n ac2 += (word &\\n 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF);\\n }\\n ac1 =\\n (ac1 &\\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\\n ((ac1 &\\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\\n 16);\\n ac2 =\\n (ac2 &\\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\\n ((ac2 &\\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\\n 16);\\n ac1 = (ac1 << 8) + ac2;\\n ac1 =\\n (ac1 &\\n 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) +\\n ((ac1 &\\n 0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000) >>\\n 32);\\n ac1 =\\n (ac1 &\\n 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) +\\n ((ac1 &\\n 0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000) >>\\n 64);\\n ac1 =\\n (ac1 &\\n 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) +\\n (ac1 >> 128);\\n ac1 += (ac1 >> 16) & 0xFFFF;\\n return uint16(ac1);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4dd68a6efd7c38f6b0e95ca0c056ecb74f88583da650b1a8639e6e78be36fede\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/resolvers/IMulticallable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ninterface IMulticallable {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(\\n bytes32,\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n}\\n\",\"keccak256\":\"0x0334202e20bb11995997083d05963f5e8e7ed6194cba494e7f9371ab7bf4e2c3\",\"license\":\"MIT\"},\"contracts/resolvers/Multicallable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"./IMulticallable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\n\\nabstract contract Multicallable is IMulticallable, ERC165 {\\n function _multicall(\\n bytes32 nodehash,\\n bytes[] calldata data\\n ) internal returns (bytes[] memory results) {\\n results = new bytes[](data.length);\\n for (uint256 i = 0; i < data.length; i++) {\\n if (nodehash != bytes32(0)) {\\n bytes32 txNamehash = bytes32(data[i][4:36]);\\n require(\\n txNamehash == nodehash,\\n \\\"multicall: All records must have a matching namehash\\\"\\n );\\n }\\n (bool success, bytes memory result) = address(this).delegatecall(\\n data[i]\\n );\\n require(success);\\n results[i] = result;\\n }\\n return results;\\n }\\n\\n // This function provides an extra security check when called\\n // from priviledged contracts (such as EthRegistrarController)\\n // that can set records on behalf of the node owners\\n function multicallWithNodeCheck(\\n bytes32 nodehash,\\n bytes[] calldata data\\n ) external returns (bytes[] memory results) {\\n return _multicall(nodehash, data);\\n }\\n\\n function multicall(\\n bytes[] calldata data\\n ) public override returns (bytes[] memory results) {\\n return _multicall(bytes32(0), data);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IMulticallable).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x1063a9dd3b94ba304624d5ec6deb43c1916640758ae970eece4d4e3ef8b2fcb1\",\"license\":\"MIT\"},\"contracts/resolvers/PublicResolver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./profiles/ABIResolver.sol\\\";\\nimport \\\"./profiles/AddrResolver.sol\\\";\\nimport \\\"./profiles/ContentHashResolver.sol\\\";\\nimport \\\"./profiles/DNSResolver.sol\\\";\\nimport \\\"./profiles/InterfaceResolver.sol\\\";\\nimport \\\"./profiles/NameResolver.sol\\\";\\nimport \\\"./profiles/PubkeyResolver.sol\\\";\\nimport \\\"./profiles/TextResolver.sol\\\";\\nimport \\\"./Multicallable.sol\\\";\\nimport {ReverseClaimer} from \\\"../reverseRegistrar/ReverseClaimer.sol\\\";\\nimport {INameWrapper} from \\\"../wrapper/INameWrapper.sol\\\";\\n\\n/**\\n * A simple resolver anyone can use; only allows the owner of a node to set its\\n * address.\\n */\\ncontract PublicResolver is\\n Multicallable,\\n ABIResolver,\\n AddrResolver,\\n ContentHashResolver,\\n DNSResolver,\\n InterfaceResolver,\\n NameResolver,\\n PubkeyResolver,\\n TextResolver,\\n ReverseClaimer\\n{\\n ENS immutable ens;\\n INameWrapper immutable nameWrapper;\\n address immutable trustedETHController;\\n address immutable trustedReverseRegistrar;\\n\\n /**\\n * A mapping of operators. An address that is authorised for an address\\n * may make any changes to the name that the owner could, but may not update\\n * the set of authorisations.\\n * (owner, operator) => approved\\n */\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n /**\\n * A mapping of delegates. A delegate that is authorised by an owner\\n * for a name may make changes to the name's resolver, but may not update\\n * the set of token approvals.\\n * (owner, name, delegate) => approved\\n */\\n mapping(address => mapping(bytes32 => mapping(address => bool)))\\n private _tokenApprovals;\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n // Logged when a delegate is approved or an approval is revoked.\\n event Approved(\\n address owner,\\n bytes32 indexed node,\\n address indexed delegate,\\n bool indexed approved\\n );\\n\\n constructor(\\n ENS _ens,\\n INameWrapper wrapperAddress,\\n address _trustedETHController,\\n address _trustedReverseRegistrar\\n ) ReverseClaimer(_ens, msg.sender) {\\n ens = _ens;\\n nameWrapper = wrapperAddress;\\n trustedETHController = _trustedETHController;\\n trustedReverseRegistrar = _trustedReverseRegistrar;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) external {\\n require(\\n msg.sender != operator,\\n \\\"ERC1155: setting approval status for self\\\"\\n );\\n\\n _operatorApprovals[msg.sender][operator] = approved;\\n emit ApprovalForAll(msg.sender, operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev Approve a delegate to be able to updated records on a node.\\n */\\n function approve(bytes32 node, address delegate, bool approved) external {\\n require(msg.sender != delegate, \\\"Setting delegate status for self\\\");\\n\\n _tokenApprovals[msg.sender][node][delegate] = approved;\\n emit Approved(msg.sender, node, delegate, approved);\\n }\\n\\n /**\\n * @dev Check to see if the delegate has been approved by the owner for the node.\\n */\\n function isApprovedFor(\\n address owner,\\n bytes32 node,\\n address delegate\\n ) public view returns (bool) {\\n return _tokenApprovals[owner][node][delegate];\\n }\\n\\n function isAuthorised(bytes32 node) internal view override returns (bool) {\\n if (\\n msg.sender == trustedETHController ||\\n msg.sender == trustedReverseRegistrar\\n ) {\\n return true;\\n }\\n address owner = ens.owner(node);\\n if (owner == address(nameWrapper)) {\\n owner = nameWrapper.ownerOf(uint256(node));\\n }\\n return\\n owner == msg.sender ||\\n isApprovedForAll(owner, msg.sender) ||\\n isApprovedFor(owner, node, msg.sender);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n )\\n public\\n view\\n override(\\n Multicallable,\\n ABIResolver,\\n AddrResolver,\\n ContentHashResolver,\\n DNSResolver,\\n InterfaceResolver,\\n NameResolver,\\n PubkeyResolver,\\n TextResolver\\n )\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x24c839eb7118da8eea65d07401cc26bad0444a3e651b2cb19749c43065bd24de\",\"license\":\"MIT\"},\"contracts/resolvers/ResolverBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\nimport \\\"./profiles/IVersionableResolver.sol\\\";\\n\\nabstract contract ResolverBase is ERC165, IVersionableResolver {\\n mapping(bytes32 => uint64) public recordVersions;\\n\\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\\n\\n modifier authorised(bytes32 node) {\\n require(isAuthorised(node));\\n _;\\n }\\n\\n /**\\n * Increments the record version associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n */\\n function clearRecords(bytes32 node) public virtual authorised(node) {\\n recordVersions[node]++;\\n emit VersionChanged(node, recordVersions[node]);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IVersionableResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x893049fffd6feee06d7acef1680f6e26505bedff62a9f7a17e921c0ba2f66307\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"./IABIResolver.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\n\\nabstract contract ABIResolver is IABIResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_abis;\\n\\n /**\\n * Sets the ABI associated with an ENS node.\\n * Nodes may have one ABI of each content type. To remove an ABI, set it to\\n * the empty string.\\n * @param node The node to update.\\n * @param contentType The content type of the ABI\\n * @param data The ABI data.\\n */\\n function setABI(\\n bytes32 node,\\n uint256 contentType,\\n bytes calldata data\\n ) external virtual authorised(node) {\\n // Content types must be powers of 2\\n require(((contentType - 1) & contentType) == 0);\\n\\n versionable_abis[recordVersions[node]][node][contentType] = data;\\n emit ABIChanged(node, contentType);\\n }\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view virtual override returns (uint256, bytes memory) {\\n mapping(uint256 => bytes) storage abiset = versionable_abis[\\n recordVersions[node]\\n ][node];\\n\\n for (\\n uint256 contentType = 1;\\n contentType <= contentTypes;\\n contentType <<= 1\\n ) {\\n if (\\n (contentType & contentTypes) != 0 &&\\n abiset[contentType].length > 0\\n ) {\\n return (contentType, abiset[contentType]);\\n }\\n }\\n\\n return (0, bytes(\\\"\\\"));\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IABIResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x2da96d7750786afe3be019fc6ff768e2d98a5e61d360bd92d8d7bc3c7c1dcc27\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/AddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IAddrResolver.sol\\\";\\nimport \\\"./IAddressResolver.sol\\\";\\n\\nabstract contract AddrResolver is\\n IAddrResolver,\\n IAddressResolver,\\n ResolverBase\\n{\\n uint256 private constant COIN_TYPE_ETH = 60;\\n\\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;\\n\\n /**\\n * Sets the address associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param a The address to set.\\n */\\n function setAddr(\\n bytes32 node,\\n address a\\n ) external virtual authorised(node) {\\n setAddr(node, COIN_TYPE_ETH, addressToBytes(a));\\n }\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(\\n bytes32 node\\n ) public view virtual override returns (address payable) {\\n bytes memory a = addr(node, COIN_TYPE_ETH);\\n if (a.length == 0) {\\n return payable(0);\\n }\\n return bytesToAddress(a);\\n }\\n\\n function setAddr(\\n bytes32 node,\\n uint256 coinType,\\n bytes memory a\\n ) public virtual authorised(node) {\\n emit AddressChanged(node, coinType, a);\\n if (coinType == COIN_TYPE_ETH) {\\n emit AddrChanged(node, bytesToAddress(a));\\n }\\n versionable_addresses[recordVersions[node]][node][coinType] = a;\\n }\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) public view virtual override returns (bytes memory) {\\n return versionable_addresses[recordVersions[node]][node][coinType];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IAddrResolver).interfaceId ||\\n interfaceID == type(IAddressResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n\\n function bytesToAddress(\\n bytes memory b\\n ) internal pure returns (address payable a) {\\n require(b.length == 20);\\n assembly {\\n a := div(mload(add(b, 32)), exp(256, 12))\\n }\\n }\\n\\n function addressToBytes(address a) internal pure returns (bytes memory b) {\\n b = new bytes(20);\\n assembly {\\n mstore(add(b, 32), mul(a, exp(256, 12)))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7f6ebb3144530a02db03379f33ade869c8408eceed36dfbd751aaff198735b55\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IContentHashResolver.sol\\\";\\n\\nabstract contract ContentHashResolver is IContentHashResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => bytes)) versionable_hashes;\\n\\n /**\\n * Sets the contenthash associated with an ENS node.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param hash The contenthash to set\\n */\\n function setContenthash(\\n bytes32 node,\\n bytes calldata hash\\n ) external virtual authorised(node) {\\n versionable_hashes[recordVersions[node]][node] = hash;\\n emit ContenthashChanged(node, hash);\\n }\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(\\n bytes32 node\\n ) external view virtual override returns (bytes memory) {\\n return versionable_hashes[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IContentHashResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xc9755bfb77985375ded880ecab5af41f2b9e8280f30d3e523fe5042ea59f93ea\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/DNSResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"../../dnssec-oracle/RRUtils.sol\\\";\\nimport \\\"./IDNSRecordResolver.sol\\\";\\nimport \\\"./IDNSZoneResolver.sol\\\";\\n\\nabstract contract DNSResolver is\\n IDNSRecordResolver,\\n IDNSZoneResolver,\\n ResolverBase\\n{\\n using RRUtils for *;\\n using BytesUtils for bytes;\\n\\n // Zone hashes for the domains.\\n // A zone hash is an EIP-1577 content hash in binary format that should point to a\\n // resource containing a single zonefile.\\n // node => contenthash\\n mapping(uint64 => mapping(bytes32 => bytes)) private versionable_zonehashes;\\n\\n // The records themselves. Stored as binary RRSETs\\n // node => version => name => resource => data\\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))\\n private versionable_records;\\n\\n // Count of number of entries for a given name. Required for DNS resolvers\\n // when resolving wildcards.\\n // node => version => name => number of records\\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))\\n private versionable_nameEntriesCount;\\n\\n /**\\n * Set one or more DNS records. Records are supplied in wire-format.\\n * Records with the same node/name/resource must be supplied one after the\\n * other to ensure the data is updated correctly. For example, if the data\\n * was supplied:\\n * a.example.com IN A 1.2.3.4\\n * a.example.com IN A 5.6.7.8\\n * www.example.com IN CNAME a.example.com.\\n * then this would store the two A records for a.example.com correctly as a\\n * single RRSET, however if the data was supplied:\\n * a.example.com IN A 1.2.3.4\\n * www.example.com IN CNAME a.example.com.\\n * a.example.com IN A 5.6.7.8\\n * then this would store the first A record, the CNAME, then the second A\\n * record which would overwrite the first.\\n *\\n * @param node the namehash of the node for which to set the records\\n * @param data the DNS wire format records to set\\n */\\n function setDNSRecords(\\n bytes32 node,\\n bytes calldata data\\n ) external virtual authorised(node) {\\n uint16 resource = 0;\\n uint256 offset = 0;\\n bytes memory name;\\n bytes memory value;\\n bytes32 nameHash;\\n uint64 version = recordVersions[node];\\n // Iterate over the data to add the resource records\\n for (\\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\\n !iter.done();\\n iter.next()\\n ) {\\n if (resource == 0) {\\n resource = iter.dnstype;\\n name = iter.name();\\n nameHash = keccak256(abi.encodePacked(name));\\n value = bytes(iter.rdata());\\n } else {\\n bytes memory newName = iter.name();\\n if (resource != iter.dnstype || !name.equals(newName)) {\\n setDNSRRSet(\\n node,\\n name,\\n resource,\\n data,\\n offset,\\n iter.offset - offset,\\n value.length == 0,\\n version\\n );\\n resource = iter.dnstype;\\n offset = iter.offset;\\n name = newName;\\n nameHash = keccak256(name);\\n value = bytes(iter.rdata());\\n }\\n }\\n }\\n if (name.length > 0) {\\n setDNSRRSet(\\n node,\\n name,\\n resource,\\n data,\\n offset,\\n data.length - offset,\\n value.length == 0,\\n version\\n );\\n }\\n }\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) public view virtual override returns (bytes memory) {\\n return versionable_records[recordVersions[node]][node][name][resource];\\n }\\n\\n /**\\n * Check if a given node has records.\\n * @param node the namehash of the node for which to check the records\\n * @param name the namehash of the node for which to check the records\\n */\\n function hasDNSRecords(\\n bytes32 node,\\n bytes32 name\\n ) public view virtual returns (bool) {\\n return (versionable_nameEntriesCount[recordVersions[node]][node][\\n name\\n ] != 0);\\n }\\n\\n /**\\n * setZonehash sets the hash for the zone.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param hash The zonehash to set\\n */\\n function setZonehash(\\n bytes32 node,\\n bytes calldata hash\\n ) external virtual authorised(node) {\\n uint64 currentRecordVersion = recordVersions[node];\\n bytes memory oldhash = versionable_zonehashes[currentRecordVersion][\\n node\\n ];\\n versionable_zonehashes[currentRecordVersion][node] = hash;\\n emit DNSZonehashChanged(node, oldhash, hash);\\n }\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(\\n bytes32 node\\n ) external view virtual override returns (bytes memory) {\\n return versionable_zonehashes[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IDNSRecordResolver).interfaceId ||\\n interfaceID == type(IDNSZoneResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n\\n function setDNSRRSet(\\n bytes32 node,\\n bytes memory name,\\n uint16 resource,\\n bytes memory data,\\n uint256 offset,\\n uint256 size,\\n bool deleteRecord,\\n uint64 version\\n ) private {\\n bytes32 nameHash = keccak256(name);\\n bytes memory rrData = data.substring(offset, size);\\n if (deleteRecord) {\\n if (\\n versionable_records[version][node][nameHash][resource].length !=\\n 0\\n ) {\\n versionable_nameEntriesCount[version][node][nameHash]--;\\n }\\n delete (versionable_records[version][node][nameHash][resource]);\\n emit DNSRecordDeleted(node, name, resource);\\n } else {\\n if (\\n versionable_records[version][node][nameHash][resource].length ==\\n 0\\n ) {\\n versionable_nameEntriesCount[version][node][nameHash]++;\\n }\\n versionable_records[version][node][nameHash][resource] = rrData;\\n emit DNSRecordChanged(node, name, resource, rrData);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7233e4d2edca222ce6e1cdb07adf127ab52ecaea599fa5369971a7b28dbc59ac\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IABIResolver {\\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0x85b373d02d19374fe570af407f459768285704bf7f30ab17c30eabfb5a10e4c3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the legacy (ETH-only) addr function.\\n */\\ninterface IAddrResolver {\\n event AddrChanged(bytes32 indexed node, address a);\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0x2ad7f2fc60ebe0f93745fe70247f6a854f66af732483fda2a3c5e055614445e8\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the new (multicoin) addr function.\\n */\\ninterface IAddressResolver {\\n event AddressChanged(\\n bytes32 indexed node,\\n uint256 coinType,\\n bytes newAddress\\n );\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x411447c1e90c51e09702815a85ec725ffbbe37cf96e8cc4d2a8bd4ad8a59d73e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IContentHashResolver {\\n event ContenthashChanged(bytes32 indexed node, bytes hash);\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xd95cd77684ba5752c428d7dceb4ecc6506ac94f4fbb910489637eb68dcd8e366\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSRecordResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSRecordResolver {\\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\\n event DNSRecordChanged(\\n bytes32 indexed node,\\n bytes name,\\n uint16 resource,\\n bytes record\\n );\\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xcfa52200edd337f2c6c5bf402352600584da033b21323603e53de33051a3e25d\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSZoneResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSZoneResolver {\\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\\n event DNSZonehashChanged(\\n bytes32 indexed node,\\n bytes lastzonehash,\\n bytes zonehash\\n );\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xca1b3a16e7005533f2800a3e66fcdccf7c574deac7913d8c810f40aec1d58dc0\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IInterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IInterfaceResolver {\\n event InterfaceChanged(\\n bytes32 indexed node,\\n bytes4 indexed interfaceID,\\n address implementer\\n );\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view returns (address);\\n}\\n\",\"keccak256\":\"0x390321fb58f7b927df9562450981e74b4be3907e7c09df321fd3b7409b63ae28\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/INameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface INameResolver {\\n event NameChanged(bytes32 indexed node, string name);\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(bytes32 node) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x9ec392b612447b1acbdc01114f2da2837a658d3f3157f60a99c5269f0b623346\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IPubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IPubkeyResolver {\\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\\n}\\n\",\"keccak256\":\"0x69748947093dd2fda9ddcebd0adf19a6d1e7600df1d4b1462a0417156caddca7\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ITextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface ITextResolver {\\n event TextChanged(\\n bytes32 indexed node,\\n string indexed indexedKey,\\n string key,\\n string value\\n );\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x7c5debb3c42cd9f5de2274ea7aa053f238608314b62db441c40e31cea2543fd5\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IVersionableResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IVersionableResolver {\\n event VersionChanged(bytes32 indexed node, uint64 newVersion);\\n\\n function recordVersions(bytes32 node) external view returns (uint64);\\n}\\n\",\"keccak256\":\"0xd0d09596f20c57bafb2ffa8521a8c57120e9af6c6b194f9c689d4da56f91a57c\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/InterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./AddrResolver.sol\\\";\\nimport \\\"./IInterfaceResolver.sol\\\";\\n\\nabstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {\\n mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address))) versionable_interfaces;\\n\\n /**\\n * Sets an interface associated with a name.\\n * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.\\n * @param node The node to update.\\n * @param interfaceID The EIP 165 interface ID.\\n * @param implementer The address of a contract that implements this interface for this node.\\n */\\n function setInterface(\\n bytes32 node,\\n bytes4 interfaceID,\\n address implementer\\n ) external virtual authorised(node) {\\n versionable_interfaces[recordVersions[node]][node][\\n interfaceID\\n ] = implementer;\\n emit InterfaceChanged(node, interfaceID, implementer);\\n }\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view virtual override returns (address) {\\n address implementer = versionable_interfaces[recordVersions[node]][\\n node\\n ][interfaceID];\\n if (implementer != address(0)) {\\n return implementer;\\n }\\n\\n address a = addr(node);\\n if (a == address(0)) {\\n return address(0);\\n }\\n\\n (bool success, bytes memory returnData) = a.staticcall(\\n abi.encodeWithSignature(\\n \\\"supportsInterface(bytes4)\\\",\\n type(IERC165).interfaceId\\n )\\n );\\n if (!success || returnData.length < 32 || returnData[31] == 0) {\\n // EIP 165 not supported by target\\n return address(0);\\n }\\n\\n (success, returnData) = a.staticcall(\\n abi.encodeWithSignature(\\\"supportsInterface(bytes4)\\\", interfaceID)\\n );\\n if (!success || returnData.length < 32 || returnData[31] == 0) {\\n // Specified interface not supported by target\\n return address(0);\\n }\\n\\n return a;\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IInterfaceResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x820ec60183e7a49a4ee399cf4708acb776725c8e4ad275d1f316c152eace0a59\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/NameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./INameResolver.sol\\\";\\n\\nabstract contract NameResolver is INameResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => string)) versionable_names;\\n\\n /**\\n * Sets the name associated with an ENS node, for reverse records.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n */\\n function setName(\\n bytes32 node,\\n string calldata newName\\n ) external virtual authorised(node) {\\n versionable_names[recordVersions[node]][node] = newName;\\n emit NameChanged(node, newName);\\n }\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(\\n bytes32 node\\n ) external view virtual override returns (string memory) {\\n return versionable_names[recordVersions[node]][node];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(INameResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x52d0bbb8f9dd33fae471ef2f5f6b3118b221954e5bb7ba724885d4562e75b8e2\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/PubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./IPubkeyResolver.sol\\\";\\n\\nabstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {\\n struct PublicKey {\\n bytes32 x;\\n bytes32 y;\\n }\\n\\n mapping(uint64 => mapping(bytes32 => PublicKey)) versionable_pubkeys;\\n\\n /**\\n * Sets the SECP256k1 public key associated with an ENS node.\\n * @param node The ENS node to query\\n * @param x the X coordinate of the curve point for the public key.\\n * @param y the Y coordinate of the curve point for the public key.\\n */\\n function setPubkey(\\n bytes32 node,\\n bytes32 x,\\n bytes32 y\\n ) external virtual authorised(node) {\\n versionable_pubkeys[recordVersions[node]][node] = PublicKey(x, y);\\n emit PubkeyChanged(node, x, y);\\n }\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(\\n bytes32 node\\n ) external view virtual override returns (bytes32 x, bytes32 y) {\\n uint64 currentRecordVersion = recordVersions[node];\\n return (\\n versionable_pubkeys[currentRecordVersion][node].x,\\n versionable_pubkeys[currentRecordVersion][node].y\\n );\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(IPubkeyResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x1a1f10a0e40520c998a9296fc81c092c81521e05a784e9bd9ee44cc4c62c8c78\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/TextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"../ResolverBase.sol\\\";\\nimport \\\"./ITextResolver.sol\\\";\\n\\nabstract contract TextResolver is ITextResolver, ResolverBase {\\n mapping(uint64 => mapping(bytes32 => mapping(string => string))) versionable_texts;\\n\\n /**\\n * Sets the text data associated with an ENS node and key.\\n * May only be called by the owner of that node in the ENS registry.\\n * @param node The node to update.\\n * @param key The key to set.\\n * @param value The text data value to set.\\n */\\n function setText(\\n bytes32 node,\\n string calldata key,\\n string calldata value\\n ) external virtual authorised(node) {\\n versionable_texts[recordVersions[node]][node][key] = value;\\n emit TextChanged(node, key, key, value);\\n }\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view virtual override returns (string memory) {\\n return versionable_texts[recordVersions[node]][node][key];\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view virtual override returns (bool) {\\n return\\n interfaceID == type(ITextResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xf9bedd807add38136779d84083ac2fa4f8c92d017c9e1a72fbc9003fa5074379\",\"license\":\"MIT\"},\"contracts/reverseRegistrar/IReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface IReverseRegistrar {\\n function setDefaultResolver(address resolver) external;\\n\\n function claim(address owner) external returns (bytes32);\\n\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function setName(string memory name) external returns (bytes32);\\n\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) external returns (bytes32);\\n\\n function node(address addr) external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0x83adfcf6da72b1bcd1e3ac387afe5fc7fdf7f2ac28b7601544d2ca4b9d45d159\"},\"contracts/reverseRegistrar/ReverseClaimer.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IReverseRegistrar} from \\\"../reverseRegistrar/IReverseRegistrar.sol\\\";\\n\\ncontract ReverseClaimer {\\n bytes32 constant ADDR_REVERSE_NODE =\\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n constructor(ENS ens, address claimant) {\\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\\n ens.owner(ADDR_REVERSE_NODE)\\n );\\n reverseRegistrar.claim(claimant);\\n }\\n}\\n\",\"keccak256\":\"0x78a28627241535b595f6fff476a1fa7acc90c80684fe7784734920fc8af6fc22\",\"license\":\"MIT\"},\"contracts/wrapper/IMetadataService.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface IMetadataService {\\n function uri(uint256) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xb3f1cf6df01ed7b15e5f2318f6823afbdb586ca38c2124c67955c645647ae9a2\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"./IMetadataService.sol\\\";\\nimport \\\"./INameWrapperUpgrade.sol\\\";\\n\\nuint32 constant CANNOT_UNWRAP = 1;\\nuint32 constant CANNOT_BURN_FUSES = 2;\\nuint32 constant CANNOT_TRANSFER = 4;\\nuint32 constant CANNOT_SET_RESOLVER = 8;\\nuint32 constant CANNOT_SET_TTL = 16;\\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\\nuint32 constant CANNOT_APPROVE = 64;\\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\\nuint32 constant IS_DOT_ETH = 1 << 17;\\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\\n// all fuses apart from IS_DOT_ETH\\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\\n\\ninterface INameWrapper is IERC1155 {\\n event NameWrapped(\\n bytes32 indexed node,\\n bytes name,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n );\\n\\n event NameUnwrapped(bytes32 indexed node, address owner);\\n\\n event FusesSet(bytes32 indexed node, uint32 fuses);\\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\\n\\n function ens() external view returns (ENS);\\n\\n function registrar() external view returns (IBaseRegistrar);\\n\\n function metadataService() external view returns (IMetadataService);\\n\\n function names(bytes32) external view returns (bytes memory);\\n\\n function name() external view returns (string memory);\\n\\n function upgradeContract() external view returns (INameWrapperUpgrade);\\n\\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\\n\\n function wrap(\\n bytes calldata name,\\n address wrappedOwner,\\n address resolver\\n ) external;\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) external returns (uint64 expires);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint16 ownerControlledFuses\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration\\n ) external returns (uint256 expires);\\n\\n function unwrap(bytes32 node, bytes32 label, address owner) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function upgrade(bytes calldata name, bytes calldata extraData) external;\\n\\n function setFuses(\\n bytes32 node,\\n uint16 ownerControlledFuses\\n ) external returns (uint32 newFuses);\\n\\n function setChildFuses(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint32 fuses,\\n uint64 expiry\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n string calldata label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n string calldata label,\\n address newOwner,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function extendExpiry(\\n bytes32 node,\\n bytes32 labelhash,\\n uint64 expiry\\n ) external returns (uint64);\\n\\n function canModifyName(\\n bytes32 node,\\n address addr\\n ) external view returns (bool);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function ownerOf(uint256 id) external view returns (address owner);\\n\\n function approve(address to, uint256 tokenId) external;\\n\\n function getApproved(uint256 tokenId) external view returns (address);\\n\\n function getData(\\n uint256 id\\n ) external view returns (address, uint32, uint64);\\n\\n function setMetadataService(IMetadataService _metadataService) external;\\n\\n function uri(uint256 tokenId) external view returns (string memory);\\n\\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\\n\\n function allFusesBurned(\\n bytes32 node,\\n uint32 fuseMask\\n ) external view returns (bool);\\n\\n function isWrapped(bytes32) external view returns (bool);\\n\\n function isWrapped(bytes32, bytes32) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x70310eb67146d7290731c31841399640ac3b6a949eadc6598bc150123d185c57\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapperUpgrade.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface INameWrapperUpgrade {\\n function wrapFromUpgrade(\\n bytes calldata name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address approved,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x42e0cec6cd9d1a62d51d45b678f69d3e4ad5555e659b197e41257b308346bb8a\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101006040523480156200001257600080fd5b50604051620032943803806200329483398101604081905262000035916200017a565b6040516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152849033906000906001600160a01b038416906302571be390602401602060405180830381865afa158015620000a1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c79190620001e2565b604051630f41a04d60e11b81526001600160a01b03848116600483015291925090821690631e83409a906024016020604051808303816000875af115801562000114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200013a919062000209565b5050506001600160a01b039485166080525091831660a052821660c0521660e05262000223565b6001600160a01b03811681146200017757600080fd5b50565b600080600080608085870312156200019157600080fd5b84516200019e8162000161565b6020860151909450620001b18162000161565b6040860151909350620001c48162000161565b6060860151909250620001d78162000161565b939692955090935050565b600060208284031215620001f557600080fd5b8151620002028162000161565b9392505050565b6000602082840312156200021c57600080fd5b5051919050565b60805160a05160c05160e0516130306200026460003960006117d7015260006117a50152600081816118af01526119150152600061183801526130306000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80638b95dd7111610104578063c8690233116100a2578063e32954eb11610071578063e32954eb14610504578063e59d895d14610517578063e985e9c51461052a578063f1cb7e061461056657600080fd5b8063c869023314610442578063ce3decdc1461049b578063d5fa2b00146104ae578063d700ff33146104c157600080fd5b8063a8fa5682116100de578063a8fa5682146103b8578063a9784b3e146103cb578063ac9650d81461040f578063bc1c58d11461042f57600080fd5b80638b95dd711461037f578063a22cb46514610392578063a4b91a01146103a557600080fd5b80633603d7581161017c5780635c98042b1161014b5780635c98042b14610333578063623195b014610346578063691f343114610359578063773722131461036c57600080fd5b80633603d758146102a15780633b3b57de146102b45780634cbf6ba4146102c757806359d1d43c1461031357600080fd5b8063124a319c116101b8578063124a319c1461022f5780632203ab561461025a57806329cd62ea1461027b578063304e6ade1461028e57600080fd5b806301ffc9a7146101df5780630af179d71461020757806310f13a8c1461021c575b600080fd5b6101f26101ed366004612529565b610579565b60405190151581526020015b60405180910390f35b61021a610215366004612586565b61058a565b005b61021a61022a3660046125d2565b610794565b61024261023d36600461264c565b610861565b6040516001600160a01b0390911681526020016101fe565b61026d610268366004612678565b610b0d565b6040516101fe9291906126ea565b61021a610289366004612703565b610c44565b61021a61029c366004612586565b610cdf565b61021a6102af36600461272f565b610d5b565b6102426102c236600461272f565b610dfe565b6101f26102d5366004612678565b6000828152602081815260408083205467ffffffffffffffff1683526006825280832094835293815283822092825291909152205461ffff16151590565b610326610321366004612586565b610e30565b6040516101fe9190612748565b61032661034136600461272f565b610f10565b61021a61035436600461275b565b610fcf565b61032661036736600461272f565b61106c565b61021a61037a366004612586565b6110a6565b61021a61038d3660046127c4565b611122565b61021a6103a03660046128ad565b611202565b61021a6103b33660046128d9565b6112f1565b6103266103c6366004612917565b6113be565b6101f26103d9366004612957565b6001600160a01b039283166000908152600c60209081526040808320948352938152838220929094168152925290205460ff1690565b61042261041d3660046129d3565b61140c565b6040516101fe9190612a15565b61032661043d36600461272f565b61141a565b61048661045036600461272f565b6000818152602081815260408083205467ffffffffffffffff168352600982528083209383529290522080546001909101549091565b604080519283526020830191909152016101fe565b61021a6104a9366004612586565b611454565b61021a6104bc366004612a77565b611597565b6104eb6104cf36600461272f565b60006020819052908152604090205467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016101fe565b610422610512366004612aa7565b6115be565b61021a610525366004612ae6565b6115d3565b6101f2610538366004612b1b565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205460ff1690565b610326610574366004612678565b611692565b60006105848261175a565b92915050565b8261059481611798565b61059d57600080fd5b600084815260208181526040808320548151601f870184900484028101840190925285825283926060928392859267ffffffffffffffff9091169183916106039183918d908d908190840183828082843760009201919091525092939250506119ff9050565b90505b8051516020820151101561072d578661ffff1660000361066b578060400151965061063081611a60565b9450846040516020016106439190612b49565b60405160208183030381529060405280519060200120925061066481611a81565b935061071f565b600061067682611a60565b9050816040015161ffff168861ffff1614158061069a57506106988682611a9d565b155b1561071d576106f68c878a8e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518d91506106ed908290612b7b565b8b51158a611abb565b81604001519750816020015196508095508580519060200120935061071a82611a81565b94505b505b61072881611d28565b610606565b50835115610788576107888a85888c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925061077f91508290508f612b7b565b89511588611abb565b50505050505050505050565b8461079e81611798565b6107a757600080fd5b6000868152602081815260408083205467ffffffffffffffff168352600a8252808320898452909152908190209051849184916107e79089908990612b8e565b90815260200160405180910390209182610802929190612c26565b508484604051610813929190612b8e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516108519493929190612d0f565b60405180910390a3505050505050565b6000828152602081815260408083205467ffffffffffffffff1683526007825280832085845282528083206001600160e01b0319851684529091528120546001600160a01b031680156108b5579050610584565b60006108c085610dfe565b90506001600160a01b0381166108db57600092505050610584565b6040516301ffc9a760e01b602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516109489190612b49565b600060405180830381855afa9150503d8060008114610983576040519150601f19603f3d011682016040523d82523d6000602084013e610988565b606091505b509150915081158061099b575060208151105b806109dd575080601f815181106109b4576109b4612d41565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109ef576000945050505050610584565b6040516001600160e01b0319871660248201526001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b17905251610a5a9190612b49565b600060405180830381855afa9150503d8060008114610a95576040519150601f19603f3d011682016040523d82523d6000602084013e610a9a565b606091505b509092509050811580610aae575060208151105b80610af0575080601f81518110610ac757610ac7612d41565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610b02576000945050505050610584565b509095945050505050565b6000828152602081815260408083205467ffffffffffffffff168352600180835281842086855290925282206060915b848111610c245780851615801590610b6d575060008181526020839052604081208054610b6990612b9e565b9050115b15610c1c5780826000838152602001908152602001600020808054610b9190612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbd90612b9e565b8015610c0a5780601f10610bdf57610100808354040283529160200191610c0a565b820191906000526020600020905b815481529060010190602001808311610bed57829003601f168201915b50505050509050935093505050610c3d565b60011b610b3d565b5060006040518060200160405280600081525092509250505b9250929050565b82610c4e81611798565b610c5757600080fd5b604080518082018252848152602080820185815260008881528083528481205467ffffffffffffffff1681526009835284812089825283528490209251835551600190920191909155815185815290810184905285917f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4691015b60405180910390a250505050565b82610ce981611798565b610cf257600080fd5b6000848152602081815260408083205467ffffffffffffffff168352600382528083208784529091529020610d28838583612c26565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610cd1929190612d57565b80610d6581611798565b610d6e57600080fd5b6000828152602081905260408120805467ffffffffffffffff1691610d9283612d6b565b82546101009290920a67ffffffffffffffff818102199093169183160217909155600084815260208181526040918290205491519190921681528492507fc6621ccb8f3f5a04bb6502154b2caf6adf5983fe76dfef1cfc9c42e3579db444910160405180910390a25050565b600080610e0c83603c611692565b90508051600003610e205750600092915050565b610e2981611e10565b9392505050565b6000838152602081815260408083205467ffffffffffffffff168352600a825280832086845290915290819020905160609190610e709085908590612b8e565b90815260200160405180910390208054610e8990612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb590612b9e565b8015610f025780601f10610ed757610100808354040283529160200191610f02565b820191906000526020600020905b815481529060010190602001808311610ee557829003601f168201915b505050505090509392505050565b6000818152602081815260408083205467ffffffffffffffff168352600482528083208484529091529020805460609190610f4a90612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610f7690612b9e565b8015610fc35780601f10610f9857610100808354040283529160200191610fc3565b820191906000526020600020905b815481529060010190602001808311610fa657829003601f168201915b50505050509050919050565b83610fd981611798565b610fe257600080fd5b83610fee600182612b7b565b1615610ff957600080fd5b6000858152602081815260408083205467ffffffffffffffff1683526001825280832088845282528083208784529091529020611037838583612c26565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b6000818152602081815260408083205467ffffffffffffffff168352600882528083208484529091529020805460609190610f4a90612b9e565b826110b081611798565b6110b957600080fd5b6000848152602081815260408083205467ffffffffffffffff1683526008825280832087845290915290206110ef838583612c26565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610cd1929190612d57565b8261112c81611798565b61113557600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af75284846040516111679291906126ea565b60405180910390a2603c83036111be57837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd26111a284611e10565b6040516001600160a01b03909116815260200160405180910390a25b6000848152602081815260408083205467ffffffffffffffff16835260028252808320878452825280832086845290915290206111fb8382612d92565b5050505050565b6001600160a01b03821633036112855760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336000818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b03821633036113495760405162461bcd60e51b815260206004820181905260248201527f53657474696e672064656c65676174652073746174757320666f722073656c66604482015260640161127c565b336000818152600c6020908152604080832087845282528083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519384529286917ff0ddb3b04746704017f9aa8bd728fcc2c1d11675041205350018915f5e4750a0910160405180910390a4505050565b6000838152602081815260408083205467ffffffffffffffff168352600582528083208684528252808320858452825280832061ffff851684529091529020805460609190610e8990612b9e565b6060610e2960008484611e38565b6000818152602081815260408083205467ffffffffffffffff168352600382528083208484529091529020805460609190610f4a90612b9e565b8261145e81611798565b61146757600080fd5b6000848152602081815260408083205467ffffffffffffffff1680845260048352818420888552909252822080549192916114a190612b9e565b80601f01602080910402602001604051908101604052809291908181526020018280546114cd90612b9e565b801561151a5780601f106114ef5761010080835404028352916020019161151a565b820191906000526020600020905b8154815290600101906020018083116114fd57829003601f168201915b5050505067ffffffffffffffff841660009081526004602090815260408083208b845290915290209192506115529050858783612c26565b50857f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f8582878760405161158793929190612e52565b60405180910390a2505050505050565b816115a181611798565b6115aa57600080fd5b6115b983603c61038d85612011565b505050565b60606115cb848484611e38565b949350505050565b826115dd81611798565b6115e657600080fd5b6000848152602081815260408083205467ffffffffffffffff1683526007825280832087845282528083206001600160e01b031987168085529083529281902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b6000828152602081815260408083205467ffffffffffffffff16835260028252808320858452825280832084845290915290208054606091906116d490612b9e565b80601f016020809104026020016040519081016040528092919081815260200182805461170090612b9e565b801561174d5780601f106117225761010080835404028352916020019161174d565b820191906000526020600020905b81548152906001019060200180831161173057829003601f168201915b5050505050905092915050565b60006001600160e01b031982167f59d1d43c00000000000000000000000000000000000000000000000000000000148061058457506105848261204a565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806117f95750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b1561180657506001919050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015611887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ab9190612e82565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03160361198b576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119889190612e82565b90505b6001600160a01b0381163314806119c557506001600160a01b0381166000908152600b6020908152604080832033845290915290205460ff165b80610e2957506001600160a01b0381166000908152600c60209081526040808320868452825280832033845290915290205460ff16610e29565b611a4d6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c0810182905261058481611d28565b6020810151815160609161058491611a789082612088565b845191906120e2565b60a081015160c082015160609161058491611a78908290612b7b565b600081518351148015610e295750610e298360008460008751612159565b865160208801206000611acf8787876120e2565b90508315611bf95767ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c16845290915290208054611b1a90612b9e565b159050611b795767ffffffffffffffff831660009081526006602090815260408083208d845282528083208584529091528120805461ffff1691611b5d83612e9f565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c1684529091528120611bba916124b6565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a604051611bec929190612ebd565b60405180910390a2610788565b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c16845290915290208054611c3c90612b9e565b9050600003611c9d5767ffffffffffffffff831660009081526006602090815260408083208d845282528083208584529091528120805461ffff1691611c8183612ee3565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c1684529091529020611cdf8282612d92565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a84604051611d1493929190612efa565b60405180910390a250505050505050505050565b60c08101516020820181905281515111611d3f5750565b6000611d5382600001518360200151612088565b8260200151611d629190612f29565b8251909150611d71908261217c565b61ffff166040830152611d85600282612f29565b8251909150611d94908261217c565b61ffff166060830152611da8600282612f29565b8251909150611db790826121a4565b63ffffffff166080830152611dcd600482612f29565b8251909150600090611ddf908361217c565b61ffff169050611df0600283612f29565b60a084018190529150611e038183612f29565b60c0909301929092525050565b60008151601414611e2057600080fd5b50602001516c01000000000000000000000000900490565b60608167ffffffffffffffff811115611e5357611e536127ae565b604051908082528060200260200182016040528015611e8657816020015b6060815260200190600190039081611e715790505b50905060005b82811015612009578415611f51576000848483818110611eae57611eae612d41565b9050602002810190611ec09190612f3c565b611ecf91602491600491612f83565b611ed891612fad565b9050858114611f4f5760405162461bcd60e51b815260206004820152603460248201527f6d756c746963616c6c3a20416c6c207265636f726473206d757374206861766560448201527f2061206d61746368696e67206e616d6568617368000000000000000000000000606482015260840161127c565b505b60008030868685818110611f6757611f67612d41565b9050602002810190611f799190612f3c565b604051611f87929190612b8e565b600060405180830381855af49150503d8060008114611fc2576040519150601f19603f3d011682016040523d82523d6000602084013e611fc7565b606091505b509150915081611fd657600080fd5b80848481518110611fe957611fe9612d41565b60200260200101819052505050808061200190612fcb565b915050611e8c565b509392505050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60006001600160e01b031982167fc86902330000000000000000000000000000000000000000000000000000000014806105845750610584826121ce565b6000815b8351811061209c5761209c612fe4565b60006120a8858361220c565b60ff1690506120b8816001612f29565b6120c29083612f29565b9150806000036120d257506120d8565b5061208c565b6115cb8382612b7b565b82516060906120f18385612f29565b11156120fc57600080fd5b60008267ffffffffffffffff811115612117576121176127ae565b6040519080825280601f01601f191660200182016040528015612141576020820181803683370190505b50905060208082019086860101610b02828287612230565b6000612166848484612286565b612171878785612286565b149695505050505050565b815160009061218c836002612f29565b111561219757600080fd5b50016002015161ffff1690565b81516000906121b4836004612f29565b11156121bf57600080fd5b50016004015163ffffffff1690565b60006001600160e01b031982167f691f34310000000000000000000000000000000000000000000000000000000014806105845750610584826122aa565b600082828151811061222057612220612d41565b016020015160f81c905092915050565b602081106122685781518352612247602084612f29565b9250612254602083612f29565b9150612261602082612b7b565b9050612230565b905182516020929092036101000a6000190180199091169116179052565b82516000906122958385612f29565b11156122a057600080fd5b5091016020012090565b60006001600160e01b031982167f124a319c00000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167fa8fa568200000000000000000000000000000000000000000000000000000000148061234657506001600160e01b031982167f5c98042b00000000000000000000000000000000000000000000000000000000145b8061058457506105848260006001600160e01b031982167fbc1c58d100000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806123ec57506001600160e01b031982167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b8061058457506105848260006001600160e01b031982167f2203ab5600000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167fd700ff3300000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167f4fbf043300000000000000000000000000000000000000000000000000000000148061058457506301ffc9a760e01b6001600160e01b0319831614610584565b5080546124c290612b9e565b6000825580601f106124d2575050565b601f0160209004906000526020600020908101906124f091906124f3565b50565b5b8082111561250857600081556001016124f4565b5090565b80356001600160e01b03198116811461252457600080fd5b919050565b60006020828403121561253b57600080fd5b610e298261250c565b60008083601f84011261255657600080fd5b50813567ffffffffffffffff81111561256e57600080fd5b602083019150836020828501011115610c3d57600080fd5b60008060006040848603121561259b57600080fd5b83359250602084013567ffffffffffffffff8111156125b957600080fd5b6125c586828701612544565b9497909650939450505050565b6000806000806000606086880312156125ea57600080fd5b85359450602086013567ffffffffffffffff8082111561260957600080fd5b61261589838a01612544565b9096509450604088013591508082111561262e57600080fd5b5061263b88828901612544565b969995985093965092949392505050565b6000806040838503121561265f57600080fd5b8235915061266f6020840161250c565b90509250929050565b6000806040838503121561268b57600080fd5b50508035926020909101359150565b60005b838110156126b557818101518382015260200161269d565b50506000910152565b600081518084526126d681602086016020860161269a565b601f01601f19169290920160200192915050565b8281526040602082015260006115cb60408301846126be565b60008060006060848603121561271857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561274157600080fd5b5035919050565b602081526000610e2960208301846126be565b6000806000806060858703121561277157600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561279657600080fd5b6127a287828801612544565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156127d957600080fd5b8335925060208401359150604084013567ffffffffffffffff808211156127ff57600080fd5b818601915086601f83011261281357600080fd5b813581811115612825576128256127ae565b604051601f8201601f19908116603f0116810190838211818310171561284d5761284d6127ae565b8160405282815289602084870101111561286657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6001600160a01b03811681146124f057600080fd5b8035801515811461252457600080fd5b600080604083850312156128c057600080fd5b82356128cb81612888565b915061266f6020840161289d565b6000806000606084860312156128ee57600080fd5b83359250602084013561290081612888565b915061290e6040850161289d565b90509250925092565b60008060006060848603121561292c57600080fd5b8335925060208401359150604084013561ffff8116811461294c57600080fd5b809150509250925092565b60008060006060848603121561296c57600080fd5b833561297781612888565b925060208401359150604084013561294c81612888565b60008083601f8401126129a057600080fd5b50813567ffffffffffffffff8111156129b857600080fd5b6020830191508360208260051b8501011115610c3d57600080fd5b600080602083850312156129e657600080fd5b823567ffffffffffffffff8111156129fd57600080fd5b612a098582860161298e565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612a6a57603f19888603018452612a588583516126be565b94509285019290850190600101612a3c565b5092979650505050505050565b60008060408385031215612a8a57600080fd5b823591506020830135612a9c81612888565b809150509250929050565b600080600060408486031215612abc57600080fd5b83359250602084013567ffffffffffffffff811115612ada57600080fd5b6125c58682870161298e565b600080600060608486031215612afb57600080fd5b83359250612b0b6020850161250c565b9150604084013561294c81612888565b60008060408385031215612b2e57600080fd5b8235612b3981612888565b91506020830135612a9c81612888565b60008251612b5b81846020870161269a565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561058457610584612b65565b8183823760009101908152919050565b600181811c90821680612bb257607f821691505b602082108103612bd257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156115b957600081815260208120601f850160051c81016020861015612bff5750805b601f850160051c820191505b81811015612c1e57828155600101612c0b565b505050505050565b67ffffffffffffffff831115612c3e57612c3e6127ae565b612c5283612c4c8354612b9e565b83612bd8565b6000601f841160018114612c865760008515612c6e5750838201355b600019600387901b1c1916600186901b1783556111fb565b600083815260209020601f19861690835b82811015612cb75786850135825560209485019460019092019101612c97565b5086821015612cd45760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000612d23604083018688612ce6565b8281036020840152612d36818587612ce6565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6020815260006115cb602083018486612ce6565b600067ffffffffffffffff808316818103612d8857612d88612b65565b6001019392505050565b815167ffffffffffffffff811115612dac57612dac6127ae565b612dc081612dba8454612b9e565b84612bd8565b602080601f831160018114612df55760008415612ddd5750858301515b600019600386901b1c1916600185901b178555612c1e565b600085815260208120601f198616915b82811015612e2457888601518255948401946001909101908401612e05565b5085821015612e425787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000612e6560408301866126be565b8281036020840152612e78818587612ce6565b9695505050505050565b600060208284031215612e9457600080fd5b8151610e2981612888565b600061ffff821680612eb357612eb3612b65565b6000190192915050565b604081526000612ed060408301856126be565b905061ffff831660208301529392505050565b600061ffff808316818103612d8857612d88612b65565b606081526000612f0d60608301866126be565b61ffff851660208401528281036040840152612e7881856126be565b8082018082111561058457610584612b65565b6000808335601e19843603018112612f5357600080fd5b83018035915067ffffffffffffffff821115612f6e57600080fd5b602001915036819003821315610c3d57600080fd5b60008085851115612f9357600080fd5b83861115612fa057600080fd5b5050820193919092039150565b8035602083101561058457600019602084900360031b1b1692915050565b600060018201612fdd57612fdd612b65565b5060010190565b634e487b7160e01b600052600160045260246000fdfea26469706673582212201d1412fb11ca63e400758ea40508854e4bda3b2851a29ecc9f3b2b3977dd2e4464736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638b95dd7111610104578063c8690233116100a2578063e32954eb11610071578063e32954eb14610504578063e59d895d14610517578063e985e9c51461052a578063f1cb7e061461056657600080fd5b8063c869023314610442578063ce3decdc1461049b578063d5fa2b00146104ae578063d700ff33146104c157600080fd5b8063a8fa5682116100de578063a8fa5682146103b8578063a9784b3e146103cb578063ac9650d81461040f578063bc1c58d11461042f57600080fd5b80638b95dd711461037f578063a22cb46514610392578063a4b91a01146103a557600080fd5b80633603d7581161017c5780635c98042b1161014b5780635c98042b14610333578063623195b014610346578063691f343114610359578063773722131461036c57600080fd5b80633603d758146102a15780633b3b57de146102b45780634cbf6ba4146102c757806359d1d43c1461031357600080fd5b8063124a319c116101b8578063124a319c1461022f5780632203ab561461025a57806329cd62ea1461027b578063304e6ade1461028e57600080fd5b806301ffc9a7146101df5780630af179d71461020757806310f13a8c1461021c575b600080fd5b6101f26101ed366004612529565b610579565b60405190151581526020015b60405180910390f35b61021a610215366004612586565b61058a565b005b61021a61022a3660046125d2565b610794565b61024261023d36600461264c565b610861565b6040516001600160a01b0390911681526020016101fe565b61026d610268366004612678565b610b0d565b6040516101fe9291906126ea565b61021a610289366004612703565b610c44565b61021a61029c366004612586565b610cdf565b61021a6102af36600461272f565b610d5b565b6102426102c236600461272f565b610dfe565b6101f26102d5366004612678565b6000828152602081815260408083205467ffffffffffffffff1683526006825280832094835293815283822092825291909152205461ffff16151590565b610326610321366004612586565b610e30565b6040516101fe9190612748565b61032661034136600461272f565b610f10565b61021a61035436600461275b565b610fcf565b61032661036736600461272f565b61106c565b61021a61037a366004612586565b6110a6565b61021a61038d3660046127c4565b611122565b61021a6103a03660046128ad565b611202565b61021a6103b33660046128d9565b6112f1565b6103266103c6366004612917565b6113be565b6101f26103d9366004612957565b6001600160a01b039283166000908152600c60209081526040808320948352938152838220929094168152925290205460ff1690565b61042261041d3660046129d3565b61140c565b6040516101fe9190612a15565b61032661043d36600461272f565b61141a565b61048661045036600461272f565b6000818152602081815260408083205467ffffffffffffffff168352600982528083209383529290522080546001909101549091565b604080519283526020830191909152016101fe565b61021a6104a9366004612586565b611454565b61021a6104bc366004612a77565b611597565b6104eb6104cf36600461272f565b60006020819052908152604090205467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016101fe565b610422610512366004612aa7565b6115be565b61021a610525366004612ae6565b6115d3565b6101f2610538366004612b1b565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205460ff1690565b610326610574366004612678565b611692565b60006105848261175a565b92915050565b8261059481611798565b61059d57600080fd5b600084815260208181526040808320548151601f870184900484028101840190925285825283926060928392859267ffffffffffffffff9091169183916106039183918d908d908190840183828082843760009201919091525092939250506119ff9050565b90505b8051516020820151101561072d578661ffff1660000361066b578060400151965061063081611a60565b9450846040516020016106439190612b49565b60405160208183030381529060405280519060200120925061066481611a81565b935061071f565b600061067682611a60565b9050816040015161ffff168861ffff1614158061069a57506106988682611a9d565b155b1561071d576106f68c878a8e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518d91506106ed908290612b7b565b8b51158a611abb565b81604001519750816020015196508095508580519060200120935061071a82611a81565b94505b505b61072881611d28565b610606565b50835115610788576107888a85888c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925061077f91508290508f612b7b565b89511588611abb565b50505050505050505050565b8461079e81611798565b6107a757600080fd5b6000868152602081815260408083205467ffffffffffffffff168352600a8252808320898452909152908190209051849184916107e79089908990612b8e565b90815260200160405180910390209182610802929190612c26565b508484604051610813929190612b8e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516108519493929190612d0f565b60405180910390a3505050505050565b6000828152602081815260408083205467ffffffffffffffff1683526007825280832085845282528083206001600160e01b0319851684529091528120546001600160a01b031680156108b5579050610584565b60006108c085610dfe565b90506001600160a01b0381166108db57600092505050610584565b6040516301ffc9a760e01b602482015260009081906001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b179052516109489190612b49565b600060405180830381855afa9150503d8060008114610983576040519150601f19603f3d011682016040523d82523d6000602084013e610988565b606091505b509150915081158061099b575060208151105b806109dd575080601f815181106109b4576109b4612d41565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109ef576000945050505050610584565b6040516001600160e01b0319871660248201526001600160a01b0384169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166301ffc9a760e01b17905251610a5a9190612b49565b600060405180830381855afa9150503d8060008114610a95576040519150601f19603f3d011682016040523d82523d6000602084013e610a9a565b606091505b509092509050811580610aae575060208151105b80610af0575080601f81518110610ac757610ac7612d41565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610b02576000945050505050610584565b509095945050505050565b6000828152602081815260408083205467ffffffffffffffff168352600180835281842086855290925282206060915b848111610c245780851615801590610b6d575060008181526020839052604081208054610b6990612b9e565b9050115b15610c1c5780826000838152602001908152602001600020808054610b9190612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbd90612b9e565b8015610c0a5780601f10610bdf57610100808354040283529160200191610c0a565b820191906000526020600020905b815481529060010190602001808311610bed57829003601f168201915b50505050509050935093505050610c3d565b60011b610b3d565b5060006040518060200160405280600081525092509250505b9250929050565b82610c4e81611798565b610c5757600080fd5b604080518082018252848152602080820185815260008881528083528481205467ffffffffffffffff1681526009835284812089825283528490209251835551600190920191909155815185815290810184905285917f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4691015b60405180910390a250505050565b82610ce981611798565b610cf257600080fd5b6000848152602081815260408083205467ffffffffffffffff168352600382528083208784529091529020610d28838583612c26565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610cd1929190612d57565b80610d6581611798565b610d6e57600080fd5b6000828152602081905260408120805467ffffffffffffffff1691610d9283612d6b565b82546101009290920a67ffffffffffffffff818102199093169183160217909155600084815260208181526040918290205491519190921681528492507fc6621ccb8f3f5a04bb6502154b2caf6adf5983fe76dfef1cfc9c42e3579db444910160405180910390a25050565b600080610e0c83603c611692565b90508051600003610e205750600092915050565b610e2981611e10565b9392505050565b6000838152602081815260408083205467ffffffffffffffff168352600a825280832086845290915290819020905160609190610e709085908590612b8e565b90815260200160405180910390208054610e8990612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb590612b9e565b8015610f025780601f10610ed757610100808354040283529160200191610f02565b820191906000526020600020905b815481529060010190602001808311610ee557829003601f168201915b505050505090509392505050565b6000818152602081815260408083205467ffffffffffffffff168352600482528083208484529091529020805460609190610f4a90612b9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610f7690612b9e565b8015610fc35780601f10610f9857610100808354040283529160200191610fc3565b820191906000526020600020905b815481529060010190602001808311610fa657829003601f168201915b50505050509050919050565b83610fd981611798565b610fe257600080fd5b83610fee600182612b7b565b1615610ff957600080fd5b6000858152602081815260408083205467ffffffffffffffff1683526001825280832088845282528083208784529091529020611037838583612c26565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b6000818152602081815260408083205467ffffffffffffffff168352600882528083208484529091529020805460609190610f4a90612b9e565b826110b081611798565b6110b957600080fd5b6000848152602081815260408083205467ffffffffffffffff1683526008825280832087845290915290206110ef838583612c26565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610cd1929190612d57565b8261112c81611798565b61113557600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af75284846040516111679291906126ea565b60405180910390a2603c83036111be57837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd26111a284611e10565b6040516001600160a01b03909116815260200160405180910390a25b6000848152602081815260408083205467ffffffffffffffff16835260028252808320878452825280832086845290915290206111fb8382612d92565b5050505050565b6001600160a01b03821633036112855760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336000818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b03821633036113495760405162461bcd60e51b815260206004820181905260248201527f53657474696e672064656c65676174652073746174757320666f722073656c66604482015260640161127c565b336000818152600c6020908152604080832087845282528083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519384529286917ff0ddb3b04746704017f9aa8bd728fcc2c1d11675041205350018915f5e4750a0910160405180910390a4505050565b6000838152602081815260408083205467ffffffffffffffff168352600582528083208684528252808320858452825280832061ffff851684529091529020805460609190610e8990612b9e565b6060610e2960008484611e38565b6000818152602081815260408083205467ffffffffffffffff168352600382528083208484529091529020805460609190610f4a90612b9e565b8261145e81611798565b61146757600080fd5b6000848152602081815260408083205467ffffffffffffffff1680845260048352818420888552909252822080549192916114a190612b9e565b80601f01602080910402602001604051908101604052809291908181526020018280546114cd90612b9e565b801561151a5780601f106114ef5761010080835404028352916020019161151a565b820191906000526020600020905b8154815290600101906020018083116114fd57829003601f168201915b5050505067ffffffffffffffff841660009081526004602090815260408083208b845290915290209192506115529050858783612c26565b50857f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f8582878760405161158793929190612e52565b60405180910390a2505050505050565b816115a181611798565b6115aa57600080fd5b6115b983603c61038d85612011565b505050565b60606115cb848484611e38565b949350505050565b826115dd81611798565b6115e657600080fd5b6000848152602081815260408083205467ffffffffffffffff1683526007825280832087845282528083206001600160e01b031987168085529083529281902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b6000828152602081815260408083205467ffffffffffffffff16835260028252808320858452825280832084845290915290208054606091906116d490612b9e565b80601f016020809104026020016040519081016040528092919081815260200182805461170090612b9e565b801561174d5780601f106117225761010080835404028352916020019161174d565b820191906000526020600020905b81548152906001019060200180831161173057829003601f168201915b5050505050905092915050565b60006001600160e01b031982167f59d1d43c00000000000000000000000000000000000000000000000000000000148061058457506105848261204a565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806117f95750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b1561180657506001919050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018390526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015611887573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ab9190612e82565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03160361198b576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119889190612e82565b90505b6001600160a01b0381163314806119c557506001600160a01b0381166000908152600b6020908152604080832033845290915290205460ff165b80610e2957506001600160a01b0381166000908152600c60209081526040808320868452825280832033845290915290205460ff16610e29565b611a4d6040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c0810182905261058481611d28565b6020810151815160609161058491611a789082612088565b845191906120e2565b60a081015160c082015160609161058491611a78908290612b7b565b600081518351148015610e295750610e298360008460008751612159565b865160208801206000611acf8787876120e2565b90508315611bf95767ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c16845290915290208054611b1a90612b9e565b159050611b795767ffffffffffffffff831660009081526006602090815260408083208d845282528083208584529091528120805461ffff1691611b5d83612e9f565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c1684529091528120611bba916124b6565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a604051611bec929190612ebd565b60405180910390a2610788565b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c16845290915290208054611c3c90612b9e565b9050600003611c9d5767ffffffffffffffff831660009081526006602090815260408083208d845282528083208584529091528120805461ffff1691611c8183612ee3565b91906101000a81548161ffff021916908361ffff160217905550505b67ffffffffffffffff831660009081526005602090815260408083208d84528252808320858452825280832061ffff8c1684529091529020611cdf8282612d92565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a84604051611d1493929190612efa565b60405180910390a250505050505050505050565b60c08101516020820181905281515111611d3f5750565b6000611d5382600001518360200151612088565b8260200151611d629190612f29565b8251909150611d71908261217c565b61ffff166040830152611d85600282612f29565b8251909150611d94908261217c565b61ffff166060830152611da8600282612f29565b8251909150611db790826121a4565b63ffffffff166080830152611dcd600482612f29565b8251909150600090611ddf908361217c565b61ffff169050611df0600283612f29565b60a084018190529150611e038183612f29565b60c0909301929092525050565b60008151601414611e2057600080fd5b50602001516c01000000000000000000000000900490565b60608167ffffffffffffffff811115611e5357611e536127ae565b604051908082528060200260200182016040528015611e8657816020015b6060815260200190600190039081611e715790505b50905060005b82811015612009578415611f51576000848483818110611eae57611eae612d41565b9050602002810190611ec09190612f3c565b611ecf91602491600491612f83565b611ed891612fad565b9050858114611f4f5760405162461bcd60e51b815260206004820152603460248201527f6d756c746963616c6c3a20416c6c207265636f726473206d757374206861766560448201527f2061206d61746368696e67206e616d6568617368000000000000000000000000606482015260840161127c565b505b60008030868685818110611f6757611f67612d41565b9050602002810190611f799190612f3c565b604051611f87929190612b8e565b600060405180830381855af49150503d8060008114611fc2576040519150601f19603f3d011682016040523d82523d6000602084013e611fc7565b606091505b509150915081611fd657600080fd5b80848481518110611fe957611fe9612d41565b60200260200101819052505050808061200190612fcb565b915050611e8c565b509392505050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60006001600160e01b031982167fc86902330000000000000000000000000000000000000000000000000000000014806105845750610584826121ce565b6000815b8351811061209c5761209c612fe4565b60006120a8858361220c565b60ff1690506120b8816001612f29565b6120c29083612f29565b9150806000036120d257506120d8565b5061208c565b6115cb8382612b7b565b82516060906120f18385612f29565b11156120fc57600080fd5b60008267ffffffffffffffff811115612117576121176127ae565b6040519080825280601f01601f191660200182016040528015612141576020820181803683370190505b50905060208082019086860101610b02828287612230565b6000612166848484612286565b612171878785612286565b149695505050505050565b815160009061218c836002612f29565b111561219757600080fd5b50016002015161ffff1690565b81516000906121b4836004612f29565b11156121bf57600080fd5b50016004015163ffffffff1690565b60006001600160e01b031982167f691f34310000000000000000000000000000000000000000000000000000000014806105845750610584826122aa565b600082828151811061222057612220612d41565b016020015160f81c905092915050565b602081106122685781518352612247602084612f29565b9250612254602083612f29565b9150612261602082612b7b565b9050612230565b905182516020929092036101000a6000190180199091169116179052565b82516000906122958385612f29565b11156122a057600080fd5b5091016020012090565b60006001600160e01b031982167f124a319c00000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167fa8fa568200000000000000000000000000000000000000000000000000000000148061234657506001600160e01b031982167f5c98042b00000000000000000000000000000000000000000000000000000000145b8061058457506105848260006001600160e01b031982167fbc1c58d100000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806123ec57506001600160e01b031982167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b8061058457506105848260006001600160e01b031982167f2203ab5600000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167fd700ff3300000000000000000000000000000000000000000000000000000000148061058457506105848260006001600160e01b031982167f4fbf043300000000000000000000000000000000000000000000000000000000148061058457506301ffc9a760e01b6001600160e01b0319831614610584565b5080546124c290612b9e565b6000825580601f106124d2575050565b601f0160209004906000526020600020908101906124f091906124f3565b50565b5b8082111561250857600081556001016124f4565b5090565b80356001600160e01b03198116811461252457600080fd5b919050565b60006020828403121561253b57600080fd5b610e298261250c565b60008083601f84011261255657600080fd5b50813567ffffffffffffffff81111561256e57600080fd5b602083019150836020828501011115610c3d57600080fd5b60008060006040848603121561259b57600080fd5b83359250602084013567ffffffffffffffff8111156125b957600080fd5b6125c586828701612544565b9497909650939450505050565b6000806000806000606086880312156125ea57600080fd5b85359450602086013567ffffffffffffffff8082111561260957600080fd5b61261589838a01612544565b9096509450604088013591508082111561262e57600080fd5b5061263b88828901612544565b969995985093965092949392505050565b6000806040838503121561265f57600080fd5b8235915061266f6020840161250c565b90509250929050565b6000806040838503121561268b57600080fd5b50508035926020909101359150565b60005b838110156126b557818101518382015260200161269d565b50506000910152565b600081518084526126d681602086016020860161269a565b601f01601f19169290920160200192915050565b8281526040602082015260006115cb60408301846126be565b60008060006060848603121561271857600080fd5b505081359360208301359350604090920135919050565b60006020828403121561274157600080fd5b5035919050565b602081526000610e2960208301846126be565b6000806000806060858703121561277157600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561279657600080fd5b6127a287828801612544565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156127d957600080fd5b8335925060208401359150604084013567ffffffffffffffff808211156127ff57600080fd5b818601915086601f83011261281357600080fd5b813581811115612825576128256127ae565b604051601f8201601f19908116603f0116810190838211818310171561284d5761284d6127ae565b8160405282815289602084870101111561286657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6001600160a01b03811681146124f057600080fd5b8035801515811461252457600080fd5b600080604083850312156128c057600080fd5b82356128cb81612888565b915061266f6020840161289d565b6000806000606084860312156128ee57600080fd5b83359250602084013561290081612888565b915061290e6040850161289d565b90509250925092565b60008060006060848603121561292c57600080fd5b8335925060208401359150604084013561ffff8116811461294c57600080fd5b809150509250925092565b60008060006060848603121561296c57600080fd5b833561297781612888565b925060208401359150604084013561294c81612888565b60008083601f8401126129a057600080fd5b50813567ffffffffffffffff8111156129b857600080fd5b6020830191508360208260051b8501011115610c3d57600080fd5b600080602083850312156129e657600080fd5b823567ffffffffffffffff8111156129fd57600080fd5b612a098582860161298e565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612a6a57603f19888603018452612a588583516126be565b94509285019290850190600101612a3c565b5092979650505050505050565b60008060408385031215612a8a57600080fd5b823591506020830135612a9c81612888565b809150509250929050565b600080600060408486031215612abc57600080fd5b83359250602084013567ffffffffffffffff811115612ada57600080fd5b6125c58682870161298e565b600080600060608486031215612afb57600080fd5b83359250612b0b6020850161250c565b9150604084013561294c81612888565b60008060408385031215612b2e57600080fd5b8235612b3981612888565b91506020830135612a9c81612888565b60008251612b5b81846020870161269a565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561058457610584612b65565b8183823760009101908152919050565b600181811c90821680612bb257607f821691505b602082108103612bd257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156115b957600081815260208120601f850160051c81016020861015612bff5750805b601f850160051c820191505b81811015612c1e57828155600101612c0b565b505050505050565b67ffffffffffffffff831115612c3e57612c3e6127ae565b612c5283612c4c8354612b9e565b83612bd8565b6000601f841160018114612c865760008515612c6e5750838201355b600019600387901b1c1916600186901b1783556111fb565b600083815260209020601f19861690835b82811015612cb75786850135825560209485019460019092019101612c97565b5086821015612cd45760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000612d23604083018688612ce6565b8281036020840152612d36818587612ce6565b979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6020815260006115cb602083018486612ce6565b600067ffffffffffffffff808316818103612d8857612d88612b65565b6001019392505050565b815167ffffffffffffffff811115612dac57612dac6127ae565b612dc081612dba8454612b9e565b84612bd8565b602080601f831160018114612df55760008415612ddd5750858301515b600019600386901b1c1916600185901b178555612c1e565b600085815260208120601f198616915b82811015612e2457888601518255948401946001909101908401612e05565b5085821015612e425787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000612e6560408301866126be565b8281036020840152612e78818587612ce6565b9695505050505050565b600060208284031215612e9457600080fd5b8151610e2981612888565b600061ffff821680612eb357612eb3612b65565b6000190192915050565b604081526000612ed060408301856126be565b905061ffff831660208301529392505050565b600061ffff808316818103612d8857612d88612b65565b606081526000612f0d60608301866126be565b61ffff851660208401528281036040840152612e7881856126be565b8082018082111561058457610584612b65565b6000808335601e19843603018112612f5357600080fd5b83018035915067ffffffffffffffff821115612f6e57600080fd5b602001915036819003821315610c3d57600080fd5b60008085851115612f9357600080fd5b83861115612fa057600080fd5b5050820193919092039150565b8035602083101561058457600019602084900360031b1b1692915050565b600060018201612fdd57612fdd612b65565b5060010190565b634e487b7160e01b600052600160045260246000fdfea26469706673582212201d1412fb11ca63e400758ea40508854e4bda3b2851a29ecc9f3b2b3977dd2e4464736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "ABI(bytes32,uint256)": { + "params": { + "contentTypes": "A bitwise OR of the ABI formats accepted by the caller.", + "node": "The ENS node to query" + }, + "returns": { + "_0": "contentType The content type of the return value", + "_1": "data The ABI data" + } + }, + "addr(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated address." + } + }, + "approve(bytes32,address,bool)": { + "details": "Approve a delegate to be able to updated records on a node." + }, + "clearRecords(bytes32)": { + "params": { + "node": "The node to update." + } + }, + "contenthash(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated contenthash." + } + }, + "dnsRecord(bytes32,bytes32,uint16)": { + "params": { + "name": "the keccak-256 hash of the fully-qualified name for which to fetch the record", + "node": "the namehash of the node for which to fetch the record", + "resource": "the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types" + }, + "returns": { + "_0": "the DNS record in wire format if present, otherwise empty" + } + }, + "hasDNSRecords(bytes32,bytes32)": { + "params": { + "name": "the namehash of the node for which to check the records", + "node": "the namehash of the node for which to check the records" + } + }, + "interfaceImplementer(bytes32,bytes4)": { + "params": { + "interfaceID": "The EIP 165 interface ID to check for.", + "node": "The ENS node to query." + }, + "returns": { + "_0": "The address that implements this interface, or 0 if the interface is unsupported." + } + }, + "isApprovedFor(address,bytes32,address)": { + "details": "Check to see if the delegate has been approved by the owner for the node." + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC1155-isApprovedForAll}." + }, + "name(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated name." + } + }, + "pubkey(bytes32)": { + "params": { + "node": "The ENS node to query" + }, + "returns": { + "x": "The X coordinate of the curve point for the public key.", + "y": "The Y coordinate of the curve point for the public key." + } + }, + "setABI(bytes32,uint256,bytes)": { + "params": { + "contentType": "The content type of the ABI", + "data": "The ABI data.", + "node": "The node to update." + } + }, + "setAddr(bytes32,address)": { + "params": { + "a": "The address to set.", + "node": "The node to update." + } + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC1155-setApprovalForAll}." + }, + "setContenthash(bytes32,bytes)": { + "params": { + "hash": "The contenthash to set", + "node": "The node to update." + } + }, + "setDNSRecords(bytes32,bytes)": { + "params": { + "data": "the DNS wire format records to set", + "node": "the namehash of the node for which to set the records" + } + }, + "setInterface(bytes32,bytes4,address)": { + "params": { + "implementer": "The address of a contract that implements this interface for this node.", + "interfaceID": "The EIP 165 interface ID.", + "node": "The node to update." + } + }, + "setName(bytes32,string)": { + "params": { + "node": "The node to update." + } + }, + "setPubkey(bytes32,bytes32,bytes32)": { + "params": { + "node": "The ENS node to query", + "x": "the X coordinate of the curve point for the public key.", + "y": "the Y coordinate of the curve point for the public key." + } + }, + "setText(bytes32,string,string)": { + "params": { + "key": "The key to set.", + "node": "The node to update.", + "value": "The text data value to set." + } + }, + "setZonehash(bytes32,bytes)": { + "params": { + "hash": "The zonehash to set", + "node": "The node to update." + } + }, + "text(bytes32,string)": { + "params": { + "key": "The text data key to query.", + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated text data." + } + }, + "zonehash(bytes32)": { + "params": { + "node": "The ENS node to query." + }, + "returns": { + "_0": "The associated contenthash." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "ABI(bytes32,uint256)": { + "notice": "Returns the ABI associated with an ENS node. Defined in EIP205." + }, + "addr(bytes32)": { + "notice": "Returns the address associated with an ENS node." + }, + "clearRecords(bytes32)": { + "notice": "Increments the record version associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "contenthash(bytes32)": { + "notice": "Returns the contenthash associated with an ENS node." + }, + "dnsRecord(bytes32,bytes32,uint16)": { + "notice": "Obtain a DNS record." + }, + "hasDNSRecords(bytes32,bytes32)": { + "notice": "Check if a given node has records." + }, + "interfaceImplementer(bytes32,bytes4)": { + "notice": "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." + }, + "name(bytes32)": { + "notice": "Returns the name associated with an ENS node, for reverse records. Defined in EIP181." + }, + "pubkey(bytes32)": { + "notice": "Returns the SECP256k1 public key associated with an ENS node. Defined in EIP 619." + }, + "setABI(bytes32,uint256,bytes)": { + "notice": "Sets the ABI associated with an ENS node. Nodes may have one ABI of each content type. To remove an ABI, set it to the empty string." + }, + "setAddr(bytes32,address)": { + "notice": "Sets the address associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "setContenthash(bytes32,bytes)": { + "notice": "Sets the contenthash associated with an ENS node. May only be called by the owner of that node in the ENS registry." + }, + "setDNSRecords(bytes32,bytes)": { + "notice": "Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first." + }, + "setInterface(bytes32,bytes4,address)": { + "notice": "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." + }, + "setName(bytes32,string)": { + "notice": "Sets the name associated with an ENS node, for reverse records. May only be called by the owner of that node in the ENS registry." + }, + "setPubkey(bytes32,bytes32,bytes32)": { + "notice": "Sets the SECP256k1 public key associated with an ENS node." + }, + "setText(bytes32,string,string)": { + "notice": "Sets the text data associated with an ENS node and key. May only be called by the owner of that node in the ENS registry." + }, + "setZonehash(bytes32,bytes)": { + "notice": "setZonehash sets the hash for the zone. May only be called by the owner of that node in the ENS registry." + }, + "text(bytes32,string)": { + "notice": "Returns the text data associated with an ENS node and key." + }, + "zonehash(bytes32)": { + "notice": "zonehash obtains the hash for the zone." + } + }, + "notice": "A simple resolver anyone can use; only allows the owner of a node to set its address.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15571, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "recordVersions", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_uint64)" + }, + { + "astId": 15665, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_abis", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))" + }, + { + "astId": 15819, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_addresses", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))" + }, + { + "astId": 16010, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_hashes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))" + }, + { + "astId": 16100, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_zonehashes", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))" + }, + { + "astId": 16110, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_records", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))" + }, + { + "astId": 16118, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_nameEntriesCount", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16)))" + }, + { + "astId": 16856, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_interfaces", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes4,t_address)))" + }, + { + "astId": 17048, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_names", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_string_storage))" + }, + { + "astId": 17135, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_pubkeys", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_struct(PublicKey)17128_storage))" + }, + { + "astId": 17238, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versionable_texts", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage)))" + }, + { + "astId": 15100, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "_operatorApprovals", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 15109, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "_tokenApprovals", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_mapping(t_address,t_bool)))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_address,t_mapping(t_bytes32,t_mapping(t_address,t_bool)))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(bytes32 => mapping(address => bool)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_address,t_bool))" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_bytes32,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes32 => uint16))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_uint16)" + }, + "t_mapping(t_bytes32,t_mapping(t_bytes4,t_address))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(bytes4 => address))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes4,t_address)" + }, + "t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(string => string))", + "numberOfBytes": "32", + "value": "t_mapping(t_string_memory_ptr,t_string_storage)" + }, + "t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint16 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint16,t_bytes_storage)" + }, + "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint256 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_bytes_storage)" + }, + "t_mapping(t_bytes32,t_string_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_bytes32,t_struct(PublicKey)17128_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct PubkeyResolver.PublicKey)", + "numberOfBytes": "32", + "value": "t_struct(PublicKey)17128_storage" + }, + "t_mapping(t_bytes32,t_uint16)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint16)", + "numberOfBytes": "32", + "value": "t_uint16" + }, + "t_mapping(t_bytes32,t_uint64)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint64)", + "numberOfBytes": "32", + "value": "t_uint64" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_string_memory_ptr,t_string_storage)": { + "encoding": "mapping", + "key": "t_string_memory_ptr", + "label": "mapping(string => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_uint16,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint16", + "label": "mapping(uint16 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint256,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_bytes_storage)" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes32,t_uint16))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_bytes4,t_address)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_bytes4,t_address))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(string => string)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage)))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_string_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => string))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_string_storage)" + }, + "t_mapping(t_uint64,t_mapping(t_bytes32,t_struct(PublicKey)17128_storage))": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => mapping(bytes32 => struct PubkeyResolver.PublicKey))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_struct(PublicKey)17128_storage)" + }, + "t_string_memory_ptr": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(PublicKey)17128_storage": { + "encoding": "inplace", + "label": "struct PubkeyResolver.PublicKey", + "members": [ + { + "astId": 17125, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "x", + "offset": 0, + "slot": "0", + "type": "t_bytes32" + }, + { + "astId": 17127, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "y", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/ReverseRegistrar.json b/deployments/sepolia/ReverseRegistrar.json new file mode 100644 index 00000000..133865d0 --- /dev/null +++ b/deployments/sepolia/ReverseRegistrar.json @@ -0,0 +1,516 @@ +{ + "address": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "ensAddr", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "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": true, + "internalType": "contract NameResolver", + "name": "resolver", + "type": "address" + } + ], + "name": "DefaultResolverChanged", + "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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "node", + "type": "bytes32" + } + ], + "name": "ReverseClaimed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "claim", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "claimForAddr", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "claimWithResolver", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "controllers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultResolver", + "outputs": [ + { + "internalType": "contract NameResolver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ens", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "node", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "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": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setDefaultResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setName", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNameForAddr", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf94c991d0d40013b455f2c4ed64805f6fe39d00e567c716782215a82dc65557e", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "transactionIndex": 64, + "gasUsed": "825844", + "logsBloom": "0x00000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000010000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000000020000000000000000000000000000000000000000000", + "blockHash": "0x948e29d7ba4fda83fd0293504a7e03d6e64e13e2785335f75270d1878cdb69a0", + "transactionHash": "0xf94c991d0d40013b455f2c4ed64805f6fe39d00e567c716782215a82dc65557e", + "logs": [ + { + "transactionIndex": 64, + "blockNumber": 3789411, + "transactionHash": "0xf94c991d0d40013b455f2c4ed64805f6fe39d00e567c716782215a82dc65557e", + "address": "0xA0a1AbcDAe1a2a4A2EF8e9113Ff0e02DD81DC0C6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 113, + "blockHash": "0x948e29d7ba4fda83fd0293504a7e03d6e64e13e2785335f75270d1878cdb69a0" + } + ], + "blockNumber": 3789411, + "cumulativeGasUsed": "7409741", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + ], + "numDeployments": 2, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"ensAddr\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":true,\"internalType\":\"contract NameResolver\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"DefaultResolverChanged\",\"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\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"ReverseClaimed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"claimForAddr\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"claimWithResolver\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"controllers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultResolver\",\"outputs\":[{\"internalType\":\"contract NameResolver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"node\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"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\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setDefaultResolver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setNameForAddr\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"claim(address)\":{\"details\":\"Transfers ownership of the reverse ENS record associated with the calling account.\",\"params\":{\"owner\":\"The address to set as the owner of the reverse record in ENS.\"},\"returns\":{\"_0\":\"The ENS node hash of the reverse record.\"}},\"claimForAddr(address,address,address)\":{\"details\":\"Transfers ownership of the reverse ENS record associated with the calling account.\",\"params\":{\"addr\":\"The reverse record to set\",\"owner\":\"The address to set as the owner of the reverse record in ENS.\",\"resolver\":\"The resolver of the reverse node\"},\"returns\":{\"_0\":\"The ENS node hash of the reverse record.\"}},\"claimWithResolver(address,address)\":{\"details\":\"Transfers ownership of the reverse ENS record associated with the calling account.\",\"params\":{\"owner\":\"The address to set as the owner of the reverse record in ENS.\",\"resolver\":\"The address of the resolver to set; 0 to leave unchanged.\"},\"returns\":{\"_0\":\"The ENS node hash of the reverse record.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"ensAddr\":\"The address of the ENS registry.\"}},\"node(address)\":{\"details\":\"Returns the node hash for a given account's reverse records.\",\"params\":{\"addr\":\"The address to hash\"},\"returns\":{\"_0\":\"The ENS node hash.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setName(string)\":{\"details\":\"Sets the `name()` record for the reverse ENS record associated with the calling account. First updates the resolver to the default reverse resolver if necessary.\",\"params\":{\"name\":\"The name to set for this address.\"},\"returns\":{\"_0\":\"The ENS node hash of the reverse record.\"}},\"setNameForAddr(address,address,address,string)\":{\"details\":\"Sets the `name()` record for the reverse ENS record associated with the account provided. Updates the resolver to a designated resolver Only callable by controllers and authorised users\",\"params\":{\"addr\":\"The reverse record to set\",\"name\":\"The name to set for this address.\",\"owner\":\"The owner of the reverse node\",\"resolver\":\"The resolver of the reverse node\"},\"returns\":{\"_0\":\"The ENS node hash of the reverse record.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/reverseRegistrar/ReverseRegistrar.sol\":\"ReverseRegistrar\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/reverseRegistrar/IReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface IReverseRegistrar {\\n function setDefaultResolver(address resolver) external;\\n\\n function claim(address owner) external returns (bytes32);\\n\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function setName(string memory name) external returns (bytes32);\\n\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) external returns (bytes32);\\n\\n function node(address addr) external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0x83adfcf6da72b1bcd1e3ac387afe5fc7fdf7f2ac28b7601544d2ca4b9d45d159\"},\"contracts/reverseRegistrar/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IReverseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../root/Controllable.sol\\\";\\n\\nabstract contract NameResolver {\\n function setName(bytes32 node, string memory name) public virtual;\\n}\\n\\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\\n\\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n// namehash('addr.reverse')\\n\\ncontract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar {\\n ENS public immutable ens;\\n NameResolver public defaultResolver;\\n\\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\\n event DefaultResolverChanged(NameResolver indexed resolver);\\n\\n /**\\n * @dev Constructor\\n * @param ensAddr The address of the ENS registry.\\n */\\n constructor(ENS ensAddr) {\\n ens = ensAddr;\\n\\n // Assign ownership of the reverse record to our deployer\\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\\n ensAddr.owner(ADDR_REVERSE_NODE)\\n );\\n if (address(oldRegistrar) != address(0x0)) {\\n oldRegistrar.claim(msg.sender);\\n }\\n }\\n\\n modifier authorised(address addr) {\\n require(\\n addr == msg.sender ||\\n controllers[msg.sender] ||\\n ens.isApprovedForAll(addr, msg.sender) ||\\n ownsContract(addr),\\n \\\"ReverseRegistrar: Caller is not a controller or authorised by address or the address itself\\\"\\n );\\n _;\\n }\\n\\n function setDefaultResolver(address resolver) public override onlyOwner {\\n require(\\n address(resolver) != address(0),\\n \\\"ReverseRegistrar: Resolver address must not be 0\\\"\\n );\\n defaultResolver = NameResolver(resolver);\\n emit DefaultResolverChanged(NameResolver(resolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claim(address owner) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, address(defaultResolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param addr The reverse record to set\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The resolver of the reverse node\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) public override authorised(addr) returns (bytes32) {\\n bytes32 labelHash = sha3HexAddress(addr);\\n bytes32 reverseNode = keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, labelHash)\\n );\\n emit ReverseClaimed(addr, reverseNode);\\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0);\\n return reverseNode;\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, resolver);\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the calling account. First updates the resolver to the default reverse\\n * resolver if necessary.\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setName(string memory name) public override returns (bytes32) {\\n return\\n setNameForAddr(\\n msg.sender,\\n msg.sender,\\n address(defaultResolver),\\n name\\n );\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the account provided. Updates the resolver to a designated resolver\\n * Only callable by controllers and authorised users\\n * @param addr The reverse record to set\\n * @param owner The owner of the reverse node\\n * @param resolver The resolver of the reverse node\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) public override returns (bytes32) {\\n bytes32 node = claimForAddr(addr, owner, resolver);\\n NameResolver(resolver).setName(node, name);\\n return node;\\n }\\n\\n /**\\n * @dev Returns the node hash for a given account's reverse records.\\n * @param addr The address to hash\\n * @return The ENS node hash.\\n */\\n function node(address addr) public pure override returns (bytes32) {\\n return\\n keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\\n );\\n }\\n\\n /**\\n * @dev An optimised function to compute the sha3 of the lower-case\\n * hexadecimal representation of an Ethereum address.\\n * @param addr The address to hash\\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\\n * input address.\\n */\\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\\n assembly {\\n for {\\n let i := 40\\n } gt(i, 0) {\\n\\n } {\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n }\\n\\n ret := keccak256(0, 40)\\n }\\n }\\n\\n function ownsContract(address addr) internal view returns (bool) {\\n try Ownable(addr).owner() returns (address owner) {\\n return owner == msg.sender;\\n } catch {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd57d28e5791b4b44650a00f5ef6c725af53698ec33faeeaa3591f0dbd939559a\"},\"contracts/root/Controllable.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool enabled);\\n\\n modifier onlyController() {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n\\n function setController(address controller, bool enabled) public onlyOwner {\\n controllers[controller] = enabled;\\n emit ControllerChanged(controller, enabled);\\n }\\n}\\n\",\"keccak256\":\"0xb19b8c0fafe9ca2b4bf8aaafee486fa31437672e1e1977bdf84bfe03464969db\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b5060405162000f5338038062000f53833981016040819052610031916101b6565b61003a3361014e565b6001600160a01b03811660808190526040516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152600091906302571be390602401602060405180830381865afa1580156100a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ca91906101b6565b90506001600160a01b0381161561014757604051630f41a04d60e11b81523360048201526001600160a01b03821690631e83409a906024016020604051808303816000875af1158015610121573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014591906101da565b505b50506101f3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101b357600080fd5b50565b6000602082840312156101c857600080fd5b81516101d38161019e565b9392505050565b6000602082840312156101ec57600080fd5b5051919050565b608051610d366200021d6000396000818161012d015281816102f001526105070152610d366000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c66485b211610066578063c66485b2146101e1578063da8c229e146101f4578063e0dba60f14610227578063f2fde38b1461023a57600080fd5b80638da5cb5b146101aa578063bffbe61c146101bb578063c47f0027146101ce57600080fd5b806365669631116100c85780636566963114610167578063715018a61461017a5780637a806d6b14610184578063828eab0e1461019757600080fd5b80630f5a5466146100ef5780631e83409a146101155780633f15457f14610128575b600080fd5b6101026100fd366004610a25565b61024d565b6040519081526020015b60405180910390f35b610102610123366004610a5e565b610261565b61014f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010c565b610102610175366004610a7b565b610283565b61018261056e565b005b610102610192366004610b82565b610582565b60025461014f906001600160a01b031681565b6000546001600160a01b031661014f565b6101026101c9366004610a5e565b610616565b6101026101dc366004610bf7565b610671565b6101826101ef366004610a5e565b61068e565b610217610202366004610a5e565b60016020526000908152604090205460ff1681565b604051901515815260200161010c565b610182610235366004610c42565b610769565b610182610248366004610a5e565b6107d0565b600061025a338484610283565b9392505050565b60025460009061027d90339084906001600160a01b0316610283565b92915050565b6000836001600160a01b0381163314806102ac57503360009081526001602052604090205460ff165b8061035b57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610337573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035b9190610c70565b8061036a575061036a81610860565b6104075760405162461bcd60e51b815260206004820152605b60248201527f526576657273655265676973747261723a2043616c6c6572206973206e6f742060448201527f6120636f6e74726f6c6c6572206f7220617574686f726973656420627920616460648201527f6472657373206f7220746865206164647265737320697473656c660000000000608482015260a4015b60405180910390fd5b6000610412866108d9565b604080517f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2602080830191909152818301849052825180830384018152606090920192839052815191012091925081906001600160a01b038916907f6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e9290600090a36040517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152602481018390526001600160a01b0387811660448301528681166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b50929998505050505050505050565b610576610959565b61058060006109b3565b565b600080610590868686610283565b6040517f773722130000000000000000000000000000000000000000000000000000000081529091506001600160a01b038516906377372213906105da9084908790600401610c8d565b600060405180830381600087803b1580156105f457600080fd5b505af1158015610608573d6000803e3d6000fd5b509298975050505050505050565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2610642836108d9565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050919050565b60025460009061027d90339081906001600160a01b031685610582565b610696610959565b6001600160a01b0381166107125760405162461bcd60e51b815260206004820152603060248201527f526576657273655265676973747261723a205265736f6c76657220616464726560448201527f7373206d757374206e6f7420626520300000000000000000000000000000000060648201526084016103fe565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517feae17a84d9eb83d8c8eb317f9e7d64857bc363fa51674d996c023f4340c577cf90600090a250565b610771610959565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b6107d8610959565b6001600160a01b0381166108545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103fe565b61085d816109b3565b50565b6000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156108bc575060408051601f3d908101601f191682019092526108b991810190610ce3565b60015b6108c857506000919050565b6001600160a01b0316331492915050565b600060285b801561094d57600019017f3031323334353637383961626364656600000000000000000000000000000000600f84161a8153601090920491600019017f3031323334353637383961626364656600000000000000000000000000000000600f84161a81536010830492506108de565b50506028600020919050565b6000546001600160a01b031633146105805760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103fe565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461085d57600080fd5b60008060408385031215610a3857600080fd5b8235610a4381610a10565b91506020830135610a5381610a10565b809150509250929050565b600060208284031215610a7057600080fd5b813561025a81610a10565b600080600060608486031215610a9057600080fd5b8335610a9b81610a10565b92506020840135610aab81610a10565b91506040840135610abb81610a10565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610b0657600080fd5b813567ffffffffffffffff80821115610b2157610b21610ac6565b604051601f8301601f19908116603f01168101908282118183101715610b4957610b49610ac6565b81604052838152866020858801011115610b6257600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215610b9857600080fd5b8435610ba381610a10565b93506020850135610bb381610a10565b92506040850135610bc381610a10565b9150606085013567ffffffffffffffff811115610bdf57600080fd5b610beb87828801610af5565b91505092959194509250565b600060208284031215610c0957600080fd5b813567ffffffffffffffff811115610c2057600080fd5b610c2c84828501610af5565b949350505050565b801515811461085d57600080fd5b60008060408385031215610c5557600080fd5b8235610c6081610a10565b91506020830135610a5381610c34565b600060208284031215610c8257600080fd5b815161025a81610c34565b82815260006020604081840152835180604085015260005b81811015610cc157858101830151858201606001528201610ca5565b506000606082860101526060601f19601f830116850101925050509392505050565b600060208284031215610cf557600080fd5b815161025a81610a1056fea2646970667358221220beab0412e54fd175ddb6fc54aabebbad253b933d875cac9f5991b7575afa240764736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c66485b211610066578063c66485b2146101e1578063da8c229e146101f4578063e0dba60f14610227578063f2fde38b1461023a57600080fd5b80638da5cb5b146101aa578063bffbe61c146101bb578063c47f0027146101ce57600080fd5b806365669631116100c85780636566963114610167578063715018a61461017a5780637a806d6b14610184578063828eab0e1461019757600080fd5b80630f5a5466146100ef5780631e83409a146101155780633f15457f14610128575b600080fd5b6101026100fd366004610a25565b61024d565b6040519081526020015b60405180910390f35b610102610123366004610a5e565b610261565b61014f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010c565b610102610175366004610a7b565b610283565b61018261056e565b005b610102610192366004610b82565b610582565b60025461014f906001600160a01b031681565b6000546001600160a01b031661014f565b6101026101c9366004610a5e565b610616565b6101026101dc366004610bf7565b610671565b6101826101ef366004610a5e565b61068e565b610217610202366004610a5e565b60016020526000908152604090205460ff1681565b604051901515815260200161010c565b610182610235366004610c42565b610769565b610182610248366004610a5e565b6107d0565b600061025a338484610283565b9392505050565b60025460009061027d90339084906001600160a01b0316610283565b92915050565b6000836001600160a01b0381163314806102ac57503360009081526001602052604090205460ff165b8061035b57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610337573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035b9190610c70565b8061036a575061036a81610860565b6104075760405162461bcd60e51b815260206004820152605b60248201527f526576657273655265676973747261723a2043616c6c6572206973206e6f742060448201527f6120636f6e74726f6c6c6572206f7220617574686f726973656420627920616460648201527f6472657373206f7220746865206164647265737320697473656c660000000000608482015260a4015b60405180910390fd5b6000610412866108d9565b604080517f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2602080830191909152818301849052825180830384018152606090920192839052815191012091925081906001600160a01b038916907f6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e9290600090a36040517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152602481018390526001600160a01b0387811660448301528681166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b50929998505050505050505050565b610576610959565b61058060006109b3565b565b600080610590868686610283565b6040517f773722130000000000000000000000000000000000000000000000000000000081529091506001600160a01b038516906377372213906105da9084908790600401610c8d565b600060405180830381600087803b1580156105f457600080fd5b505af1158015610608573d6000803e3d6000fd5b509298975050505050505050565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2610642836108d9565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050919050565b60025460009061027d90339081906001600160a01b031685610582565b610696610959565b6001600160a01b0381166107125760405162461bcd60e51b815260206004820152603060248201527f526576657273655265676973747261723a205265736f6c76657220616464726560448201527f7373206d757374206e6f7420626520300000000000000000000000000000000060648201526084016103fe565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517feae17a84d9eb83d8c8eb317f9e7d64857bc363fa51674d996c023f4340c577cf90600090a250565b610771610959565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b6107d8610959565b6001600160a01b0381166108545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103fe565b61085d816109b3565b50565b6000816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156108bc575060408051601f3d908101601f191682019092526108b991810190610ce3565b60015b6108c857506000919050565b6001600160a01b0316331492915050565b600060285b801561094d57600019017f3031323334353637383961626364656600000000000000000000000000000000600f84161a8153601090920491600019017f3031323334353637383961626364656600000000000000000000000000000000600f84161a81536010830492506108de565b50506028600020919050565b6000546001600160a01b031633146105805760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103fe565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461085d57600080fd5b60008060408385031215610a3857600080fd5b8235610a4381610a10565b91506020830135610a5381610a10565b809150509250929050565b600060208284031215610a7057600080fd5b813561025a81610a10565b600080600060608486031215610a9057600080fd5b8335610a9b81610a10565b92506020840135610aab81610a10565b91506040840135610abb81610a10565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610b0657600080fd5b813567ffffffffffffffff80821115610b2157610b21610ac6565b604051601f8301601f19908116603f01168101908282118183101715610b4957610b49610ac6565b81604052838152866020858801011115610b6257600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215610b9857600080fd5b8435610ba381610a10565b93506020850135610bb381610a10565b92506040850135610bc381610a10565b9150606085013567ffffffffffffffff811115610bdf57600080fd5b610beb87828801610af5565b91505092959194509250565b600060208284031215610c0957600080fd5b813567ffffffffffffffff811115610c2057600080fd5b610c2c84828501610af5565b949350505050565b801515811461085d57600080fd5b60008060408385031215610c5557600080fd5b8235610c6081610a10565b91506020830135610a5381610c34565b600060208284031215610c8257600080fd5b815161025a81610c34565b82815260006020604081840152835180604085015260005b81811015610cc157858101830151858201606001528201610ca5565b506000606082860101526060601f19601f830116850101925050509392505050565b600060208284031215610cf557600080fd5b815161025a81610a1056fea2646970667358221220beab0412e54fd175ddb6fc54aabebbad253b933d875cac9f5991b7575afa240764736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "claim(address)": { + "details": "Transfers ownership of the reverse ENS record associated with the calling account.", + "params": { + "owner": "The address to set as the owner of the reverse record in ENS." + }, + "returns": { + "_0": "The ENS node hash of the reverse record." + } + }, + "claimForAddr(address,address,address)": { + "details": "Transfers ownership of the reverse ENS record associated with the calling account.", + "params": { + "addr": "The reverse record to set", + "owner": "The address to set as the owner of the reverse record in ENS.", + "resolver": "The resolver of the reverse node" + }, + "returns": { + "_0": "The ENS node hash of the reverse record." + } + }, + "claimWithResolver(address,address)": { + "details": "Transfers ownership of the reverse ENS record associated with the calling account.", + "params": { + "owner": "The address to set as the owner of the reverse record in ENS.", + "resolver": "The address of the resolver to set; 0 to leave unchanged." + }, + "returns": { + "_0": "The ENS node hash of the reverse record." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "ensAddr": "The address of the ENS registry." + } + }, + "node(address)": { + "details": "Returns the node hash for a given account's reverse records.", + "params": { + "addr": "The address to hash" + }, + "returns": { + "_0": "The ENS node hash." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setName(string)": { + "details": "Sets the `name()` record for the reverse ENS record associated with the calling account. First updates the resolver to the default reverse resolver if necessary.", + "params": { + "name": "The name to set for this address." + }, + "returns": { + "_0": "The ENS node hash of the reverse record." + } + }, + "setNameForAddr(address,address,address,string)": { + "details": "Sets the `name()` record for the reverse ENS record associated with the account provided. Updates the resolver to a designated resolver Only callable by controllers and authorised users", + "params": { + "addr": "The reverse record to set", + "name": "The name to set for this address.", + "owner": "The owner of the reverse node", + "resolver": "The resolver of the reverse node" + }, + "returns": { + "_0": "The ENS node hash of the reverse record." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/reverseRegistrar/ReverseRegistrar.sol:ReverseRegistrar", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 17772, + "contract": "contracts/reverseRegistrar/ReverseRegistrar.sol:ReverseRegistrar", + "label": "controllers", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 17444, + "contract": "contracts/reverseRegistrar/ReverseRegistrar.sol:ReverseRegistrar", + "label": "defaultResolver", + "offset": 0, + "slot": "2", + "type": "t_contract(NameResolver)17426" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(NameResolver)17426": { + "encoding": "inplace", + "label": "contract NameResolver", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/Root.json b/deployments/sepolia/Root.json new file mode 100644 index 00000000..c0296c8d --- /dev/null +++ b/deployments/sepolia/Root.json @@ -0,0 +1,363 @@ +{ + "address": "0xDaaF96c344f63131acadD0Ea35170E7892d3dfBA", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "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": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + } + ], + "name": "TLDLocked", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "controllers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ens", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + } + ], + "name": "lock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "locked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "label", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setSubnodeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe433fa12e9b945a28e43b67f0ce5969d97d88ba81774ee00bb14cd3c3c4a0ec1", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0xDaaF96c344f63131acadD0Ea35170E7892d3dfBA", + "transactionIndex": 103, + "gasUsed": "506765", + "logsBloom": "0x00000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000001000000000000000000000002000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x693b2d9cb2f77de9eb950474d56ebf01169f139beb902ad546aeb01a967dac74", + "transactionHash": "0xe433fa12e9b945a28e43b67f0ce5969d97d88ba81774ee00bb14cd3c3c4a0ec1", + "logs": [ + { + "transactionIndex": 103, + "blockNumber": 3702729, + "transactionHash": "0xe433fa12e9b945a28e43b67f0ce5969d97d88ba81774ee00bb14cd3c3c4a0ec1", + "address": "0xDaaF96c344f63131acadD0Ea35170E7892d3dfBA", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 209, + "blockHash": "0x693b2d9cb2f77de9eb950474d56ebf01169f139beb902ad546aeb01a967dac74" + } + ], + "blockNumber": 3702729, + "cumulativeGasUsed": "9809764", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + ], + "numDeployments": 1, + "solcInputHash": "d9c9257453e2e2db50b4d0f9157288b3", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"label\",\"type\":\"bytes32\"}],\"name\":\"TLDLocked\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"controllers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"label\",\"type\":\"bytes32\"}],\"name\":\"lock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"locked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"label\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setSubnodeOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/root/Root.sol\":\"Root\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1300},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/root/Controllable.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool enabled);\\n\\n modifier onlyController() {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n\\n function setController(address controller, bool enabled) public onlyOwner {\\n controllers[controller] = enabled;\\n emit ControllerChanged(controller, enabled);\\n }\\n}\\n\",\"keccak256\":\"0xb19b8c0fafe9ca2b4bf8aaafee486fa31437672e1e1977bdf84bfe03464969db\"},\"contracts/root/Root.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Controllable.sol\\\";\\n\\ncontract Root is Ownable, Controllable {\\n bytes32 private constant ROOT_NODE = bytes32(0);\\n\\n bytes4 private constant INTERFACE_META_ID =\\n bytes4(keccak256(\\\"supportsInterface(bytes4)\\\"));\\n\\n event TLDLocked(bytes32 indexed label);\\n\\n ENS public ens;\\n mapping(bytes32 => bool) public locked;\\n\\n constructor(ENS _ens) public {\\n ens = _ens;\\n }\\n\\n function setSubnodeOwner(\\n bytes32 label,\\n address owner\\n ) external onlyController {\\n require(!locked[label]);\\n ens.setSubnodeOwner(ROOT_NODE, label, owner);\\n }\\n\\n function setResolver(address resolver) external onlyOwner {\\n ens.setResolver(ROOT_NODE, resolver);\\n }\\n\\n function lock(bytes32 label) external onlyOwner {\\n emit TLDLocked(label);\\n locked[label] = true;\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) external pure returns (bool) {\\n return interfaceID == INTERFACE_META_ID;\\n }\\n}\\n\",\"keccak256\":\"0x469b281e1a9e1c3dad9c860a4ab3a7299a48355b0b0243713e0829193c39f50c\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161084638038061084683398101604081905261002f916100ad565b6100383361005d565b600280546001600160a01b0319166001600160a01b03929092169190911790556100dd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100bf57600080fd5b81516001600160a01b03811681146100d657600080fd5b9392505050565b61075a806100ec6000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80638cb8ecec11610081578063da8c229e1161005b578063da8c229e146101da578063e0dba60f146101fd578063f2fde38b1461021057600080fd5b80638cb8ecec146101935780638da5cb5b146101a6578063cbe9e764146101b757600080fd5b80633f15457f116100b25780633f15457f1461014d5780634e543b2614610178578063715018a61461018b57600080fd5b806301670ba9146100ce57806301ffc9a7146100e3575b600080fd5b6100e16100dc36600461060a565b610223565b005b6101386100f1366004610623565b7fffffffff00000000000000000000000000000000000000000000000000000000167f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b600254610160906001600160a01b031681565b6040516001600160a01b039091168152602001610144565b6100e1610186366004610688565b610271565b6100e16102fb565b6100e16101a13660046106a3565b61030f565b6000546001600160a01b0316610160565b6101386101c536600461060a565b60036020526000908152604090205460ff1681565b6101386101e8366004610688565b60016020526000908152604090205460ff1681565b6100e161020b3660046106cf565b610451565b6100e161021e366004610688565b6104b8565b61022b610548565b60405181907f1764176cfa565853ba1ded547a830a9f9bff95231ef6fd228b3ddd617577756990600090a26000908152600360205260409020805460ff19166001179055565b610279610548565b6002546040517f1896f70a000000000000000000000000000000000000000000000000000000008152600060048201526001600160a01b03838116602483015290911690631896f70a90604401600060405180830381600087803b1580156102e057600080fd5b505af11580156102f4573d6000803e3d6000fd5b5050505050565b610303610548565b61030d60006105a2565b565b3360009081526001602052604090205460ff166103995760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60008281526003602052604090205460ff16156103b557600080fd5b6002546040517f06ab592300000000000000000000000000000000000000000000000000000000815260006004820152602481018490526001600160a01b038381166044830152909116906306ab5923906064016020604051808303816000875af1158015610428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044c919061070b565b505050565b610459610548565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b6104c0610548565b6001600160a01b03811661053c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610390565b610545816105a2565b50565b6000546001600160a01b0316331461030d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610390565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561061c57600080fd5b5035919050565b60006020828403121561063557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461066557600080fd5b9392505050565b80356001600160a01b038116811461068357600080fd5b919050565b60006020828403121561069a57600080fd5b6106658261066c565b600080604083850312156106b657600080fd5b823591506106c66020840161066c565b90509250929050565b600080604083850312156106e257600080fd5b6106eb8361066c565b91506020830135801515811461070057600080fd5b809150509250929050565b60006020828403121561071d57600080fd5b505191905056fea264697066735822122075c1888db9969e60d080343c0cb845ac9b7090b6cf77404f5597731d5717c03a64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80638cb8ecec11610081578063da8c229e1161005b578063da8c229e146101da578063e0dba60f146101fd578063f2fde38b1461021057600080fd5b80638cb8ecec146101935780638da5cb5b146101a6578063cbe9e764146101b757600080fd5b80633f15457f116100b25780633f15457f1461014d5780634e543b2614610178578063715018a61461018b57600080fd5b806301670ba9146100ce57806301ffc9a7146100e3575b600080fd5b6100e16100dc36600461060a565b610223565b005b6101386100f1366004610623565b7fffffffff00000000000000000000000000000000000000000000000000000000167f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b600254610160906001600160a01b031681565b6040516001600160a01b039091168152602001610144565b6100e1610186366004610688565b610271565b6100e16102fb565b6100e16101a13660046106a3565b61030f565b6000546001600160a01b0316610160565b6101386101c536600461060a565b60036020526000908152604090205460ff1681565b6101386101e8366004610688565b60016020526000908152604090205460ff1681565b6100e161020b3660046106cf565b610451565b6100e161021e366004610688565b6104b8565b61022b610548565b60405181907f1764176cfa565853ba1ded547a830a9f9bff95231ef6fd228b3ddd617577756990600090a26000908152600360205260409020805460ff19166001179055565b610279610548565b6002546040517f1896f70a000000000000000000000000000000000000000000000000000000008152600060048201526001600160a01b03838116602483015290911690631896f70a90604401600060405180830381600087803b1580156102e057600080fd5b505af11580156102f4573d6000803e3d6000fd5b5050505050565b610303610548565b61030d60006105a2565b565b3360009081526001602052604090205460ff166103995760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60008281526003602052604090205460ff16156103b557600080fd5b6002546040517f06ab592300000000000000000000000000000000000000000000000000000000815260006004820152602481018490526001600160a01b038381166044830152909116906306ab5923906064016020604051808303816000875af1158015610428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044c919061070b565b505050565b610459610548565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b6104c0610548565b6001600160a01b03811661053c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610390565b610545816105a2565b50565b6000546001600160a01b0316331461030d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610390565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561061c57600080fd5b5035919050565b60006020828403121561063557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461066557600080fd5b9392505050565b80356001600160a01b038116811461068357600080fd5b919050565b60006020828403121561069a57600080fd5b6106658261066c565b600080604083850312156106b657600080fd5b823591506106c66020840161066c565b90509250929050565b600080604083850312156106e257600080fd5b6106eb8361066c565b91506020830135801515811461070057600080fd5b809150509250929050565b60006020828403121561071d57600080fd5b505191905056fea264697066735822122075c1888db9969e60d080343c0cb845ac9b7090b6cf77404f5597731d5717c03a64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/root/Root.sol:Root", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 17772, + "contract": "contracts/root/Root.sol:Root", + "label": "controllers", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 17902, + "contract": "contracts/root/Root.sol:Root", + "label": "ens", + "offset": 0, + "slot": "2", + "type": "t_contract(ENS)14086" + }, + { + "astId": 17906, + "contract": "contracts/root/Root.sol:Root", + "label": "locked", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(ENS)14086": { + "encoding": "inplace", + "label": "contract ENS", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/StaticBulkRenewal.json b/deployments/sepolia/StaticBulkRenewal.json new file mode 100644 index 00000000..e88244e8 --- /dev/null +++ b/deployments/sepolia/StaticBulkRenewal.json @@ -0,0 +1,130 @@ +{ + "address": "0x4EF77b90762Eddb33C8Eba5B5a19558DaE53D7a1", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ETHRegistrarController", + "name": "_controller", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "names", + "type": "string[]" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "renewAll", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "names", + "type": "string[]" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "rentPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0x25fed620ee97bb93ba94b97b4670eac8ebf4347c6a3a49809a968de63fded854", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x4EF77b90762Eddb33C8Eba5B5a19558DaE53D7a1", + "transactionIndex": 45, + "gasUsed": "396872", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x15ca0a028e68b6f72d21a463cc6e03304c007b46e42fe4fb8bc2e92fdc85165e", + "transactionHash": "0x25fed620ee97bb93ba94b97b4670eac8ebf4347c6a3a49809a968de63fded854", + "logs": [], + "blockNumber": 3914901, + "cumulativeGasUsed": "12909136", + "status": 1, + "byzantium": true + }, + "args": [ + "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ETHRegistrarController\",\"name\":\"_controller\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"names\",\"type\":\"string[]\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"renewAll\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"names\",\"type\":\"string[]\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"rentPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ethregistrar/StaticBulkRenewal.sol\":\"StaticBulkRenewal\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC721.sol\\\";\\nimport \\\"./IERC721Receiver.sol\\\";\\nimport \\\"./extensions/IERC721Metadata.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/Strings.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\\n using Address for address;\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n // Mapping from token ID to owner address\\n mapping(uint256 => address) private _owners;\\n\\n // Mapping owner address to token count\\n mapping(address => uint256) private _balances;\\n\\n // Mapping from token ID to approved address\\n mapping(uint256 => address) private _tokenApprovals;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual override returns (uint256) {\\n require(owner != address(0), \\\"ERC721: address zero is not a valid owner\\\");\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\\n address owner = _ownerOf(tokenId);\\n require(owner != address(0), \\\"ERC721: invalid token ID\\\");\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireMinted(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual override {\\n address owner = ERC721.ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\\n _requireMinted(tokenId);\\n\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n //solhint-disable-next-line max-line-length\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n\\n _transfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public virtual override {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) public virtual override {\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n _safeTransfer(from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _transfer(from, to, tokenId);\\n require(_checkOnERC721Received(from, to, tokenId, data), \\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `tokenId` exists.\\n *\\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\\n *\\n * Tokens start existing when they are minted (`_mint`),\\n * and stop existing when they are burned (`_burn`).\\n */\\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\\n return _ownerOf(tokenId) != address(0);\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Safely mints `tokenId` and transfers it to `to`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal virtual {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal virtual {\\n _mint(to, tokenId);\\n require(\\n _checkOnERC721Received(address(0), to, tokenId, data),\\n \\\"ERC721: transfer to non ERC721Receiver implementer\\\"\\n );\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal virtual {\\n require(to != address(0), \\\"ERC721: mint to the zero address\\\");\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n _beforeTokenTransfer(address(0), to, tokenId, 1);\\n\\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n unchecked {\\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\\n // Given that tokens are minted one by one, it is impossible in practice that\\n // this ever happens. Might change if we allow batch minting.\\n // The ERC fails to describe this case.\\n _balances[to] += 1;\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal virtual {\\n address owner = ERC721.ownerOf(tokenId);\\n\\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\\n\\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\\n owner = ERC721.ownerOf(tokenId);\\n\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // Cannot overflow, as that would require more tokens to be burned/transferred\\n // out than the owner initially received through minting and transferring in.\\n _balances[owner] -= 1;\\n }\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId, 1);\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 tokenId\\n ) internal virtual {\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n require(to != address(0), \\\"ERC721: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, tokenId, 1);\\n\\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n\\n // Clear approvals from the previous owner\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\\n // `from`'s balance is the number of token held, which is at least one before the current\\n // transfer.\\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\\n // all 2**256 token ids to be minted, which in practice is impossible.\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n }\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC721: approve to caller\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` has not been minted yet.\\n */\\n function _requireMinted(uint256 tokenId) internal view virtual {\\n require(_exists(tokenId), \\\"ERC721: invalid token ID\\\");\\n }\\n\\n /**\\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\\n * The call is not executed if the target address is not a contract.\\n *\\n * @param from address representing the previous owner of the given token ID\\n * @param to target address that will receive the tokens\\n * @param tokenId uint256 ID of the token to be transferred\\n * @param data bytes optional data to send along with the call\\n * @return bool whether the call correctly returned the expected magic value\\n */\\n function _checkOnERC721Received(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) private returns (bool) {\\n if (to.isContract()) {\\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\\n return retval == IERC721Receiver.onERC721Received.selector;\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n revert(\\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n } else {\\n /// @solidity memory-safe-assembly\\n assembly {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n } else {\\n return true;\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\\n * - When `from` is zero, the tokens will be minted for `to`.\\n * - When `to` is zero, ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256, /* firstTokenId */\\n uint256 batchSize\\n ) internal virtual {\\n if (batchSize > 1) {\\n if (from != address(0)) {\\n _balances[from] -= batchSize;\\n }\\n if (to != address(0)) {\\n _balances[to] += batchSize;\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\\n * - When `from` is zero, the tokens were minted for `to`.\\n * - When `to` is zero, ``from``'s tokens were burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 firstTokenId,\\n uint256 batchSize\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xd89f3585b211fc9e3408384a4c4efdc3a93b2f877a3821046fa01c219d35be1b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x75b829ff2f26c14355d1cba20e16fe7b29ca58eb5fef665ede48bc0f9c6c74b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/ethregistrar/BaseRegistrarImplementation.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable {\\n // A map of expiry times\\n mapping(uint256 => uint256) expiries;\\n // The ENS registry\\n ENS public ens;\\n // The namehash of the TLD this registrar owns (eg, .eth)\\n bytes32 public baseNode;\\n // A map of addresses that are authorised to register and renew names.\\n mapping(address => bool) public controllers;\\n uint256 public constant GRACE_PERIOD = 90 days;\\n bytes4 private constant INTERFACE_META_ID =\\n bytes4(keccak256(\\\"supportsInterface(bytes4)\\\"));\\n bytes4 private constant ERC721_ID =\\n bytes4(\\n keccak256(\\\"balanceOf(address)\\\") ^\\n keccak256(\\\"ownerOf(uint256)\\\") ^\\n keccak256(\\\"approve(address,uint256)\\\") ^\\n keccak256(\\\"getApproved(uint256)\\\") ^\\n keccak256(\\\"setApprovalForAll(address,bool)\\\") ^\\n keccak256(\\\"isApprovedForAll(address,address)\\\") ^\\n keccak256(\\\"transferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256)\\\") ^\\n keccak256(\\\"safeTransferFrom(address,address,uint256,bytes)\\\")\\n );\\n bytes4 private constant RECLAIM_ID =\\n bytes4(keccak256(\\\"reclaim(uint256,address)\\\"));\\n\\n /**\\n * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);\\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187\\n * @dev Returns whether the given spender can transfer a given token ID\\n * @param spender address of the spender to query\\n * @param tokenId uint256 ID of the token to be transferred\\n * @return bool whether the msg.sender is approved for the given token ID,\\n * is an operator of the owner, or is the owner of the token\\n */\\n function _isApprovedOrOwner(\\n address spender,\\n uint256 tokenId\\n ) internal view override returns (bool) {\\n address owner = ownerOf(tokenId);\\n return (spender == owner ||\\n getApproved(tokenId) == spender ||\\n isApprovedForAll(owner, spender));\\n }\\n\\n constructor(ENS _ens, bytes32 _baseNode) ERC721(\\\"\\\", \\\"\\\") {\\n ens = _ens;\\n baseNode = _baseNode;\\n }\\n\\n modifier live() {\\n require(ens.owner(baseNode) == address(this));\\n _;\\n }\\n\\n modifier onlyController() {\\n require(controllers[msg.sender]);\\n _;\\n }\\n\\n /**\\n * @dev Gets the owner of the specified token ID. Names become unowned\\n * when their registration expires.\\n * @param tokenId uint256 ID of the token to query the owner of\\n * @return address currently marked as the owner of the given token ID\\n */\\n function ownerOf(\\n uint256 tokenId\\n ) public view override(IERC721, ERC721) returns (address) {\\n require(expiries[tokenId] > block.timestamp);\\n return super.ownerOf(tokenId);\\n }\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external override onlyOwner {\\n controllers[controller] = true;\\n emit ControllerAdded(controller);\\n }\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external override onlyOwner {\\n controllers[controller] = false;\\n emit ControllerRemoved(controller);\\n }\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external override onlyOwner {\\n ens.setResolver(baseNode, resolver);\\n }\\n\\n // Returns the expiration timestamp of the specified id.\\n function nameExpires(uint256 id) external view override returns (uint256) {\\n return expiries[id];\\n }\\n\\n // Returns true iff the specified name is available for registration.\\n function available(uint256 id) public view override returns (bool) {\\n // Not available if it's registered here or in its grace period.\\n return expiries[id] + GRACE_PERIOD < block.timestamp;\\n }\\n\\n /**\\n * @dev Register a name.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external override returns (uint256) {\\n return _register(id, owner, duration, true);\\n }\\n\\n /**\\n * @dev Register a name, without modifying the registry.\\n * @param id The token ID (keccak256 of the label).\\n * @param owner The address that should own the registration.\\n * @param duration Duration in seconds for the registration.\\n */\\n function registerOnly(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256) {\\n return _register(id, owner, duration, false);\\n }\\n\\n function _register(\\n uint256 id,\\n address owner,\\n uint256 duration,\\n bool updateRegistry\\n ) internal live onlyController returns (uint256) {\\n require(available(id));\\n require(\\n block.timestamp + duration + GRACE_PERIOD >\\n block.timestamp + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] = block.timestamp + duration;\\n if (_exists(id)) {\\n // Name was previously owned, and expired\\n _burn(id);\\n }\\n _mint(owner, id);\\n if (updateRegistry) {\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n emit NameRegistered(id, owner, block.timestamp + duration);\\n\\n return block.timestamp + duration;\\n }\\n\\n function renew(\\n uint256 id,\\n uint256 duration\\n ) external override live onlyController returns (uint256) {\\n require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period\\n require(\\n expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\\n ); // Prevent future overflow\\n\\n expiries[id] += duration;\\n emit NameRenewed(id, expiries[id]);\\n return expiries[id];\\n }\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external override live {\\n require(_isApprovedOrOwner(msg.sender, id));\\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) public view override(ERC721, IERC165) returns (bool) {\\n return\\n interfaceID == INTERFACE_META_ID ||\\n interfaceID == ERC721_ID ||\\n interfaceID == RECLAIM_ID;\\n }\\n}\\n\",\"keccak256\":\"0xaee6eb36aead449d397b86a02e9c63bc46e3ef378d0a62bfd68beaae1150c9d0\"},\"contracts/ethregistrar/ETHRegistrarController.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport {BaseRegistrarImplementation} from \\\"./BaseRegistrarImplementation.sol\\\";\\nimport {StringUtils} from \\\"./StringUtils.sol\\\";\\nimport {Resolver} from \\\"../resolvers/Resolver.sol\\\";\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {ReverseRegistrar} from \\\"../reverseRegistrar/ReverseRegistrar.sol\\\";\\nimport {ReverseClaimer} from \\\"../reverseRegistrar/ReverseClaimer.sol\\\";\\nimport {IETHRegistrarController, IPriceOracle} from \\\"./IETHRegistrarController.sol\\\";\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {IERC165} from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {INameWrapper} from \\\"../wrapper/INameWrapper.sol\\\";\\nimport {ERC20Recoverable} from \\\"../utils/ERC20Recoverable.sol\\\";\\n\\nerror CommitmentTooNew(bytes32 commitment);\\nerror CommitmentTooOld(bytes32 commitment);\\nerror NameNotAvailable(string name);\\nerror DurationTooShort(uint256 duration);\\nerror ResolverRequiredWhenDataSupplied();\\nerror UnexpiredCommitmentExists(bytes32 commitment);\\nerror InsufficientValue();\\nerror Unauthorised(bytes32 node);\\nerror MaxCommitmentAgeTooLow();\\nerror MaxCommitmentAgeTooHigh();\\n\\n/**\\n * @dev A registrar controller for registering and renewing names at fixed cost.\\n */\\ncontract ETHRegistrarController is\\n Ownable,\\n IETHRegistrarController,\\n IERC165,\\n ERC20Recoverable,\\n ReverseClaimer\\n{\\n using StringUtils for *;\\n using Address for address;\\n\\n uint256 public constant MIN_REGISTRATION_DURATION = 28 days;\\n bytes32 private constant ETH_NODE =\\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\\n uint64 private constant MAX_EXPIRY = type(uint64).max;\\n BaseRegistrarImplementation immutable base;\\n IPriceOracle public immutable prices;\\n uint256 public immutable minCommitmentAge;\\n uint256 public immutable maxCommitmentAge;\\n ReverseRegistrar public immutable reverseRegistrar;\\n INameWrapper public immutable nameWrapper;\\n\\n mapping(bytes32 => uint256) public commitments;\\n\\n event NameRegistered(\\n string name,\\n bytes32 indexed label,\\n address indexed owner,\\n uint256 baseCost,\\n uint256 premium,\\n uint256 expires\\n );\\n event NameRenewed(\\n string name,\\n bytes32 indexed label,\\n uint256 cost,\\n uint256 expires\\n );\\n\\n constructor(\\n BaseRegistrarImplementation _base,\\n IPriceOracle _prices,\\n uint256 _minCommitmentAge,\\n uint256 _maxCommitmentAge,\\n ReverseRegistrar _reverseRegistrar,\\n INameWrapper _nameWrapper,\\n ENS _ens\\n ) ReverseClaimer(_ens, msg.sender) {\\n if (_maxCommitmentAge <= _minCommitmentAge) {\\n revert MaxCommitmentAgeTooLow();\\n }\\n\\n if (_maxCommitmentAge > block.timestamp) {\\n revert MaxCommitmentAgeTooHigh();\\n }\\n\\n base = _base;\\n prices = _prices;\\n minCommitmentAge = _minCommitmentAge;\\n maxCommitmentAge = _maxCommitmentAge;\\n reverseRegistrar = _reverseRegistrar;\\n nameWrapper = _nameWrapper;\\n }\\n\\n function rentPrice(\\n string memory name,\\n uint256 duration\\n ) public view override returns (IPriceOracle.Price memory price) {\\n bytes32 label = keccak256(bytes(name));\\n price = prices.price(name, base.nameExpires(uint256(label)), duration);\\n }\\n\\n function valid(string memory name) public pure returns (bool) {\\n return name.strlen() >= 3;\\n }\\n\\n function available(string memory name) public view override returns (bool) {\\n bytes32 label = keccak256(bytes(name));\\n return valid(name) && base.available(uint256(label));\\n }\\n\\n function makeCommitment(\\n string memory name,\\n address owner,\\n uint256 duration,\\n bytes32 secret,\\n address resolver,\\n bytes[] calldata data,\\n bool reverseRecord,\\n uint16 ownerControlledFuses\\n ) public pure override returns (bytes32) {\\n bytes32 label = keccak256(bytes(name));\\n if (data.length > 0 && resolver == address(0)) {\\n revert ResolverRequiredWhenDataSupplied();\\n }\\n return\\n keccak256(\\n abi.encode(\\n label,\\n owner,\\n duration,\\n secret,\\n resolver,\\n data,\\n reverseRecord,\\n ownerControlledFuses\\n )\\n );\\n }\\n\\n function commit(bytes32 commitment) public override {\\n if (commitments[commitment] + maxCommitmentAge >= block.timestamp) {\\n revert UnexpiredCommitmentExists(commitment);\\n }\\n commitments[commitment] = block.timestamp;\\n }\\n\\n function register(\\n string calldata name,\\n address owner,\\n uint256 duration,\\n bytes32 secret,\\n address resolver,\\n bytes[] calldata data,\\n bool reverseRecord,\\n uint16 ownerControlledFuses\\n ) public payable override {\\n IPriceOracle.Price memory price = rentPrice(name, duration);\\n if (msg.value < price.base + price.premium) {\\n revert InsufficientValue();\\n }\\n\\n _consumeCommitment(\\n name,\\n duration,\\n makeCommitment(\\n name,\\n owner,\\n duration,\\n secret,\\n resolver,\\n data,\\n reverseRecord,\\n ownerControlledFuses\\n )\\n );\\n\\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\\n name,\\n owner,\\n duration,\\n resolver,\\n ownerControlledFuses\\n );\\n\\n if (data.length > 0) {\\n _setRecords(resolver, keccak256(bytes(name)), data);\\n }\\n\\n if (reverseRecord) {\\n _setReverseRecord(name, resolver, msg.sender);\\n }\\n\\n emit NameRegistered(\\n name,\\n keccak256(bytes(name)),\\n owner,\\n price.base,\\n price.premium,\\n expires\\n );\\n\\n if (msg.value > (price.base + price.premium)) {\\n payable(msg.sender).transfer(\\n msg.value - (price.base + price.premium)\\n );\\n }\\n }\\n\\n function renew(\\n string calldata name,\\n uint256 duration\\n ) external payable override {\\n bytes32 labelhash = keccak256(bytes(name));\\n uint256 tokenId = uint256(labelhash);\\n IPriceOracle.Price memory price = rentPrice(name, duration);\\n if (msg.value < price.base) {\\n revert InsufficientValue();\\n }\\n uint256 expires = nameWrapper.renew(tokenId, duration);\\n\\n if (msg.value > price.base) {\\n payable(msg.sender).transfer(msg.value - price.base);\\n }\\n\\n emit NameRenewed(name, labelhash, msg.value, expires);\\n }\\n\\n function withdraw() public {\\n payable(owner()).transfer(address(this).balance);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) external pure returns (bool) {\\n return\\n interfaceID == type(IERC165).interfaceId ||\\n interfaceID == type(IETHRegistrarController).interfaceId;\\n }\\n\\n /* Internal functions */\\n\\n function _consumeCommitment(\\n string memory name,\\n uint256 duration,\\n bytes32 commitment\\n ) internal {\\n // Require an old enough commitment.\\n if (commitments[commitment] + minCommitmentAge > block.timestamp) {\\n revert CommitmentTooNew(commitment);\\n }\\n\\n // If the commitment is too old, or the name is registered, stop\\n if (commitments[commitment] + maxCommitmentAge <= block.timestamp) {\\n revert CommitmentTooOld(commitment);\\n }\\n if (!available(name)) {\\n revert NameNotAvailable(name);\\n }\\n\\n delete (commitments[commitment]);\\n\\n if (duration < MIN_REGISTRATION_DURATION) {\\n revert DurationTooShort(duration);\\n }\\n }\\n\\n function _setRecords(\\n address resolverAddress,\\n bytes32 label,\\n bytes[] calldata data\\n ) internal {\\n // use hardcoded .eth namehash\\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, label));\\n Resolver resolver = Resolver(resolverAddress);\\n resolver.multicallWithNodeCheck(nodehash, data);\\n }\\n\\n function _setReverseRecord(\\n string memory name,\\n address resolver,\\n address owner\\n ) internal {\\n reverseRegistrar.setNameForAddr(\\n msg.sender,\\n owner,\\n resolver,\\n string.concat(name, \\\".eth\\\")\\n );\\n }\\n}\\n\",\"keccak256\":\"0x2ba2cab655f9128ae5c803540b8712be9bdfee1a28b9623a06c02c2435d0ce8b\",\"license\":\"MIT\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/ethregistrar/IBulkRenewal.sol\":{\"content\":\"interface IBulkRenewal {\\n function rentPrice(\\n string[] calldata names,\\n uint256 duration\\n ) external view returns (uint256 total);\\n\\n function renewAll(\\n string[] calldata names,\\n uint256 duration\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x45d72e0464af5165831210496cd293cc7ceeb7307f2bdad679f64613a6bcf029\"},\"contracts/ethregistrar/IETHRegistrarController.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./IPriceOracle.sol\\\";\\n\\ninterface IETHRegistrarController {\\n function rentPrice(\\n string memory,\\n uint256\\n ) external view returns (IPriceOracle.Price memory);\\n\\n function available(string memory) external returns (bool);\\n\\n function makeCommitment(\\n string memory,\\n address,\\n uint256,\\n bytes32,\\n address,\\n bytes[] calldata,\\n bool,\\n uint16\\n ) external pure returns (bytes32);\\n\\n function commit(bytes32) external;\\n\\n function register(\\n string calldata,\\n address,\\n uint256,\\n bytes32,\\n address,\\n bytes[] calldata,\\n bool,\\n uint16\\n ) external payable;\\n\\n function renew(string calldata, uint256) external payable;\\n}\\n\",\"keccak256\":\"0x54575cc2e4245c0ba79e42a58086335ec0522f4cbeb8c92d71b886593c97060e\",\"license\":\"MIT\"},\"contracts/ethregistrar/IPriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\ninterface IPriceOracle {\\n struct Price {\\n uint256 base;\\n uint256 premium;\\n }\\n\\n /**\\n * @dev Returns the price to register or renew a name.\\n * @param name The name being registered or renewed.\\n * @param expires When the name presently expires (0 if this is a new registration).\\n * @param duration How long the name is being registered or extended for, in seconds.\\n * @return base premium tuple of base price + premium price\\n */\\n function price(\\n string calldata name,\\n uint256 expires,\\n uint256 duration\\n ) external view returns (Price calldata);\\n}\\n\",\"keccak256\":\"0x1ec537b4c7f9cc40363b39dcc7ade8c29bf94662e6b01d38e681487637bd577e\",\"license\":\"MIT\"},\"contracts/ethregistrar/StaticBulkRenewal.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./ETHRegistrarController.sol\\\";\\nimport \\\"./IBulkRenewal.sol\\\";\\nimport \\\"./IPriceOracle.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\ncontract StaticBulkRenewal is IBulkRenewal {\\n ETHRegistrarController controller;\\n\\n constructor(ETHRegistrarController _controller) {\\n controller = _controller;\\n }\\n\\n function rentPrice(\\n string[] calldata names,\\n uint256 duration\\n ) external view override returns (uint256 total) {\\n uint256 length = names.length;\\n for (uint256 i = 0; i < length; ) {\\n IPriceOracle.Price memory price = controller.rentPrice(\\n names[i],\\n duration\\n );\\n unchecked {\\n ++i;\\n total += (price.base + price.premium);\\n }\\n }\\n }\\n\\n function renewAll(\\n string[] calldata names,\\n uint256 duration\\n ) external payable override {\\n uint256 length = names.length;\\n uint256 total;\\n for (uint256 i = 0; i < length; ) {\\n IPriceOracle.Price memory price = controller.rentPrice(\\n names[i],\\n duration\\n );\\n uint256 totalPrice = price.base + price.premium;\\n controller.renew{value: totalPrice}(names[i], duration);\\n unchecked {\\n ++i;\\n total += totalPrice;\\n }\\n }\\n // Send any excess funds back\\n payable(msg.sender).transfer(address(this).balance);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceID\\n ) external pure returns (bool) {\\n return\\n interfaceID == type(IERC165).interfaceId ||\\n interfaceID == type(IBulkRenewal).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xa4c30f4d395dec3d252e8b9e46710fe38038cfdc3e33a3bdd0ea54e046e91f48\",\"license\":\"MIT\"},\"contracts/ethregistrar/StringUtils.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nlibrary StringUtils {\\n /**\\n * @dev Returns the length of a given string\\n *\\n * @param s The string to measure the length of\\n * @return The length of the input string\\n */\\n function strlen(string memory s) internal pure returns (uint256) {\\n uint256 len;\\n uint256 i = 0;\\n uint256 bytelength = bytes(s).length;\\n for (len = 0; i < bytelength; len++) {\\n bytes1 b = bytes(s)[i];\\n if (b < 0x80) {\\n i += 1;\\n } else if (b < 0xE0) {\\n i += 2;\\n } else if (b < 0xF0) {\\n i += 3;\\n } else if (b < 0xF8) {\\n i += 4;\\n } else if (b < 0xFC) {\\n i += 5;\\n } else {\\n i += 6;\\n }\\n }\\n return len;\\n }\\n}\\n\",\"keccak256\":\"0x4cc8363a850dc9130c433ee50e7c97e29a45ae5d9bd0808205ac7134b34f24e4\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/resolvers/Resolver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"./profiles/IABIResolver.sol\\\";\\nimport \\\"./profiles/IAddressResolver.sol\\\";\\nimport \\\"./profiles/IAddrResolver.sol\\\";\\nimport \\\"./profiles/IContentHashResolver.sol\\\";\\nimport \\\"./profiles/IDNSRecordResolver.sol\\\";\\nimport \\\"./profiles/IDNSZoneResolver.sol\\\";\\nimport \\\"./profiles/IInterfaceResolver.sol\\\";\\nimport \\\"./profiles/INameResolver.sol\\\";\\nimport \\\"./profiles/IPubkeyResolver.sol\\\";\\nimport \\\"./profiles/ITextResolver.sol\\\";\\nimport \\\"./profiles/IExtendedResolver.sol\\\";\\n\\n/**\\n * A generic resolver interface which includes all the functions including the ones deprecated\\n */\\ninterface Resolver is\\n IERC165,\\n IABIResolver,\\n IAddressResolver,\\n IAddrResolver,\\n IContentHashResolver,\\n IDNSRecordResolver,\\n IDNSZoneResolver,\\n IInterfaceResolver,\\n INameResolver,\\n IPubkeyResolver,\\n ITextResolver,\\n IExtendedResolver\\n{\\n /* Deprecated events */\\n event ContentChanged(bytes32 indexed node, bytes32 hash);\\n\\n function setApprovalForAll(address, bool) external;\\n\\n function approve(bytes32 node, address delegate, bool approved) external;\\n\\n function isApprovedForAll(address account, address operator) external;\\n\\n function isApprovedFor(\\n address owner,\\n bytes32 node,\\n address delegate\\n ) external;\\n\\n function setABI(\\n bytes32 node,\\n uint256 contentType,\\n bytes calldata data\\n ) external;\\n\\n function setAddr(bytes32 node, address addr) external;\\n\\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\\n\\n function setContenthash(bytes32 node, bytes calldata hash) external;\\n\\n function setDnsrr(bytes32 node, bytes calldata data) external;\\n\\n function setName(bytes32 node, string calldata _name) external;\\n\\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\\n\\n function setText(\\n bytes32 node,\\n string calldata key,\\n string calldata value\\n ) external;\\n\\n function setInterface(\\n bytes32 node,\\n bytes4 interfaceID,\\n address implementer\\n ) external;\\n\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(\\n bytes32 nodehash,\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n /* Deprecated functions */\\n function content(bytes32 node) external view returns (bytes32);\\n\\n function multihash(bytes32 node) external view returns (bytes memory);\\n\\n function setContent(bytes32 node, bytes32 hash) external;\\n\\n function setMultihash(bytes32 node, bytes calldata hash) external;\\n}\\n\",\"keccak256\":\"0xfc77ab6b7c59c3ebfe1c720bdebf9b08c2488ff7ac9501a9aa056c5d6d5b50c5\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IABIResolver {\\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0x85b373d02d19374fe570af407f459768285704bf7f30ab17c30eabfb5a10e4c3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the legacy (ETH-only) addr function.\\n */\\ninterface IAddrResolver {\\n event AddrChanged(bytes32 indexed node, address a);\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0x2ad7f2fc60ebe0f93745fe70247f6a854f66af732483fda2a3c5e055614445e8\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the new (multicoin) addr function.\\n */\\ninterface IAddressResolver {\\n event AddressChanged(\\n bytes32 indexed node,\\n uint256 coinType,\\n bytes newAddress\\n );\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x411447c1e90c51e09702815a85ec725ffbbe37cf96e8cc4d2a8bd4ad8a59d73e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IContentHashResolver {\\n event ContenthashChanged(bytes32 indexed node, bytes hash);\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xd95cd77684ba5752c428d7dceb4ecc6506ac94f4fbb910489637eb68dcd8e366\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSRecordResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSRecordResolver {\\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\\n event DNSRecordChanged(\\n bytes32 indexed node,\\n bytes name,\\n uint16 resource,\\n bytes record\\n );\\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xcfa52200edd337f2c6c5bf402352600584da033b21323603e53de33051a3e25d\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSZoneResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSZoneResolver {\\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\\n event DNSZonehashChanged(\\n bytes32 indexed node,\\n bytes lastzonehash,\\n bytes zonehash\\n );\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xca1b3a16e7005533f2800a3e66fcdccf7c574deac7913d8c810f40aec1d58dc0\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IExtendedResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ninterface IExtendedResolver {\\n function resolve(\\n bytes memory name,\\n bytes memory data\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x5d81521cfae7d9a4475d27533cd8ed0d3475d369eb0674fd90ffbdbdf292faa3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IInterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IInterfaceResolver {\\n event InterfaceChanged(\\n bytes32 indexed node,\\n bytes4 indexed interfaceID,\\n address implementer\\n );\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view returns (address);\\n}\\n\",\"keccak256\":\"0x390321fb58f7b927df9562450981e74b4be3907e7c09df321fd3b7409b63ae28\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/INameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface INameResolver {\\n event NameChanged(bytes32 indexed node, string name);\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(bytes32 node) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x9ec392b612447b1acbdc01114f2da2837a658d3f3157f60a99c5269f0b623346\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IPubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IPubkeyResolver {\\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\\n}\\n\",\"keccak256\":\"0x69748947093dd2fda9ddcebd0adf19a6d1e7600df1d4b1462a0417156caddca7\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ITextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface ITextResolver {\\n event TextChanged(\\n bytes32 indexed node,\\n string indexed indexedKey,\\n string key,\\n string value\\n );\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x7c5debb3c42cd9f5de2274ea7aa053f238608314b62db441c40e31cea2543fd5\",\"license\":\"MIT\"},\"contracts/reverseRegistrar/IReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface IReverseRegistrar {\\n function setDefaultResolver(address resolver) external;\\n\\n function claim(address owner) external returns (bytes32);\\n\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) external returns (bytes32);\\n\\n function setName(string memory name) external returns (bytes32);\\n\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) external returns (bytes32);\\n\\n function node(address addr) external pure returns (bytes32);\\n}\\n\",\"keccak256\":\"0x83adfcf6da72b1bcd1e3ac387afe5fc7fdf7f2ac28b7601544d2ca4b9d45d159\"},\"contracts/reverseRegistrar/ReverseClaimer.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IReverseRegistrar} from \\\"../reverseRegistrar/IReverseRegistrar.sol\\\";\\n\\ncontract ReverseClaimer {\\n bytes32 constant ADDR_REVERSE_NODE =\\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n constructor(ENS ens, address claimant) {\\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\\n ens.owner(ADDR_REVERSE_NODE)\\n );\\n reverseRegistrar.claim(claimant);\\n }\\n}\\n\",\"keccak256\":\"0x78a28627241535b595f6fff476a1fa7acc90c80684fe7784734920fc8af6fc22\",\"license\":\"MIT\"},\"contracts/reverseRegistrar/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"./IReverseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../root/Controllable.sol\\\";\\n\\nabstract contract NameResolver {\\n function setName(bytes32 node, string memory name) public virtual;\\n}\\n\\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\\n\\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\\n\\n// namehash('addr.reverse')\\n\\ncontract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar {\\n ENS public immutable ens;\\n NameResolver public defaultResolver;\\n\\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\\n event DefaultResolverChanged(NameResolver indexed resolver);\\n\\n /**\\n * @dev Constructor\\n * @param ensAddr The address of the ENS registry.\\n */\\n constructor(ENS ensAddr) {\\n ens = ensAddr;\\n\\n // Assign ownership of the reverse record to our deployer\\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\\n ensAddr.owner(ADDR_REVERSE_NODE)\\n );\\n if (address(oldRegistrar) != address(0x0)) {\\n oldRegistrar.claim(msg.sender);\\n }\\n }\\n\\n modifier authorised(address addr) {\\n require(\\n addr == msg.sender ||\\n controllers[msg.sender] ||\\n ens.isApprovedForAll(addr, msg.sender) ||\\n ownsContract(addr),\\n \\\"ReverseRegistrar: Caller is not a controller or authorised by address or the address itself\\\"\\n );\\n _;\\n }\\n\\n function setDefaultResolver(address resolver) public override onlyOwner {\\n require(\\n address(resolver) != address(0),\\n \\\"ReverseRegistrar: Resolver address must not be 0\\\"\\n );\\n defaultResolver = NameResolver(resolver);\\n emit DefaultResolverChanged(NameResolver(resolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claim(address owner) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, address(defaultResolver));\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param addr The reverse record to set\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The resolver of the reverse node\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimForAddr(\\n address addr,\\n address owner,\\n address resolver\\n ) public override authorised(addr) returns (bytes32) {\\n bytes32 labelHash = sha3HexAddress(addr);\\n bytes32 reverseNode = keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, labelHash)\\n );\\n emit ReverseClaimed(addr, reverseNode);\\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0);\\n return reverseNode;\\n }\\n\\n /**\\n * @dev Transfers ownership of the reverse ENS record associated with the\\n * calling account.\\n * @param owner The address to set as the owner of the reverse record in ENS.\\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\\n * @return The ENS node hash of the reverse record.\\n */\\n function claimWithResolver(\\n address owner,\\n address resolver\\n ) public override returns (bytes32) {\\n return claimForAddr(msg.sender, owner, resolver);\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the calling account. First updates the resolver to the default reverse\\n * resolver if necessary.\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setName(string memory name) public override returns (bytes32) {\\n return\\n setNameForAddr(\\n msg.sender,\\n msg.sender,\\n address(defaultResolver),\\n name\\n );\\n }\\n\\n /**\\n * @dev Sets the `name()` record for the reverse ENS record associated with\\n * the account provided. Updates the resolver to a designated resolver\\n * Only callable by controllers and authorised users\\n * @param addr The reverse record to set\\n * @param owner The owner of the reverse node\\n * @param resolver The resolver of the reverse node\\n * @param name The name to set for this address.\\n * @return The ENS node hash of the reverse record.\\n */\\n function setNameForAddr(\\n address addr,\\n address owner,\\n address resolver,\\n string memory name\\n ) public override returns (bytes32) {\\n bytes32 node = claimForAddr(addr, owner, resolver);\\n NameResolver(resolver).setName(node, name);\\n return node;\\n }\\n\\n /**\\n * @dev Returns the node hash for a given account's reverse records.\\n * @param addr The address to hash\\n * @return The ENS node hash.\\n */\\n function node(address addr) public pure override returns (bytes32) {\\n return\\n keccak256(\\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\\n );\\n }\\n\\n /**\\n * @dev An optimised function to compute the sha3 of the lower-case\\n * hexadecimal representation of an Ethereum address.\\n * @param addr The address to hash\\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\\n * input address.\\n */\\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\\n assembly {\\n for {\\n let i := 40\\n } gt(i, 0) {\\n\\n } {\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n i := sub(i, 1)\\n mstore8(i, byte(and(addr, 0xf), lookup))\\n addr := div(addr, 0x10)\\n }\\n\\n ret := keccak256(0, 40)\\n }\\n }\\n\\n function ownsContract(address addr) internal view returns (bool) {\\n try Ownable(addr).owner() returns (address owner) {\\n return owner == msg.sender;\\n } catch {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd57d28e5791b4b44650a00f5ef6c725af53698ec33faeeaa3591f0dbd939559a\"},\"contracts/root/Controllable.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract Controllable is Ownable {\\n mapping(address => bool) public controllers;\\n\\n event ControllerChanged(address indexed controller, bool enabled);\\n\\n modifier onlyController() {\\n require(\\n controllers[msg.sender],\\n \\\"Controllable: Caller is not a controller\\\"\\n );\\n _;\\n }\\n\\n function setController(address controller, bool enabled) public onlyOwner {\\n controllers[controller] = enabled;\\n emit ControllerChanged(controller, enabled);\\n }\\n}\\n\",\"keccak256\":\"0xb19b8c0fafe9ca2b4bf8aaafee486fa31437672e1e1977bdf84bfe03464969db\"},\"contracts/utils/ERC20Recoverable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.\\n */\\n\\ncontract ERC20Recoverable is Ownable {\\n /**\\n @notice Recover ERC20 tokens sent to the contract by mistake.\\n @dev The contract is Ownable and only the owner can call the recover function.\\n @param _to The address to send the tokens to.\\n@param _token The address of the ERC20 token to recover\\n @param _amount The amount of tokens to recover.\\n */\\n function recoverFunds(\\n address _token,\\n address _to,\\n uint256 _amount\\n ) external onlyOwner {\\n IERC20(_token).transfer(_to, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x793a38091e1f81499a29ddba82c2b2f3cdd07071b81a832886e8e02a45ff352a\",\"license\":\"MIT\"},\"contracts/wrapper/IMetadataService.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface IMetadataService {\\n function uri(uint256) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xb3f1cf6df01ed7b15e5f2318f6823afbdb586ca38c2124c67955c645647ae9a2\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"../registry/ENS.sol\\\";\\nimport \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\\\";\\nimport \\\"./IMetadataService.sol\\\";\\nimport \\\"./INameWrapperUpgrade.sol\\\";\\n\\nuint32 constant CANNOT_UNWRAP = 1;\\nuint32 constant CANNOT_BURN_FUSES = 2;\\nuint32 constant CANNOT_TRANSFER = 4;\\nuint32 constant CANNOT_SET_RESOLVER = 8;\\nuint32 constant CANNOT_SET_TTL = 16;\\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\\nuint32 constant CANNOT_APPROVE = 64;\\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\\nuint32 constant IS_DOT_ETH = 1 << 17;\\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\\n// all fuses apart from IS_DOT_ETH\\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\\n\\ninterface INameWrapper is IERC1155 {\\n event NameWrapped(\\n bytes32 indexed node,\\n bytes name,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n );\\n\\n event NameUnwrapped(bytes32 indexed node, address owner);\\n\\n event FusesSet(bytes32 indexed node, uint32 fuses);\\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\\n\\n function ens() external view returns (ENS);\\n\\n function registrar() external view returns (IBaseRegistrar);\\n\\n function metadataService() external view returns (IMetadataService);\\n\\n function names(bytes32) external view returns (bytes memory);\\n\\n function name() external view returns (string memory);\\n\\n function upgradeContract() external view returns (INameWrapperUpgrade);\\n\\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\\n\\n function wrap(\\n bytes calldata name,\\n address wrappedOwner,\\n address resolver\\n ) external;\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint16 ownerControlledFuses,\\n address resolver\\n ) external returns (uint64 expires);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint16 ownerControlledFuses\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration\\n ) external returns (uint256 expires);\\n\\n function unwrap(bytes32 node, bytes32 label, address owner) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function upgrade(bytes calldata name, bytes calldata extraData) external;\\n\\n function setFuses(\\n bytes32 node,\\n uint16 ownerControlledFuses\\n ) external returns (uint32 newFuses);\\n\\n function setChildFuses(\\n bytes32 parentNode,\\n bytes32 labelhash,\\n uint32 fuses,\\n uint64 expiry\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n string calldata label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n string calldata label,\\n address newOwner,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (bytes32);\\n\\n function extendExpiry(\\n bytes32 node,\\n bytes32 labelhash,\\n uint64 expiry\\n ) external returns (uint64);\\n\\n function canModifyName(\\n bytes32 node,\\n address addr\\n ) external view returns (bool);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function ownerOf(uint256 id) external view returns (address owner);\\n\\n function approve(address to, uint256 tokenId) external;\\n\\n function getApproved(uint256 tokenId) external view returns (address);\\n\\n function getData(\\n uint256 id\\n ) external view returns (address, uint32, uint64);\\n\\n function setMetadataService(IMetadataService _metadataService) external;\\n\\n function uri(uint256 tokenId) external view returns (string memory);\\n\\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\\n\\n function allFusesBurned(\\n bytes32 node,\\n uint32 fuseMask\\n ) external view returns (bool);\\n\\n function isWrapped(bytes32) external view returns (bool);\\n\\n function isWrapped(bytes32, bytes32) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x70310eb67146d7290731c31841399640ac3b6a949eadc6598bc150123d185c57\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapperUpgrade.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface INameWrapperUpgrade {\\n function wrapFromUpgrade(\\n bytes calldata name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address approved,\\n bytes calldata extraData\\n ) external;\\n}\\n\",\"keccak256\":\"0x42e0cec6cd9d1a62d51d45b678f69d3e4ad5555e659b197e41257b308346bb8a\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161066138038061066183398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6105ce806100936000396000f3fe6080604052600436106100345760003560e01c806301ffc9a7146100395780633971d4671461006e578063e8d6dbb41461009c575b600080fd5b34801561004557600080fd5b506100596100543660046103b9565b6100b1565b60405190151581526020015b60405180910390f35b34801561007a57600080fd5b5061008e610089366004610402565b61014a565b604051908152602001610065565b6100af6100aa366004610402565b610218565b005b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061014457507fffffffff0000000000000000000000000000000000000000000000000000000082167fd1a70fd300000000000000000000000000000000000000000000000000000000145b92915050565b600082815b8181101561020f576000805473ffffffffffffffffffffffffffffffffffffffff166383e7f6ff8888858181106101885761018861047d565b905060200281019061019a9190610493565b886040518463ffffffff1660e01b81526004016101b9939291906104e1565b6040805180830381865afa1580156101d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f9919061051a565b602081015190510193909301925060010161014f565b50509392505050565b816000805b82811015610384576000805473ffffffffffffffffffffffffffffffffffffffff166383e7f6ff8888858181106102565761025661047d565b90506020028101906102689190610493565b886040518463ffffffff1660e01b8152600401610287939291906104e1565b6040805180830381865afa1580156102a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c7919061051a565b90506000816020015182600001516102df9190610577565b60005490915073ffffffffffffffffffffffffffffffffffffffff1663acf1a841828a8a878181106103135761031361047d565b90506020028101906103259190610493565b8a6040518563ffffffff1660e01b8152600401610344939291906104e1565b6000604051808303818588803b15801561035d57600080fd5b505af1158015610371573d6000803e3d6000fd5b505050919094019350505060010161021d565b5060405133904780156108fc02916000818181858888f193505050501580156103b1573d6000803e3d6000fd5b505050505050565b6000602082840312156103cb57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146103fb57600080fd5b9392505050565b60008060006040848603121561041757600080fd5b833567ffffffffffffffff8082111561042f57600080fd5b818601915086601f83011261044357600080fd5b81358181111561045257600080fd5b8760208260051b850101111561046757600080fd5b6020928301989097509590910135949350505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126104aa57600080fd5b83018035915067ffffffffffffffff8211156104c557600080fd5b6020019150368190038213156104da57600080fd5b9250929050565b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b60006040828403121561052c57600080fd5b6040516040810181811067ffffffffffffffff8211171561055d57634e487b7160e01b600052604160045260246000fd5b604052825181526020928301519281019290925250919050565b8082018082111561014457634e487b7160e01b600052601160045260246000fdfea26469706673582212206beee4d224b9a42f792157c3418272e9634b6bb43a4d662d725ed7cb938d88ba64736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106100345760003560e01c806301ffc9a7146100395780633971d4671461006e578063e8d6dbb41461009c575b600080fd5b34801561004557600080fd5b506100596100543660046103b9565b6100b1565b60405190151581526020015b60405180910390f35b34801561007a57600080fd5b5061008e610089366004610402565b61014a565b604051908152602001610065565b6100af6100aa366004610402565b610218565b005b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061014457507fffffffff0000000000000000000000000000000000000000000000000000000082167fd1a70fd300000000000000000000000000000000000000000000000000000000145b92915050565b600082815b8181101561020f576000805473ffffffffffffffffffffffffffffffffffffffff166383e7f6ff8888858181106101885761018861047d565b905060200281019061019a9190610493565b886040518463ffffffff1660e01b81526004016101b9939291906104e1565b6040805180830381865afa1580156101d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f9919061051a565b602081015190510193909301925060010161014f565b50509392505050565b816000805b82811015610384576000805473ffffffffffffffffffffffffffffffffffffffff166383e7f6ff8888858181106102565761025661047d565b90506020028101906102689190610493565b886040518463ffffffff1660e01b8152600401610287939291906104e1565b6040805180830381865afa1580156102a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c7919061051a565b90506000816020015182600001516102df9190610577565b60005490915073ffffffffffffffffffffffffffffffffffffffff1663acf1a841828a8a878181106103135761031361047d565b90506020028101906103259190610493565b8a6040518563ffffffff1660e01b8152600401610344939291906104e1565b6000604051808303818588803b15801561035d57600080fd5b505af1158015610371573d6000803e3d6000fd5b505050919094019350505060010161021d565b5060405133904780156108fc02916000818181858888f193505050501580156103b1573d6000803e3d6000fd5b505050505050565b6000602082840312156103cb57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146103fb57600080fd5b9392505050565b60008060006040848603121561041757600080fd5b833567ffffffffffffffff8082111561042f57600080fd5b818601915086601f83011261044357600080fd5b81358181111561045257600080fd5b8760208260051b850101111561046757600080fd5b6020928301989097509590910135949350505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126104aa57600080fd5b83018035915067ffffffffffffffff8211156104c557600080fd5b6020019150368190038213156104da57600080fd5b9250929050565b604081528260408201528284606083013760006060848301015260006060601f19601f8601168301019050826020830152949350505050565b60006040828403121561052c57600080fd5b6040516040810181811067ffffffffffffffff8211171561055d57634e487b7160e01b600052604160045260246000fd5b604052825181526020928301519281019290925250919050565b8082018082111561014457634e487b7160e01b600052601160045260246000fdfea26469706673582212206beee4d224b9a42f792157c3418272e9634b6bb43a4d662d725ed7cb938d88ba64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 13604, + "contract": "contracts/ethregistrar/StaticBulkRenewal.sol:StaticBulkRenewal", + "label": "controller", + "offset": 0, + "slot": "0", + "type": "t_contract(ETHRegistrarController)12258" + } + ], + "types": { + "t_contract(ETHRegistrarController)12258": { + "encoding": "inplace", + "label": "contract ETHRegistrarController", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/StaticMetadataService.json b/deployments/sepolia/StaticMetadataService.json new file mode 100644 index 00000000..9d4a64d2 --- /dev/null +++ b/deployments/sepolia/StaticMetadataService.json @@ -0,0 +1,87 @@ +{ + "address": "0x2e9736e109a2745628a5915983f8d9172414f1ac", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_metaDataUri", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x420aa6eb11f56155c09b76e51d915a8dd99ad127f408f3db44f2c05573c66a81", + "receipt": { + "to": null, + "from": "0x4fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8", + "contractAddress": "0x2e9736e109a2745628a5915983f8d9172414f1ac", + "transactionIndex": "0x2f", + "gasUsed": "0x39162", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x05e9f3bdd9cb14031203bb7b6a66de576446e0368d5f366b73c91115299c1586", + "transactionHash": "0x160e2e664e35006ac889329a05b34c64cf3168f02829cd07668898429db4d0dd", + "logs": [], + "blockNumber": "0x39d262", + "cumulativeGasUsed": "0x7648b4", + "status": "0x1" + }, + "args": [ + "ens-metadata-service.appspot.com/name/0x{id}" + ], + "numDeployments": 4, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_metaDataUri\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrapper/StaticMetadataService.sol\":\"StaticMetadataService\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"contracts/wrapper/StaticMetadataService.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ncontract StaticMetadataService {\\n string private _uri;\\n\\n constructor(string memory _metaDataUri) {\\n _uri = _metaDataUri;\\n }\\n\\n function uri(uint256) public view returns (string memory) {\\n return _uri;\\n }\\n}\\n\",\"keccak256\":\"0x28aad4cb829118de64965e06af8e785e6b2efa5207859d2efc63e404c26cfea3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161045538038061045583398101604081905261002f91610058565b600061003b82826101aa565b5050610269565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561006b57600080fd5b82516001600160401b038082111561008257600080fd5b818501915085601f83011261009657600080fd5b8151818111156100a8576100a8610042565b604051601f8201601f19908116603f011681019083821181831017156100d0576100d0610042565b8160405282815288868487010111156100e857600080fd5b600093505b8284101561010a57848401860151818501870152928501926100ed565b600086848301015280965050505050505092915050565b600181811c9082168061013557607f821691505b60208210810361015557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156101a557600081815260208120601f850160051c810160208610156101825750805b601f850160051c820191505b818110156101a15782815560010161018e565b5050505b505050565b81516001600160401b038111156101c3576101c3610042565b6101d7816101d18454610121565b8461015b565b602080601f83116001811461020c57600084156101f45750858301515b600019600386901b1c1916600185901b1785556101a1565b600085815260208120601f198616915b8281101561023b5788860151825594840194600190910190840161021c565b50858210156102595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6101dd806102786000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80630e89341c14610030575b600080fd5b61004361003e3660046100ed565b610059565b6040516100509190610106565b60405180910390f35b60606000805461006890610154565b80601f016020809104026020016040519081016040528092919081815260200182805461009490610154565b80156100e15780601f106100b6576101008083540402835291602001916100e1565b820191906000526020600020905b8154815290600101906020018083116100c457829003601f168201915b50505050509050919050565b6000602082840312156100ff57600080fd5b5035919050565b600060208083528351808285015260005b8181101561013357858101830151858201604001528201610117565b506000604082860101526040601f19601f8301168501019250505092915050565b600181811c9082168061016857607f821691505b6020821081036101a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea2646970667358221220dee5977a2693f04a6202db215bcb6c19eee7b94993ae966733d3658597220ef964736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80630e89341c14610030575b600080fd5b61004361003e3660046100ed565b610059565b6040516100509190610106565b60405180910390f35b60606000805461006890610154565b80601f016020809104026020016040519081016040528092919081815260200182805461009490610154565b80156100e15780601f106100b6576101008083540402835291602001916100e1565b820191906000526020600020905b8154815290600101906020018083116100c457829003601f168201915b50505050509050919050565b6000602082840312156100ff57600080fd5b5035919050565b600060208083528351808285015260005b8181101561013357858101830151858201604001528201610117565b506000604082860101526040601f19601f8301168501019250505092915050565b600181811c9082168061016857607f821691505b6020821081036101a1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea2646970667358221220dee5977a2693f04a6202db215bcb6c19eee7b94993ae966733d3658597220ef964736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24430, + "contract": "contracts/wrapper/StaticMetadataService.sol:StaticMetadataService", + "label": "_uri", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + } + ], + "types": { + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/TestUnwrap.json b/deployments/sepolia/TestUnwrap.json new file mode 100644 index 00000000..f0b90708 --- /dev/null +++ b/deployments/sepolia/TestUnwrap.json @@ -0,0 +1,349 @@ +{ + "address": "0xCAB401f869793d7A2238FD9dF780Cd647BE71D15", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ENS", + "name": "_ens", + "type": "address" + }, + { + "internalType": "contract IBaseRegistrar", + "name": "_registrar", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "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": "approvedWrapper", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ens", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "registrar", + "outputs": [ + { + "internalType": "contract IBaseRegistrar", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + }, + { + "internalType": "uint64", + "name": "ttl", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "name": "setSubnodeRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "wrapper", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setWrapperApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "wrapETH2LD", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "wrapFromUpgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x826a29b5ad7b5e90a75d6b92e7010514512da6544e9cb5dd760fde9b1cbbf941", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0xCAB401f869793d7A2238FD9dF780Cd647BE71D15", + "transactionIndex": 114, + "gasUsed": "970609", + "logsBloom": "0x00000000000000000000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000001000000400000000000020000000000000000000800004000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1146d5ac1bd64bed37a765e79e65468503186da612bda5bd7469e347a2adc72b", + "transactionHash": "0x826a29b5ad7b5e90a75d6b92e7010514512da6544e9cb5dd760fde9b1cbbf941", + "logs": [ + { + "transactionIndex": 114, + "blockNumber": 3790164, + "transactionHash": "0x826a29b5ad7b5e90a75d6b92e7010514512da6544e9cb5dd760fde9b1cbbf941", + "address": "0xCAB401f869793d7A2238FD9dF780Cd647BE71D15", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 237, + "blockHash": "0x1146d5ac1bd64bed37a765e79e65468503186da612bda5bd7469e347a2adc72b" + } + ], + "blockNumber": 3790164, + "cumulativeGasUsed": "18763842", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85" + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ENS\",\"name\":\"_ens\",\"type\":\"address\"},{\"internalType\":\"contract IBaseRegistrar\",\"name\":\"_registrar\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":\"approvedWrapper\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ens\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registrar\",\"outputs\":[{\"internalType\":\"contract IBaseRegistrar\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"ttl\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"setSubnodeRecord\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wrapper\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setWrapperApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"wrapETH2LD\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"wrapFromUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrapper/mocks/TestUnwrap.sol\":\"TestUnwrap\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool _approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/ethregistrar/IBaseRegistrar.sol\":{\"content\":\"import \\\"../registry/ENS.sol\\\";\\nimport \\\"./IBaseRegistrar.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721.sol\\\";\\n\\ninterface IBaseRegistrar is IERC721 {\\n event ControllerAdded(address indexed controller);\\n event ControllerRemoved(address indexed controller);\\n event NameMigrated(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRegistered(\\n uint256 indexed id,\\n address indexed owner,\\n uint256 expires\\n );\\n event NameRenewed(uint256 indexed id, uint256 expires);\\n\\n // Authorises a controller, who can register and renew domains.\\n function addController(address controller) external;\\n\\n // Revoke controller permission for an address.\\n function removeController(address controller) external;\\n\\n // Set the resolver for the TLD this registrar manages.\\n function setResolver(address resolver) external;\\n\\n // Returns the expiration timestamp of the specified label hash.\\n function nameExpires(uint256 id) external view returns (uint256);\\n\\n // Returns true if the specified name is available for registration.\\n function available(uint256 id) external view returns (bool);\\n\\n /**\\n * @dev Register a name.\\n */\\n function register(\\n uint256 id,\\n address owner,\\n uint256 duration\\n ) external returns (uint256);\\n\\n function renew(uint256 id, uint256 duration) external returns (uint256);\\n\\n /**\\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\\n */\\n function reclaim(uint256 id, address owner) external;\\n}\\n\",\"keccak256\":\"0x15f7b1dfa7cd34444daf79ec9b4d40437caa9257893ce0639d706fcc2ba69e52\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/wrapper/BytesUtils.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nlibrary BytesUtils {\\n /*\\n * @dev Returns the keccak-256 hash of a byte range.\\n * @param self The byte string to hash.\\n * @param offset The position to start hashing at.\\n * @param len The number of bytes to hash.\\n * @return The hash of the byte range.\\n */\\n function keccak(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(offset + len <= self.length);\\n assembly {\\n ret := keccak256(add(add(self, 32), offset), len)\\n }\\n }\\n\\n /**\\n * @dev Returns the ENS namehash of a DNS-encoded name.\\n * @param self The DNS-encoded name to hash.\\n * @param offset The offset at which to start hashing.\\n * @return The namehash of the name.\\n */\\n function namehash(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (bytes32) {\\n (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);\\n if (labelhash == bytes32(0)) {\\n require(offset == self.length - 1, \\\"namehash: Junk at end of name\\\");\\n return bytes32(0);\\n }\\n return\\n keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));\\n }\\n\\n /**\\n * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.\\n * @param self The byte string to read a label from.\\n * @param idx The index to read a label at.\\n * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.\\n * @return newIdx The index of the start of the next label.\\n */\\n function readLabel(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes32 labelhash, uint256 newIdx) {\\n require(idx < self.length, \\\"readLabel: Index out of bounds\\\");\\n uint256 len = uint256(uint8(self[idx]));\\n if (len > 0) {\\n labelhash = keccak(self, idx + 1, len);\\n } else {\\n labelhash = bytes32(0);\\n }\\n newIdx = idx + len + 1;\\n }\\n}\\n\",\"keccak256\":\"0xf862cd86d749158a554e3cb517efa9097331ec0cf7225117f21e96fb50c67edb\",\"license\":\"MIT\"},\"contracts/wrapper/mocks/TestUnwrap.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\nimport \\\"../../registry/ENS.sol\\\";\\nimport \\\"../../ethregistrar/IBaseRegistrar.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {BytesUtils} from \\\"../BytesUtils.sol\\\";\\n\\ncontract TestUnwrap is Ownable {\\n using BytesUtils for bytes;\\n\\n bytes32 private constant ETH_NODE =\\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\\n\\n ENS public immutable ens;\\n IBaseRegistrar public immutable registrar;\\n mapping(address => bool) public approvedWrapper;\\n\\n constructor(ENS _ens, IBaseRegistrar _registrar) {\\n ens = _ens;\\n registrar = _registrar;\\n }\\n\\n function setWrapperApproval(\\n address wrapper,\\n bool approved\\n ) public onlyOwner {\\n approvedWrapper[wrapper] = approved;\\n }\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address resolver\\n ) public {\\n _unwrapETH2LD(keccak256(bytes(label)), wrappedOwner, msg.sender);\\n }\\n\\n function setSubnodeRecord(\\n bytes32 parentNode,\\n string memory label,\\n address newOwner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) public {\\n bytes32 node = _makeNode(parentNode, keccak256(bytes(label)));\\n _unwrapSubnode(node, newOwner, msg.sender);\\n }\\n\\n function wrapFromUpgrade(\\n bytes calldata name,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address approved,\\n bytes calldata extraData\\n ) public {\\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\\n bytes32 parentNode = name.namehash(offset);\\n bytes32 node = _makeNode(parentNode, labelhash);\\n\\n if (parentNode == ETH_NODE) {\\n _unwrapETH2LD(labelhash, wrappedOwner, msg.sender);\\n } else {\\n _unwrapSubnode(node, wrappedOwner, msg.sender);\\n }\\n }\\n\\n function _unwrapETH2LD(\\n bytes32 labelhash,\\n address wrappedOwner,\\n address sender\\n ) private {\\n uint256 tokenId = uint256(labelhash);\\n address registrant = registrar.ownerOf(tokenId);\\n\\n require(\\n approvedWrapper[sender] &&\\n sender == registrant &&\\n registrar.isApprovedForAll(registrant, address(this)),\\n \\\"Unauthorised\\\"\\n );\\n\\n registrar.reclaim(tokenId, wrappedOwner);\\n registrar.transferFrom(registrant, wrappedOwner, tokenId);\\n }\\n\\n function _unwrapSubnode(\\n bytes32 node,\\n address newOwner,\\n address sender\\n ) private {\\n address owner = ens.owner(node);\\n\\n require(\\n approvedWrapper[sender] &&\\n owner == sender &&\\n ens.isApprovedForAll(owner, address(this)),\\n \\\"Unauthorised\\\"\\n );\\n\\n ens.setOwner(node, newOwner);\\n }\\n\\n function _makeNode(\\n bytes32 node,\\n bytes32 labelhash\\n ) private pure returns (bytes32) {\\n return keccak256(abi.encodePacked(node, labelhash));\\n }\\n}\\n\",\"keccak256\":\"0x738180fe6f0caae045c82df1d5a7088d07ebbf299c5c8b402a3cf04079980014\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c060405234801561001057600080fd5b5060405161117238038061117283398101604081905261002f916100b7565b6100383361004f565b6001600160a01b039182166080521660a0526100f1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146100b457600080fd5b50565b600080604083850312156100ca57600080fd5b82516100d58161009f565b60208401519092506100e68161009f565b809150509250929050565b60805160a05161102c6101466000396000818160f0015281816108f1015281816109cc01528181610ac20152610b63015260008181610134015281816104b6015281816105910152610687015261102c6000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80638da5cb5b11610076578063c6d6d7c11161005b578063c6d6d7c114610182578063f2fde38b146101b5578063f9547a9e146101c857600080fd5b80638da5cb5b1461015e5780639198c2761461016f57600080fd5b80632b20e397116100a75780632b20e397146100eb5780633f15457f1461012f578063715018a61461015657600080fd5b80630cc17365146100c357806324c1af44146100d8575b600080fd5b6100d66100d1366004610c1f565b6101db565b005b6100d66100e6366004610c9a565b61020e565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6100d6610238565b6000546001600160a01b0316610112565b6100d661017d366004610df1565b61024c565b6101a5610190366004610eac565b60016020526000908152604090205460ff1681565b6040519015158152602001610126565b6100d66101c3366004610eac565b61033c565b6100d66101d6366004610ed0565b6103d1565b6101e36103fb565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6000610221888880519060200120610455565b905061022e818733610484565b5050505050505050565b6102406103fb565b61024a60006106df565b565b60008061029360008b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506107479050565b9150915060006102dc828c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506107fe9050565b905060006102ea8285610455565b90507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5282016103235761031e848b336108bd565b61032e565b61032e818b33610484565b505050505050505050505050565b6103446103fb565b6001600160a01b0381166103c55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103ce816106df565b50565b6103f386866040516103e4929190610f5a565b604051809103902085336108bd565b505050505050565b6000546001600160a01b0316331461024a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103bc565b604080516020808201859052818301849052825180830384018152606090920190925280519101205b92915050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018490526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015610505573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105299190610f6a565b6001600160a01b03831660009081526001602052604090205490915060ff1680156105655750816001600160a01b0316816001600160a01b0316145b80156105fc575060405163e985e9c560e01b81526001600160a01b0382811660048301523060248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa1580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc9190610f87565b6106485760405162461bcd60e51b815260206004820152600c60248201527f556e617574686f7269736564000000000000000000000000000000000000000060448201526064016103bc565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b0384811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b1580156106cb57600080fd5b505af115801561022e573d6000803e3d6000fd5b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808351831061079a5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016103bc565b60008484815181106107ae576107ae610fa4565b016020015160f81c905080156107da576107d3856107cd866001610fd0565b83610bc8565b92506107df565b600092505b6107e98185610fd0565b6107f4906001610fd0565b9150509250929050565b600080600061080d8585610747565b90925090508161087f57600185516108259190610fe3565b84146108735760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016103bc565b506000915061047e9050565b61088985826107fe565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810184905283906000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109649190610f6a565b6001600160a01b03841660009081526001602052604090205490915060ff1680156109a05750806001600160a01b0316836001600160a01b0316145b8015610a37575060405163e985e9c560e01b81526001600160a01b0382811660048301523060248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190610f87565b610a835760405162461bcd60e51b815260206004820152600c60248201527f556e617574686f7269736564000000000000000000000000000000000000000060448201526064016103bc565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0385811660248301527f000000000000000000000000000000000000000000000000000000000000000016906328ed4f6c90604401600060405180830381600087803b158015610b0657600080fd5b505af1158015610b1a573d6000803e3d6000fd5b50506040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528781166024830152604482018690527f00000000000000000000000000000000000000000000000000000000000000001692506323b872dd9150606401600060405180830381600087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b505050505050505050565b8251600090610bd78385610fd0565b1115610be257600080fd5b5091016020012090565b6001600160a01b03811681146103ce57600080fd5b8035610c0c81610bec565b919050565b80151581146103ce57600080fd5b60008060408385031215610c3257600080fd5b8235610c3d81610bec565b91506020830135610c4d81610c11565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b803567ffffffffffffffff81168114610c0c57600080fd5b803563ffffffff81168114610c0c57600080fd5b600080600080600080600060e0888a031215610cb557600080fd5b87359650602088013567ffffffffffffffff80821115610cd457600080fd5b818a0191508a601f830112610ce857600080fd5b813581811115610cfa57610cfa610c58565b604051601f8201601f19908116603f01168101908382118183101715610d2257610d22610c58565b816040528281528d6020848701011115610d3b57600080fd5b82602086016020830137600060208483010152809a505050505050610d6260408901610c01565b9450610d7060608901610c01565b9350610d7e60808901610c6e565b9250610d8c60a08901610c86565b9150610d9a60c08901610c6e565b905092959891949750929550565b60008083601f840112610dba57600080fd5b50813567ffffffffffffffff811115610dd257600080fd5b602083019150836020828501011115610dea57600080fd5b9250929050565b60008060008060008060008060c0898b031215610e0d57600080fd5b883567ffffffffffffffff80821115610e2557600080fd5b610e318c838d01610da8565b909a50985060208b01359150610e4682610bec565b819750610e5560408c01610c86565b9650610e6360608c01610c6e565b955060808b01359150610e7582610bec565b90935060a08a01359080821115610e8b57600080fd5b50610e988b828c01610da8565b999c989b5096995094979396929594505050565b600060208284031215610ebe57600080fd5b8135610ec981610bec565b9392505050565b60008060008060008060a08789031215610ee957600080fd5b863567ffffffffffffffff811115610f0057600080fd5b610f0c89828a01610da8565b9097509550506020870135610f2081610bec565b9350610f2e60408801610c86565b9250610f3c60608801610c6e565b91506080870135610f4c81610bec565b809150509295509295509295565b8183823760009101908152919050565b600060208284031215610f7c57600080fd5b8151610ec981610bec565b600060208284031215610f9957600080fd5b8151610ec981610c11565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561047e5761047e610fba565b8181038181111561047e5761047e610fba56fea26469706673582212200d03c4139275e356bdf5747a80f6b61b271f2b7ff551603efb6b19ffb5b13ffe64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c80638da5cb5b11610076578063c6d6d7c11161005b578063c6d6d7c114610182578063f2fde38b146101b5578063f9547a9e146101c857600080fd5b80638da5cb5b1461015e5780639198c2761461016f57600080fd5b80632b20e397116100a75780632b20e397146100eb5780633f15457f1461012f578063715018a61461015657600080fd5b80630cc17365146100c357806324c1af44146100d8575b600080fd5b6100d66100d1366004610c1f565b6101db565b005b6100d66100e6366004610c9a565b61020e565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6100d6610238565b6000546001600160a01b0316610112565b6100d661017d366004610df1565b61024c565b6101a5610190366004610eac565b60016020526000908152604090205460ff1681565b6040519015158152602001610126565b6100d66101c3366004610eac565b61033c565b6100d66101d6366004610ed0565b6103d1565b6101e36103fb565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b6000610221888880519060200120610455565b905061022e818733610484565b5050505050505050565b6102406103fb565b61024a60006106df565b565b60008061029360008b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506107479050565b9150915060006102dc828c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506107fe9050565b905060006102ea8285610455565b90507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5282016103235761031e848b336108bd565b61032e565b61032e818b33610484565b505050505050505050505050565b6103446103fb565b6001600160a01b0381166103c55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103ce816106df565b50565b6103f386866040516103e4929190610f5a565b604051809103902085336108bd565b505050505050565b6000546001600160a01b0316331461024a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103bc565b604080516020808201859052818301849052825180830384018152606090920190925280519101205b92915050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018490526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015610505573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105299190610f6a565b6001600160a01b03831660009081526001602052604090205490915060ff1680156105655750816001600160a01b0316816001600160a01b0316145b80156105fc575060405163e985e9c560e01b81526001600160a01b0382811660048301523060248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa1580156105d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fc9190610f87565b6106485760405162461bcd60e51b815260206004820152600c60248201527f556e617574686f7269736564000000000000000000000000000000000000000060448201526064016103bc565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b0384811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b1580156106cb57600080fd5b505af115801561022e573d6000803e3d6000fd5b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808351831061079a5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016103bc565b60008484815181106107ae576107ae610fa4565b016020015160f81c905080156107da576107d3856107cd866001610fd0565b83610bc8565b92506107df565b600092505b6107e98185610fd0565b6107f4906001610fd0565b9150509250929050565b600080600061080d8585610747565b90925090508161087f57600185516108259190610fe3565b84146108735760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016103bc565b506000915061047e9050565b61088985826107fe565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810184905283906000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109649190610f6a565b6001600160a01b03841660009081526001602052604090205490915060ff1680156109a05750806001600160a01b0316836001600160a01b0316145b8015610a37575060405163e985e9c560e01b81526001600160a01b0382811660048301523060248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190610f87565b610a835760405162461bcd60e51b815260206004820152600c60248201527f556e617574686f7269736564000000000000000000000000000000000000000060448201526064016103bc565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0385811660248301527f000000000000000000000000000000000000000000000000000000000000000016906328ed4f6c90604401600060405180830381600087803b158015610b0657600080fd5b505af1158015610b1a573d6000803e3d6000fd5b50506040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528781166024830152604482018690527f00000000000000000000000000000000000000000000000000000000000000001692506323b872dd9150606401600060405180830381600087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b505050505050505050565b8251600090610bd78385610fd0565b1115610be257600080fd5b5091016020012090565b6001600160a01b03811681146103ce57600080fd5b8035610c0c81610bec565b919050565b80151581146103ce57600080fd5b60008060408385031215610c3257600080fd5b8235610c3d81610bec565b91506020830135610c4d81610c11565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b803567ffffffffffffffff81168114610c0c57600080fd5b803563ffffffff81168114610c0c57600080fd5b600080600080600080600060e0888a031215610cb557600080fd5b87359650602088013567ffffffffffffffff80821115610cd457600080fd5b818a0191508a601f830112610ce857600080fd5b813581811115610cfa57610cfa610c58565b604051601f8201601f19908116603f01168101908382118183101715610d2257610d22610c58565b816040528281528d6020848701011115610d3b57600080fd5b82602086016020830137600060208483010152809a505050505050610d6260408901610c01565b9450610d7060608901610c01565b9350610d7e60808901610c6e565b9250610d8c60a08901610c86565b9150610d9a60c08901610c6e565b905092959891949750929550565b60008083601f840112610dba57600080fd5b50813567ffffffffffffffff811115610dd257600080fd5b602083019150836020828501011115610dea57600080fd5b9250929050565b60008060008060008060008060c0898b031215610e0d57600080fd5b883567ffffffffffffffff80821115610e2557600080fd5b610e318c838d01610da8565b909a50985060208b01359150610e4682610bec565b819750610e5560408c01610c86565b9650610e6360608c01610c6e565b955060808b01359150610e7582610bec565b90935060a08a01359080821115610e8b57600080fd5b50610e988b828c01610da8565b999c989b5096995094979396929594505050565b600060208284031215610ebe57600080fd5b8135610ec981610bec565b9392505050565b60008060008060008060a08789031215610ee957600080fd5b863567ffffffffffffffff811115610f0057600080fd5b610f0c89828a01610da8565b9097509550506020870135610f2081610bec565b9350610f2e60408801610c86565b9250610f3c60608801610c6e565b91506080870135610f4c81610bec565b809150509295509295509295565b8183823760009101908152919050565b600060208284031215610f7c57600080fd5b8151610ec981610bec565b600060208284031215610f9957600080fd5b8151610ec981610c11565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561047e5761047e610fba565b8181038181111561047e5761047e610fba56fea26469706673582212200d03c4139275e356bdf5747a80f6b61b271f2b7ff551603efb6b19ffb5b13ffe64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/wrapper/mocks/TestUnwrap.sol:TestUnwrap", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 24616, + "contract": "contracts/wrapper/mocks/TestUnwrap.sol:TestUnwrap", + "label": "approvedWrapper", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/UniversalResolver.json b/deployments/sepolia/UniversalResolver.json new file mode 100644 index 00000000..d9896544 --- /dev/null +++ b/deployments/sepolia/UniversalResolver.json @@ -0,0 +1,671 @@ +{ + "address": "0x21B000Fd62a880b2125A61e36a284BB757b76025", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_registry", + "type": "address" + }, + { + "internalType": "string[]", + "name": "_urls", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "string[]", + "name": "urls", + "type": "string[]" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "bytes4", + "name": "callbackFunction", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "OffchainLookup", + "type": "error" + }, + { + "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": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "gateways", + "type": "string[]" + }, + { + "internalType": "bytes4", + "name": "callbackFunction", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "metaData", + "type": "bytes" + } + ], + "name": "_resolveSingle", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "batchGatewayURLs", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + } + ], + "name": "findResolver", + "outputs": [ + { + "internalType": "contract Resolver", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract ENS", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "gateways", + "type": "string[]" + } + ], + "name": "resolve", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "resolve", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + }, + { + "internalType": "string[]", + "name": "gateways", + "type": "string[]" + } + ], + "name": "resolve", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "name", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "resolve", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "resolveCallback", + "outputs": [ + { + "internalType": "bytes[]", + "name": "", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "resolveSingleCallback", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "reverseName", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "gateways", + "type": "string[]" + } + ], + "name": "reverse", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "reverseName", + "type": "bytes" + } + ], + "name": "reverse", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "name": "reverseCallback", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_urls", + "type": "string[]" + } + ], + "name": "setGatewayURLs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x5a92cb82bbccd88be96a14858d3b4d957ac7bf3b32e19f4825d8d8e35a1e8839", + "receipt": { + "to": null, + "from": "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", + "contractAddress": "0x21B000Fd62a880b2125A61e36a284BB757b76025", + "transactionIndex": 47, + "gasUsed": "3039128", + "logsBloom": "0x00000000000000002000000000000000000000000000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000840000000000000000000000000000000400000000000000000000000000000000000000400000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3bb3be3e3e815561cf21b3d8a6785aff1bad9120c0dba1b7253334a484f84acb", + "transactionHash": "0x5a92cb82bbccd88be96a14858d3b4d957ac7bf3b32e19f4825d8d8e35a1e8839", + "logs": [ + { + "transactionIndex": 47, + "blockNumber": 3914906, + "transactionHash": "0x5a92cb82bbccd88be96a14858d3b4d957ac7bf3b32e19f4825d8d8e35a1e8839", + "address": "0x21B000Fd62a880b2125A61e36a284BB757b76025", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004fe4e666be5752f1fdd210f4ab5de2cc26e3e0e8" + ], + "data": "0x", + "logIndex": 62, + "blockHash": "0x3bb3be3e3e815561cf21b3d8a6785aff1bad9120c0dba1b7253334a484f84acb" + } + ], + "blockNumber": 3914906, + "cumulativeGasUsed": "21618601", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + [ + "https://universal-offchain-unwrapper.ens-cf.workers.dev/" + ] + ], + "numDeployments": 1, + "solcInputHash": "e04502f562d98d0455f6c1c453418cdd", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_registry\",\"type\":\"address\"},{\"internalType\":\"string[]\",\"name\":\"_urls\",\"type\":\"string[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"string[]\",\"name\":\"urls\",\"type\":\"string[]\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"callbackFunction\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"OffchainLookup\",\"type\":\"error\"},{\"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\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"gateways\",\"type\":\"string[]\"},{\"internalType\":\"bytes4\",\"name\":\"callbackFunction\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"metaData\",\"type\":\"bytes\"}],\"name\":\"_resolveSingle\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"batchGatewayURLs\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"}],\"name\":\"findResolver\",\"outputs\":[{\"internalType\":\"contract Resolver\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"contract ENS\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"gateways\",\"type\":\"string[]\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"},{\"internalType\":\"string[]\",\"name\":\"gateways\",\"type\":\"string[]\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"resolveCallback\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"resolveSingleCallback\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reverseName\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"gateways\",\"type\":\"string[]\"}],\"name\":\"reverse\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"reverseName\",\"type\":\"bytes\"}],\"name\":\"reverse\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"reverseCallback\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_urls\",\"type\":\"string[]\"}],\"name\":\"setGatewayURLs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"findResolver(bytes)\":{\"details\":\"Finds a resolver by recursively querying the registry, starting at the longest name and progressively removing labels until it finds a result.\",\"params\":{\"name\":\"The name to resolve, in DNS-encoded and normalised form.\"},\"returns\":{\"_0\":\"resolver The Resolver responsible for this name.\",\"_1\":\"namehash The namehash of the full name.\",\"_2\":\"finalOffset The offset of the first label with a resolver.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"resolve(bytes,bytes)\":{\"details\":\"Performs ENS name resolution for the supplied name and resolution data.\",\"params\":{\"data\":\"The resolution data, as specified in ENSIP-10.\",\"name\":\"The name to resolve, in normalised and DNS-encoded form.\"},\"returns\":{\"_0\":\"The result of resolving the name.\"}},\"reverse(bytes,string[])\":{\"details\":\"Performs ENS name reverse resolution for the supplied reverse name.\",\"params\":{\"reverseName\":\"The reverse name to resolve, in normalised and DNS-encoded form. e.g. b6E040C9ECAaE172a89bD561c5F73e1C48d28cd9.addr.reverse\"},\"returns\":{\"_0\":\"The resolved name, the resolved address, the reverse resolver address, and the resolver address.\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"The Universal Resolver is a contract that handles the work of resolving a name entirely onchain, making it possible to make a single smart contract call to resolve an ENS name.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/UniversalResolver.sol\":\"UniversalResolver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/registry/ENS.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\ninterface ENS {\\n // Logged when the owner of a node assigns a new owner to a subnode.\\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\\n\\n // Logged when the owner of a node transfers ownership to a new account.\\n event Transfer(bytes32 indexed node, address owner);\\n\\n // Logged when the resolver for a node changes.\\n event NewResolver(bytes32 indexed node, address resolver);\\n\\n // Logged when the TTL of a node changes\\n event NewTTL(bytes32 indexed node, uint64 ttl);\\n\\n // Logged when an operator is added or removed.\\n event ApprovalForAll(\\n address indexed owner,\\n address indexed operator,\\n bool approved\\n );\\n\\n function setRecord(\\n bytes32 node,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeRecord(\\n bytes32 node,\\n bytes32 label,\\n address owner,\\n address resolver,\\n uint64 ttl\\n ) external;\\n\\n function setSubnodeOwner(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external returns (bytes32);\\n\\n function setResolver(bytes32 node, address resolver) external;\\n\\n function setOwner(bytes32 node, address owner) external;\\n\\n function setTTL(bytes32 node, uint64 ttl) external;\\n\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n function owner(bytes32 node) external view returns (address);\\n\\n function resolver(bytes32 node) external view returns (address);\\n\\n function ttl(bytes32 node) external view returns (uint64);\\n\\n function recordExists(bytes32 node) external view returns (bool);\\n\\n function isApprovedForAll(\\n address owner,\\n address operator\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x7cb1158c7d268b63de1468e28e2711b28d686e2628ddb22da2149cd93ddeafda\"},\"contracts/resolvers/Resolver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"./profiles/IABIResolver.sol\\\";\\nimport \\\"./profiles/IAddressResolver.sol\\\";\\nimport \\\"./profiles/IAddrResolver.sol\\\";\\nimport \\\"./profiles/IContentHashResolver.sol\\\";\\nimport \\\"./profiles/IDNSRecordResolver.sol\\\";\\nimport \\\"./profiles/IDNSZoneResolver.sol\\\";\\nimport \\\"./profiles/IInterfaceResolver.sol\\\";\\nimport \\\"./profiles/INameResolver.sol\\\";\\nimport \\\"./profiles/IPubkeyResolver.sol\\\";\\nimport \\\"./profiles/ITextResolver.sol\\\";\\nimport \\\"./profiles/IExtendedResolver.sol\\\";\\n\\n/**\\n * A generic resolver interface which includes all the functions including the ones deprecated\\n */\\ninterface Resolver is\\n IERC165,\\n IABIResolver,\\n IAddressResolver,\\n IAddrResolver,\\n IContentHashResolver,\\n IDNSRecordResolver,\\n IDNSZoneResolver,\\n IInterfaceResolver,\\n INameResolver,\\n IPubkeyResolver,\\n ITextResolver,\\n IExtendedResolver\\n{\\n /* Deprecated events */\\n event ContentChanged(bytes32 indexed node, bytes32 hash);\\n\\n function setApprovalForAll(address, bool) external;\\n\\n function approve(bytes32 node, address delegate, bool approved) external;\\n\\n function isApprovedForAll(address account, address operator) external;\\n\\n function isApprovedFor(\\n address owner,\\n bytes32 node,\\n address delegate\\n ) external;\\n\\n function setABI(\\n bytes32 node,\\n uint256 contentType,\\n bytes calldata data\\n ) external;\\n\\n function setAddr(bytes32 node, address addr) external;\\n\\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\\n\\n function setContenthash(bytes32 node, bytes calldata hash) external;\\n\\n function setDnsrr(bytes32 node, bytes calldata data) external;\\n\\n function setName(bytes32 node, string calldata _name) external;\\n\\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\\n\\n function setText(\\n bytes32 node,\\n string calldata key,\\n string calldata value\\n ) external;\\n\\n function setInterface(\\n bytes32 node,\\n bytes4 interfaceID,\\n address implementer\\n ) external;\\n\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(\\n bytes32 nodehash,\\n bytes[] calldata data\\n ) external returns (bytes[] memory results);\\n\\n /* Deprecated functions */\\n function content(bytes32 node) external view returns (bytes32);\\n\\n function multihash(bytes32 node) external view returns (bytes memory);\\n\\n function setContent(bytes32 node, bytes32 hash) external;\\n\\n function setMultihash(bytes32 node, bytes calldata hash) external;\\n}\\n\",\"keccak256\":\"0xfc77ab6b7c59c3ebfe1c720bdebf9b08c2488ff7ac9501a9aa056c5d6d5b50c5\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IABIResolver {\\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\\n\\n /**\\n * Returns the ABI associated with an ENS node.\\n * Defined in EIP205.\\n * @param node The ENS node to query\\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\\n * @return contentType The content type of the return value\\n * @return data The ABI data\\n */\\n function ABI(\\n bytes32 node,\\n uint256 contentTypes\\n ) external view returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0x85b373d02d19374fe570af407f459768285704bf7f30ab17c30eabfb5a10e4c3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddrResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the legacy (ETH-only) addr function.\\n */\\ninterface IAddrResolver {\\n event AddrChanged(bytes32 indexed node, address a);\\n\\n /**\\n * Returns the address associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated address.\\n */\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0x2ad7f2fc60ebe0f93745fe70247f6a854f66af732483fda2a3c5e055614445e8\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IAddressResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\n/**\\n * Interface for the new (multicoin) addr function.\\n */\\ninterface IAddressResolver {\\n event AddressChanged(\\n bytes32 indexed node,\\n uint256 coinType,\\n bytes newAddress\\n );\\n\\n function addr(\\n bytes32 node,\\n uint256 coinType\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x411447c1e90c51e09702815a85ec725ffbbe37cf96e8cc4d2a8bd4ad8a59d73e\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IContentHashResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IContentHashResolver {\\n event ContenthashChanged(bytes32 indexed node, bytes hash);\\n\\n /**\\n * Returns the contenthash associated with an ENS node.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function contenthash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xd95cd77684ba5752c428d7dceb4ecc6506ac94f4fbb910489637eb68dcd8e366\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSRecordResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSRecordResolver {\\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\\n event DNSRecordChanged(\\n bytes32 indexed node,\\n bytes name,\\n uint16 resource,\\n bytes record\\n );\\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\\n\\n /**\\n * Obtain a DNS record.\\n * @param node the namehash of the node for which to fetch the record\\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\\n * @return the DNS record in wire format if present, otherwise empty\\n */\\n function dnsRecord(\\n bytes32 node,\\n bytes32 name,\\n uint16 resource\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xcfa52200edd337f2c6c5bf402352600584da033b21323603e53de33051a3e25d\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IDNSZoneResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IDNSZoneResolver {\\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\\n event DNSZonehashChanged(\\n bytes32 indexed node,\\n bytes lastzonehash,\\n bytes zonehash\\n );\\n\\n /**\\n * zonehash obtains the hash for the zone.\\n * @param node The ENS node to query.\\n * @return The associated contenthash.\\n */\\n function zonehash(bytes32 node) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xca1b3a16e7005533f2800a3e66fcdccf7c574deac7913d8c810f40aec1d58dc0\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IExtendedResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ninterface IExtendedResolver {\\n function resolve(\\n bytes memory name,\\n bytes memory data\\n ) external view returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x5d81521cfae7d9a4475d27533cd8ed0d3475d369eb0674fd90ffbdbdf292faa3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IInterfaceResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IInterfaceResolver {\\n event InterfaceChanged(\\n bytes32 indexed node,\\n bytes4 indexed interfaceID,\\n address implementer\\n );\\n\\n /**\\n * Returns the address of a contract that implements the specified interface for this name.\\n * If an implementer has not been set for this interfaceID and name, the resolver will query\\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\\n * will be returned.\\n * @param node The ENS node to query.\\n * @param interfaceID The EIP 165 interface ID to check for.\\n * @return The address that implements this interface, or 0 if the interface is unsupported.\\n */\\n function interfaceImplementer(\\n bytes32 node,\\n bytes4 interfaceID\\n ) external view returns (address);\\n}\\n\",\"keccak256\":\"0x390321fb58f7b927df9562450981e74b4be3907e7c09df321fd3b7409b63ae28\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/INameResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface INameResolver {\\n event NameChanged(bytes32 indexed node, string name);\\n\\n /**\\n * Returns the name associated with an ENS node, for reverse records.\\n * Defined in EIP181.\\n * @param node The ENS node to query.\\n * @return The associated name.\\n */\\n function name(bytes32 node) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x9ec392b612447b1acbdc01114f2da2837a658d3f3157f60a99c5269f0b623346\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IPubkeyResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface IPubkeyResolver {\\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\\n\\n /**\\n * Returns the SECP256k1 public key associated with an ENS node.\\n * Defined in EIP 619.\\n * @param node The ENS node to query\\n * @return x The X coordinate of the curve point for the public key.\\n * @return y The Y coordinate of the curve point for the public key.\\n */\\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\\n}\\n\",\"keccak256\":\"0x69748947093dd2fda9ddcebd0adf19a6d1e7600df1d4b1462a0417156caddca7\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/ITextResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\ninterface ITextResolver {\\n event TextChanged(\\n bytes32 indexed node,\\n string indexed indexedKey,\\n string key,\\n string value\\n );\\n\\n /**\\n * Returns the text data associated with an ENS node and key.\\n * @param node The ENS node to query.\\n * @param key The text data key to query.\\n * @return The associated text data.\\n */\\n function text(\\n bytes32 node,\\n string calldata key\\n ) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x7c5debb3c42cd9f5de2274ea7aa053f238608314b62db441c40e31cea2543fd5\",\"license\":\"MIT\"},\"contracts/utils/HexUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nlibrary HexUtils {\\n /**\\n * @dev Attempts to parse bytes32 from a hex string\\n * @param str The string to parse\\n * @param idx The offset to start parsing at\\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\\n */\\n function hexStringToBytes32(\\n bytes memory str,\\n uint256 idx,\\n uint256 lastIdx\\n ) internal pure returns (bytes32 r, bool valid) {\\n valid = true;\\n assembly {\\n // check that the index to read to is not past the end of the string\\n if gt(lastIdx, mload(str)) {\\n revert(0, 0)\\n }\\n\\n function getHex(c) -> ascii {\\n // chars 48-57: 0-9\\n if and(gt(c, 47), lt(c, 58)) {\\n ascii := sub(c, 48)\\n leave\\n }\\n // chars 65-70: A-F\\n if and(gt(c, 64), lt(c, 71)) {\\n ascii := add(sub(c, 65), 10)\\n leave\\n }\\n // chars 97-102: a-f\\n if and(gt(c, 96), lt(c, 103)) {\\n ascii := add(sub(c, 97), 10)\\n leave\\n }\\n // invalid char\\n ascii := 0xff\\n }\\n\\n let ptr := add(str, 32)\\n for {\\n let i := idx\\n } lt(i, lastIdx) {\\n i := add(i, 2)\\n } {\\n let byte1 := getHex(byte(0, mload(add(ptr, i))))\\n let byte2 := getHex(byte(0, mload(add(ptr, add(i, 1)))))\\n // if either byte is invalid, set invalid and break loop\\n if or(eq(byte1, 0xff), eq(byte2, 0xff)) {\\n valid := false\\n break\\n }\\n let combined := or(shl(4, byte1), byte2)\\n r := or(shl(8, r), combined)\\n }\\n }\\n }\\n\\n /**\\n * @dev Attempts to parse an address from a hex string\\n * @param str The string to parse\\n * @param idx The offset to start parsing at\\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\\n */\\n function hexToAddress(\\n bytes memory str,\\n uint256 idx,\\n uint256 lastIdx\\n ) internal pure returns (address, bool) {\\n if (lastIdx - idx < 40) return (address(0x0), false);\\n (bytes32 r, bool valid) = hexStringToBytes32(str, idx, lastIdx);\\n return (address(uint160(uint256(r))), valid);\\n }\\n}\\n\",\"keccak256\":\"0xcae20ad72181f47dfe7fba7d88e8d902a01576b16e93362878e726989d6cfb4d\",\"license\":\"MIT\"},\"contracts/utils/LowLevelCallUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.13;\\n\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\nlibrary LowLevelCallUtils {\\n using Address for address;\\n\\n /**\\n * @dev Makes a static call to the specified `target` with `data`. Return data can be fetched with\\n * `returnDataSize` and `readReturnData`.\\n * @param target The address to staticcall.\\n * @param data The data to pass to the call.\\n * @return success True if the call succeeded, or false if it reverts.\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bool success) {\\n require(\\n target.isContract(),\\n \\\"LowLevelCallUtils: static call to non-contract\\\"\\n );\\n assembly {\\n success := staticcall(\\n gas(),\\n target,\\n add(data, 32),\\n mload(data),\\n 0,\\n 0\\n )\\n }\\n }\\n\\n /**\\n * @dev Returns the size of the return data of the most recent external call.\\n */\\n function returnDataSize() internal pure returns (uint256 len) {\\n assembly {\\n len := returndatasize()\\n }\\n }\\n\\n /**\\n * @dev Reads return data from the most recent external call.\\n * @param offset Offset into the return data.\\n * @param length Number of bytes to return.\\n */\\n function readReturnData(\\n uint256 offset,\\n uint256 length\\n ) internal pure returns (bytes memory data) {\\n data = new bytes(length);\\n assembly {\\n returndatacopy(add(data, 32), offset, length)\\n }\\n }\\n\\n /**\\n * @dev Reverts with the return data from the most recent external call.\\n */\\n function propagateRevert() internal pure {\\n assembly {\\n returndatacopy(0, 0, returndatasize())\\n revert(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x20d3d0d14fab6fc079f90d630a51bb8e274431ca929591ec8d62383ce946cb3a\",\"license\":\"MIT\"},\"contracts/utils/NameEncoder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.13;\\n\\nimport {BytesUtils} from \\\"../wrapper/BytesUtils.sol\\\";\\n\\nlibrary NameEncoder {\\n using BytesUtils for bytes;\\n\\n function dnsEncodeName(\\n string memory name\\n ) internal pure returns (bytes memory dnsName, bytes32 node) {\\n uint8 labelLength = 0;\\n bytes memory bytesName = bytes(name);\\n uint256 length = bytesName.length;\\n dnsName = new bytes(length + 2);\\n node = 0;\\n if (length == 0) {\\n dnsName[0] = 0;\\n return (dnsName, node);\\n }\\n\\n // use unchecked to save gas since we check for an underflow\\n // and we check for the length before the loop\\n unchecked {\\n for (uint256 i = length - 1; i >= 0; i--) {\\n if (bytesName[i] == \\\".\\\") {\\n dnsName[i + 1] = bytes1(labelLength);\\n node = keccak256(\\n abi.encodePacked(\\n node,\\n bytesName.keccak(i + 1, labelLength)\\n )\\n );\\n labelLength = 0;\\n } else {\\n labelLength += 1;\\n dnsName[i + 1] = bytesName[i];\\n }\\n if (i == 0) {\\n break;\\n }\\n }\\n }\\n\\n node = keccak256(\\n abi.encodePacked(node, bytesName.keccak(0, labelLength))\\n );\\n\\n dnsName[0] = bytes1(labelLength);\\n return (dnsName, node);\\n }\\n}\\n\",\"keccak256\":\"0x63fd5f360cef8c9b8b8cfdff20d3f0e955b4c8ac7dfac758788223c61678aad1\",\"license\":\"MIT\"},\"contracts/utils/UniversalResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.17 <0.9.0;\\n\\nimport {ERC165} from \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {Address} from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport {LowLevelCallUtils} from \\\"./LowLevelCallUtils.sol\\\";\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IExtendedResolver} from \\\"../resolvers/profiles/IExtendedResolver.sol\\\";\\nimport {Resolver, INameResolver, IAddrResolver} from \\\"../resolvers/Resolver.sol\\\";\\nimport {NameEncoder} from \\\"./NameEncoder.sol\\\";\\nimport {BytesUtils} from \\\"../wrapper/BytesUtils.sol\\\";\\nimport {HexUtils} from \\\"./HexUtils.sol\\\";\\n\\nerror OffchainLookup(\\n address sender,\\n string[] urls,\\n bytes callData,\\n bytes4 callbackFunction,\\n bytes extraData\\n);\\n\\nstruct MulticallData {\\n bytes name;\\n bytes[] data;\\n string[] gateways;\\n bytes4 callbackFunction;\\n bool isWildcard;\\n address resolver;\\n bytes metaData;\\n bool[] failures;\\n}\\n\\nstruct OffchainLookupCallData {\\n address sender;\\n string[] urls;\\n bytes callData;\\n}\\n\\nstruct OffchainLookupExtraData {\\n bytes4 callbackFunction;\\n bytes data;\\n}\\n\\ninterface BatchGateway {\\n function query(\\n OffchainLookupCallData[] memory data\\n ) external returns (bool[] memory failures, bytes[] memory responses);\\n}\\n\\n/**\\n * The Universal Resolver is a contract that handles the work of resolving a name entirely onchain,\\n * making it possible to make a single smart contract call to resolve an ENS name.\\n */\\ncontract UniversalResolver is ERC165, Ownable {\\n using Address for address;\\n using NameEncoder for string;\\n using BytesUtils for bytes;\\n using HexUtils for bytes;\\n\\n string[] public batchGatewayURLs;\\n ENS public immutable registry;\\n\\n constructor(address _registry, string[] memory _urls) {\\n registry = ENS(_registry);\\n batchGatewayURLs = _urls;\\n }\\n\\n function setGatewayURLs(string[] memory _urls) public onlyOwner {\\n batchGatewayURLs = _urls;\\n }\\n\\n /**\\n * @dev Performs ENS name resolution for the supplied name and resolution data.\\n * @param name The name to resolve, in normalised and DNS-encoded form.\\n * @param data The resolution data, as specified in ENSIP-10.\\n * @return The result of resolving the name.\\n */\\n function resolve(\\n bytes calldata name,\\n bytes memory data\\n ) external view returns (bytes memory, address) {\\n return\\n _resolveSingle(\\n name,\\n data,\\n batchGatewayURLs,\\n this.resolveSingleCallback.selector,\\n \\\"\\\"\\n );\\n }\\n\\n function resolve(\\n bytes calldata name,\\n bytes[] memory data\\n ) external view returns (bytes[] memory, address) {\\n return resolve(name, data, batchGatewayURLs);\\n }\\n\\n function resolve(\\n bytes calldata name,\\n bytes memory data,\\n string[] memory gateways\\n ) external view returns (bytes memory, address) {\\n return\\n _resolveSingle(\\n name,\\n data,\\n gateways,\\n this.resolveSingleCallback.selector,\\n \\\"\\\"\\n );\\n }\\n\\n function resolve(\\n bytes calldata name,\\n bytes[] memory data,\\n string[] memory gateways\\n ) public view returns (bytes[] memory, address) {\\n return\\n _resolve(name, data, gateways, this.resolveCallback.selector, \\\"\\\");\\n }\\n\\n function _resolveSingle(\\n bytes calldata name,\\n bytes memory data,\\n string[] memory gateways,\\n bytes4 callbackFunction,\\n bytes memory metaData\\n ) public view returns (bytes memory, address) {\\n bytes[] memory dataArr = new bytes[](1);\\n dataArr[0] = data;\\n (bytes[] memory results, address resolver) = _resolve(\\n name,\\n dataArr,\\n gateways,\\n callbackFunction,\\n metaData\\n );\\n return (results[0], resolver);\\n }\\n\\n function _resolve(\\n bytes calldata name,\\n bytes[] memory data,\\n string[] memory gateways,\\n bytes4 callbackFunction,\\n bytes memory metaData\\n ) internal view returns (bytes[] memory results, address resolverAddress) {\\n (Resolver resolver, , uint256 finalOffset) = findResolver(name);\\n resolverAddress = address(resolver);\\n if (resolverAddress == address(0)) {\\n return (results, address(0));\\n }\\n\\n bool isWildcard = finalOffset != 0;\\n\\n results = _multicall(\\n MulticallData(\\n name,\\n data,\\n gateways,\\n callbackFunction,\\n isWildcard,\\n resolverAddress,\\n metaData,\\n new bool[](data.length)\\n )\\n );\\n }\\n\\n function reverse(\\n bytes calldata reverseName\\n ) external view returns (string memory, address, address, address) {\\n return reverse(reverseName, batchGatewayURLs);\\n }\\n\\n /**\\n * @dev Performs ENS name reverse resolution for the supplied reverse name.\\n * @param reverseName The reverse name to resolve, in normalised and DNS-encoded form. e.g. b6E040C9ECAaE172a89bD561c5F73e1C48d28cd9.addr.reverse\\n * @return The resolved name, the resolved address, the reverse resolver address, and the resolver address.\\n */\\n function reverse(\\n bytes calldata reverseName,\\n string[] memory gateways\\n ) public view returns (string memory, address, address, address) {\\n bytes memory encodedCall = abi.encodeCall(\\n INameResolver.name,\\n reverseName.namehash(0)\\n );\\n (\\n bytes memory resolvedReverseData,\\n address reverseResolverAddress\\n ) = _resolveSingle(\\n reverseName,\\n encodedCall,\\n gateways,\\n this.reverseCallback.selector,\\n \\\"\\\"\\n );\\n\\n return\\n getForwardDataFromReverse(\\n resolvedReverseData,\\n reverseResolverAddress,\\n gateways\\n );\\n }\\n\\n function getForwardDataFromReverse(\\n bytes memory resolvedReverseData,\\n address reverseResolverAddress,\\n string[] memory gateways\\n ) internal view returns (string memory, address, address, address) {\\n string memory resolvedName = abi.decode(resolvedReverseData, (string));\\n\\n (bytes memory encodedName, bytes32 namehash) = resolvedName\\n .dnsEncodeName();\\n\\n bytes memory encodedCall = abi.encodeCall(IAddrResolver.addr, namehash);\\n bytes memory metaData = abi.encode(\\n resolvedName,\\n reverseResolverAddress\\n );\\n (bytes memory resolvedData, address resolverAddress) = this\\n ._resolveSingle(\\n encodedName,\\n encodedCall,\\n gateways,\\n this.reverseCallback.selector,\\n metaData\\n );\\n\\n address resolvedAddress = abi.decode(resolvedData, (address));\\n\\n return (\\n resolvedName,\\n resolvedAddress,\\n reverseResolverAddress,\\n resolverAddress\\n );\\n }\\n\\n function resolveSingleCallback(\\n bytes calldata response,\\n bytes calldata extraData\\n ) external view returns (bytes memory, address) {\\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\\n response,\\n extraData,\\n this.resolveSingleCallback.selector\\n );\\n return (results[0], resolver);\\n }\\n\\n function resolveCallback(\\n bytes calldata response,\\n bytes calldata extraData\\n ) external view returns (bytes[] memory, address) {\\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\\n response,\\n extraData,\\n this.resolveCallback.selector\\n );\\n return (results, resolver);\\n }\\n\\n function reverseCallback(\\n bytes calldata response,\\n bytes calldata extraData\\n ) external view returns (string memory, address, address, address) {\\n (\\n bytes[] memory resolvedData,\\n address resolverAddress,\\n string[] memory gateways,\\n bytes memory metaData\\n ) = _resolveCallback(\\n response,\\n extraData,\\n this.reverseCallback.selector\\n );\\n\\n if (metaData.length > 0) {\\n (string memory resolvedName, address reverseResolverAddress) = abi\\n .decode(metaData, (string, address));\\n address resolvedAddress = abi.decode(resolvedData[0], (address));\\n return (\\n resolvedName,\\n resolvedAddress,\\n reverseResolverAddress,\\n resolverAddress\\n );\\n }\\n\\n return\\n getForwardDataFromReverse(\\n resolvedData[0],\\n resolverAddress,\\n gateways\\n );\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override returns (bool) {\\n return\\n interfaceId == type(IExtendedResolver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n function _resolveCallback(\\n bytes calldata response,\\n bytes calldata extraData,\\n bytes4 callbackFunction\\n )\\n internal\\n view\\n returns (bytes[] memory, address, string[] memory, bytes memory)\\n {\\n MulticallData memory multicallData;\\n multicallData.callbackFunction = callbackFunction;\\n (bool[] memory failures, bytes[] memory responses) = abi.decode(\\n response,\\n (bool[], bytes[])\\n );\\n OffchainLookupExtraData[] memory extraDatas;\\n (\\n multicallData.isWildcard,\\n multicallData.resolver,\\n multicallData.gateways,\\n multicallData.metaData,\\n extraDatas\\n ) = abi.decode(\\n extraData,\\n (bool, address, string[], bytes, OffchainLookupExtraData[])\\n );\\n require(responses.length <= extraDatas.length);\\n multicallData.data = new bytes[](extraDatas.length);\\n multicallData.failures = new bool[](extraDatas.length);\\n uint256 offchainCount = 0;\\n for (uint256 i = 0; i < extraDatas.length; i++) {\\n if (extraDatas[i].callbackFunction == bytes4(0)) {\\n // This call did not require an offchain lookup; use the previous input data.\\n multicallData.data[i] = extraDatas[i].data;\\n } else {\\n if (failures[offchainCount]) {\\n multicallData.failures[i] = true;\\n multicallData.data[i] = responses[offchainCount];\\n } else {\\n multicallData.data[i] = abi.encodeWithSelector(\\n extraDatas[i].callbackFunction,\\n responses[offchainCount],\\n extraDatas[i].data\\n );\\n }\\n offchainCount = offchainCount + 1;\\n }\\n }\\n\\n return (\\n _multicall(multicallData),\\n multicallData.resolver,\\n multicallData.gateways,\\n multicallData.metaData\\n );\\n }\\n\\n /**\\n * @dev Makes a call to `target` with `data`. If the call reverts with an `OffchainLookup` error, wraps\\n * the error with the data necessary to continue the request where it left off.\\n * @param target The address to call.\\n * @param data The data to call `target` with.\\n * @return offchain Whether the call reverted with an `OffchainLookup` error.\\n * @return returnData If `target` did not revert, contains the return data from the call to `target`. Otherwise, contains a `OffchainLookupCallData` struct.\\n * @return extraData If `target` did not revert, is empty. Otherwise, contains a `OffchainLookupExtraData` struct.\\n * @return result Whether the call succeeded.\\n */\\n function callWithOffchainLookupPropagation(\\n address target,\\n bytes memory data\\n )\\n internal\\n view\\n returns (\\n bool offchain,\\n bytes memory returnData,\\n OffchainLookupExtraData memory extraData,\\n bool result\\n )\\n {\\n result = LowLevelCallUtils.functionStaticCall(address(target), data);\\n uint256 size = LowLevelCallUtils.returnDataSize();\\n\\n if (result) {\\n return (\\n false,\\n LowLevelCallUtils.readReturnData(0, size),\\n extraData,\\n true\\n );\\n }\\n\\n // Failure\\n if (size >= 4) {\\n bytes memory errorId = LowLevelCallUtils.readReturnData(0, 4);\\n // Offchain lookup. Decode the revert message and create our own that nests it.\\n bytes memory revertData = LowLevelCallUtils.readReturnData(\\n 4,\\n size - 4\\n );\\n if (bytes4(errorId) == OffchainLookup.selector) {\\n (\\n address wrappedSender,\\n string[] memory wrappedUrls,\\n bytes memory wrappedCallData,\\n bytes4 wrappedCallbackFunction,\\n bytes memory wrappedExtraData\\n ) = abi.decode(\\n revertData,\\n (address, string[], bytes, bytes4, bytes)\\n );\\n if (wrappedSender == target) {\\n returnData = abi.encode(\\n OffchainLookupCallData(\\n wrappedSender,\\n wrappedUrls,\\n wrappedCallData\\n )\\n );\\n extraData = OffchainLookupExtraData(\\n wrappedCallbackFunction,\\n wrappedExtraData\\n );\\n return (true, returnData, extraData, false);\\n }\\n } else {\\n returnData = revertData;\\n return (false, returnData, extraData, false);\\n }\\n }\\n }\\n\\n /**\\n * @dev Finds a resolver by recursively querying the registry, starting at the longest name and progressively\\n * removing labels until it finds a result.\\n * @param name The name to resolve, in DNS-encoded and normalised form.\\n * @return resolver The Resolver responsible for this name.\\n * @return namehash The namehash of the full name.\\n * @return finalOffset The offset of the first label with a resolver.\\n */\\n function findResolver(\\n bytes calldata name\\n ) public view returns (Resolver, bytes32, uint256) {\\n (\\n address resolver,\\n bytes32 namehash,\\n uint256 finalOffset\\n ) = findResolver(name, 0);\\n return (Resolver(resolver), namehash, finalOffset);\\n }\\n\\n function findResolver(\\n bytes calldata name,\\n uint256 offset\\n ) internal view returns (address, bytes32, uint256) {\\n uint256 labelLength = uint256(uint8(name[offset]));\\n if (labelLength == 0) {\\n return (address(0), bytes32(0), offset);\\n }\\n uint256 nextLabel = offset + labelLength + 1;\\n bytes32 labelHash;\\n if (\\n labelLength == 66 &&\\n // 0x5b == '['\\n name[offset + 1] == 0x5b &&\\n // 0x5d == ']'\\n name[nextLabel - 1] == 0x5d\\n ) {\\n // Encrypted label\\n (labelHash, ) = bytes(name[offset + 2:nextLabel - 1])\\n .hexStringToBytes32(0, 64);\\n } else {\\n labelHash = keccak256(name[offset + 1:nextLabel]);\\n }\\n (\\n address parentresolver,\\n bytes32 parentnode,\\n uint256 parentoffset\\n ) = findResolver(name, nextLabel);\\n bytes32 node = keccak256(abi.encodePacked(parentnode, labelHash));\\n address resolver = registry.resolver(node);\\n if (resolver != address(0)) {\\n return (resolver, node, offset);\\n }\\n return (parentresolver, node, parentoffset);\\n }\\n\\n function _hasExtendedResolver(\\n address resolver\\n ) internal view returns (bool) {\\n try\\n Resolver(resolver).supportsInterface{gas: 50000}(\\n type(IExtendedResolver).interfaceId\\n )\\n returns (bool supported) {\\n return supported;\\n } catch {\\n return false;\\n }\\n }\\n\\n function _multicall(\\n MulticallData memory multicallData\\n ) internal view returns (bytes[] memory results) {\\n uint256 length = multicallData.data.length;\\n uint256 offchainCount = 0;\\n OffchainLookupCallData[]\\n memory callDatas = new OffchainLookupCallData[](length);\\n OffchainLookupExtraData[]\\n memory extraDatas = new OffchainLookupExtraData[](length);\\n results = new bytes[](length);\\n bool isCallback = multicallData.name.length == 0;\\n bool hasExtendedResolver = _hasExtendedResolver(multicallData.resolver);\\n\\n require(\\n !multicallData.isWildcard || hasExtendedResolver,\\n \\\"UniversalResolver: Wildcard on non-extended resolvers is not supported\\\"\\n );\\n\\n for (uint256 i = 0; i < length; i++) {\\n bytes memory item = multicallData.data[i];\\n bool failure = multicallData.failures[i];\\n if (failure) {\\n results[i] = item;\\n continue;\\n }\\n if (!isCallback && hasExtendedResolver) {\\n item = abi.encodeCall(\\n IExtendedResolver.resolve,\\n (multicallData.name, item)\\n );\\n }\\n (\\n bool offchain,\\n bytes memory returnData,\\n OffchainLookupExtraData memory extraData,\\n bool success\\n ) = callWithOffchainLookupPropagation(multicallData.resolver, item);\\n\\n if (offchain) {\\n callDatas[offchainCount] = abi.decode(\\n returnData,\\n (OffchainLookupCallData)\\n );\\n extraDatas[i] = extraData;\\n offchainCount += 1;\\n continue;\\n }\\n\\n if (success && hasExtendedResolver) {\\n // if this is a successful resolve() call, unwrap the result\\n returnData = abi.decode(returnData, (bytes));\\n }\\n results[i] = returnData;\\n extraDatas[i].data = multicallData.data[i];\\n }\\n\\n if (offchainCount == 0) {\\n return results;\\n }\\n\\n // Trim callDatas if offchain data exists\\n assembly {\\n mstore(callDatas, offchainCount)\\n }\\n\\n revert OffchainLookup(\\n address(this),\\n multicallData.gateways,\\n abi.encodeWithSelector(BatchGateway.query.selector, callDatas),\\n multicallData.callbackFunction,\\n abi.encode(\\n multicallData.isWildcard,\\n multicallData.resolver,\\n multicallData.gateways,\\n multicallData.metaData,\\n extraDatas\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0x737ecb5a0ef64c6da8eab2f466382e9aeee045020343be0cd77c9309cd9597b1\",\"license\":\"MIT\"},\"contracts/wrapper/BytesUtils.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nlibrary BytesUtils {\\n /*\\n * @dev Returns the keccak-256 hash of a byte range.\\n * @param self The byte string to hash.\\n * @param offset The position to start hashing at.\\n * @param len The number of bytes to hash.\\n * @return The hash of the byte range.\\n */\\n function keccak(\\n bytes memory self,\\n uint256 offset,\\n uint256 len\\n ) internal pure returns (bytes32 ret) {\\n require(offset + len <= self.length);\\n assembly {\\n ret := keccak256(add(add(self, 32), offset), len)\\n }\\n }\\n\\n /**\\n * @dev Returns the ENS namehash of a DNS-encoded name.\\n * @param self The DNS-encoded name to hash.\\n * @param offset The offset at which to start hashing.\\n * @return The namehash of the name.\\n */\\n function namehash(\\n bytes memory self,\\n uint256 offset\\n ) internal pure returns (bytes32) {\\n (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);\\n if (labelhash == bytes32(0)) {\\n require(offset == self.length - 1, \\\"namehash: Junk at end of name\\\");\\n return bytes32(0);\\n }\\n return\\n keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));\\n }\\n\\n /**\\n * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.\\n * @param self The byte string to read a label from.\\n * @param idx The index to read a label at.\\n * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.\\n * @return newIdx The index of the start of the next label.\\n */\\n function readLabel(\\n bytes memory self,\\n uint256 idx\\n ) internal pure returns (bytes32 labelhash, uint256 newIdx) {\\n require(idx < self.length, \\\"readLabel: Index out of bounds\\\");\\n uint256 len = uint256(uint8(self[idx]));\\n if (len > 0) {\\n labelhash = keccak(self, idx + 1, len);\\n } else {\\n labelhash = bytes32(0);\\n }\\n newIdx = idx + len + 1;\\n }\\n}\\n\",\"keccak256\":\"0xf862cd86d749158a554e3cb517efa9097331ec0cf7225117f21e96fb50c67edb\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162003868380380620038688339810160408190526200003491620001da565b6200003f336200006a565b6001600160a01b038216608052805162000061906001906020840190620000ba565b5050506200049c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000105579160200282015b82811115620001055782518290620000f49082620003d0565b5091602001919060010190620000db565b506200011392915062000117565b5090565b80821115620001135760006200012e828262000138565b5060010162000117565b508054620001469062000341565b6000825580601f1062000157575050565b601f0160209004906000526020600020908101906200017791906200017a565b50565b5b808211156200011357600081556001016200017b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620001d257620001d262000191565b604052919050565b6000806040808486031215620001ef57600080fd5b83516001600160a01b03811681146200020757600080fd5b602085810151919450906001600160401b03808211156200022757600080fd5b8187019150601f88818401126200023d57600080fd5b82518281111562000252576200025262000191565b8060051b62000263868201620001a7565b918252848101860191868101908c8411156200027e57600080fd5b87870192505b838310156200032e578251868111156200029e5760008081fd5b8701603f81018e13620002b15760008081fd5b8881015187811115620002c857620002c862000191565b620002db818801601f19168b01620001a7565b8181528f8c838501011115620002f15760008081fd5b60005b8281101562000311578381018d01518282018d01528b01620002f4565b5060009181018b0191909152835250918701919087019062000284565b8099505050505050505050509250929050565b600181811c908216806200035657607f821691505b6020821081036200037757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003cb57600081815260208120601f850160051c81016020861015620003a65750805b601f850160051c820191505b81811015620003c757828155600101620003b2565b5050505b505050565b81516001600160401b03811115620003ec57620003ec62000191565b6200040481620003fd845462000341565b846200037d565b602080601f8311600181146200043c5760008415620004235750858301515b600019600386901b1c1916600185901b178555620003c7565b600085815260208120601f198616915b828110156200046d578886015182559484019460019091019084016200044c565b50858210156200048c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516133a9620004bf600039600081816101ea01526113f401526133a96000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80638e5ea8df116100b2578063b241d0d311610081578063e0a8541211610066578063e0a85412146102ec578063ec11c823146102ff578063f2fde38b1461031257600080fd5b8063b241d0d3146102c6578063b4a85801146102d957600080fd5b80638e5ea8df146102485780639061b9231461025b578063a1cbcbaf1461026e578063a6b16419146102a657600080fd5b8063715018a6116101095780637b103999116100ee5780637b103999146101e55780638da5cb5b146102245780638e25a0f31461023557600080fd5b8063715018a6146101c857806376286c00146101d257600080fd5b806301ffc9a71461013b5780630667cfea14610163578063206c74c9146101845780636dc4fb73146101a5575b600080fd5b61014e610149366004612187565b610325565b60405190151581526020015b60405180910390f35b6101766101713660046123ae565b61035c565b60405161015a92919061248c565b610197610192366004612537565b610391565b60405161015a9291906125a0565b6101b86101b3366004612615565b61047e565b60405161015a9493929190612681565b6101d061054b565b005b6101976101e03660046126bd565b61055f565b61020c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161015a565b6000546001600160a01b031661020c565b61017661024336600461271c565b610587565b6101d06102563660046127e2565b61061d565b61017661026936600461281f565b61063c565b61028161027c36600461287e565b610735565b604080516001600160a01b03909416845260208401929092529082015260600161015a565b6102b96102b43660046128c0565b61075b565b60405161015a91906128d9565b6101b86102d43660046128ec565b610807565b6101976102e7366004612615565b6108f8565b6101766102fa366004612615565b61093c565b6101b861030d36600461287e565b6109a0565b6101d0610320366004612960565b610a95565b60006001600160e01b03198216639061b92360e01b148061035657506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060006103848686868663e0a8541260e01b60405180602001604052806000815250610587565b9150915094509492505050565b606060006104728585856001805480602002602001604051908101604052809291908181526020016000905b828210156104695783829060005260206000200180546103dc9061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546104089061297d565b80156104555780601f1061042a57610100808354040283529160200191610455565b820191906000526020600020905b81548152906001019060200180831161043857829003601f168201915b5050505050815260200190600101906103bd565b5050505061055f565b91509150935093915050565b6060600080808080808061049c8c8c8c8c636dc4fb7360e01b610b2a565b935093509350935060008151111561050e57600080828060200190518101906104c591906129fc565b915091506000866000815181106104de576104de612a4e565b60200260200101518060200190518101906104f99190612a64565b929a5091985096509294506105409350505050565b6105338460008151811061052457610524612a4e565b60200260200101518484610eb0565b9750975097509750505050505b945094509450949050565b610553611011565b61055d600061106b565b565b606060006103848686868663b4a8580160e01b604051806020016040528060008152506110d3565b6040805160018082528183019092526060916000918291816020015b60608152602001906001900390816105a357905050905086816000815181106105ce576105ce612a4e565b60200260200101819052506000806105ea8b8b858b8b8b6110d3565b915091508160008151811061060157610601612a4e565b602002602001015181945094505050505b965096945050505050565b610625611011565b80516106389060019060208401906120b4565b5050565b606060006104728585856001805480602002602001604051908101604052809291908181526020016000905b828210156107145783829060005260206000200180546106879061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546106b39061297d565b80156107005780601f106106d557610100808354040283529160200191610700565b820191906000526020600020905b8154815290600101906020018083116106e357829003601f168201915b505050505081526020019060010190610668565b5050505063e0a8541260e01b60405180602001604052806000815250610587565b60008060008060008061074a888860006111ed565b919750955093505050509250925092565b6001818154811061076b57600080fd5b9060005260206000200160009150905080546107869061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546107b29061297d565b80156107ff5780601f106107d4576101008083540402835291602001916107ff565b820191906000526020600020905b8154815290600101906020018083116107e257829003601f168201915b505050505081565b6060600080600080610853600089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061149b9050565b60405160240161086591815260200190565b60408051601f19818403018152918152602080830180516001600160e01b03167f691f3431000000000000000000000000000000000000000000000000000000001790528151908101909152600080825291925081906108d5908b908b9086908c90636dc4fb7360e01b90610587565b915091506108e482828a610eb0565b965096509650965050505093509350935093565b60606000808061092b888888887fb4a8580100000000000000000000000000000000000000000000000000000000610b2a565b50919a909950975050505050505050565b60606000808061096f888888887fe0a8541200000000000000000000000000000000000000000000000000000000610b2a565b5050915091508160008151811061098857610988612a4e565b60200260200101518193509350505094509492505050565b60606000806000610a8386866001805480602002602001604051908101604052809291908181526020016000905b82821015610a7a5783829060005260206000200180546109ed9061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a199061297d565b8015610a665780601f10610a3b57610100808354040283529160200191610a66565b820191906000526020600020905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200190600101906109ce565b50505050610807565b93509350935093505b92959194509250565b610a9d611011565b6001600160a01b038116610b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610b278161106b565b50565b60606000606080610b8e60405180610100016040528060608152602001606081526020016060815260200160006001600160e01b031916815260200160001515815260200160006001600160a01b0316815260200160608152602001606081525090565b6001600160e01b031986166060820152600080610bad8b8d018d612a8f565b90925090506060610bc08a8c018c612b47565b60c089019190915260408801919091526001600160a01b0390911660a08701529015156080860152805183519192501015610bfa57600080fd5b805167ffffffffffffffff811115610c1457610c146121f4565b604051908082528060200260200182016040528015610c4757816020015b6060815260200190600190039081610c325790505b506020850152805167ffffffffffffffff811115610c6757610c676121f4565b604051908082528060200260200182016040528015610c90578160200160208202803683370190505b5060e08501526000805b8251811015610e7e578251600090849083908110610cba57610cba612a4e565b6020026020010151600001516001600160e01b03191603610d1957828181518110610ce757610ce7612a4e565b60200260200101516020015186602001518281518110610d0957610d09612a4e565b6020026020010181905250610e6c565b848281518110610d2b57610d2b612a4e565b602002602001015115610da25760018660e001518281518110610d5057610d50612a4e565b602002602001019015159081151581525050838281518110610d7457610d74612a4e565b602002602001015186602001518281518110610d9257610d92612a4e565b6020026020010181905250610e5e565b828181518110610db457610db4612a4e565b602002602001015160000151848381518110610dd257610dd2612a4e565b6020026020010151848381518110610dec57610dec612a4e565b602002602001015160200151604051602401610e09929190612ccb565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505086602001518281518110610e5257610e52612a4e565b60200260200101819052505b610e69826001612d0f565b91505b80610e7681612d22565b915050610c9a565b50610e888561155a565b8560a0015186604001518760c001519850985098509850505050505095509550955095915050565b606060008060008087806020019051810190610ecc9190612d3b565b9050600080610eda83611a04565b91509150600081604051602401610ef391815260200190565b60408051601f19818403018152918152602080830180516001600160e01b03167f3b3b57de000000000000000000000000000000000000000000000000000000001790529051919250600091610f4d9187918e910161248c565b6040516020818303038152906040529050600080306001600160a01b0316638e25a0f387868f636dc4fb7360e01b886040518663ffffffff1660e01b8152600401610f9c959493929190612dc8565b600060405180830381865afa158015610fb9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fe191908101906129fc565b91509150600082806020019051810190610ffb9190612a64565b979f979e50909b50959950505050505050505050565b6000546001600160a01b0316331461055d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b15565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060008060006110e48a8a610735565b919450849350909150506001600160a01b0382166111085750600091506106129050565b604080516101206020601f8d01819004028201810190925261010081018b8152831515926111dd929182918f908f9081908501838280828437600092019190915250505090825250602081018c9052604081018b90526001600160e01b03198a16606082015283151560808201526001600160a01b03871660a082015260c081018990528b5160e09091019067ffffffffffffffff8111156111ac576111ac6121f4565b6040519080825280602002602001820160405280156111d5578160200160208202803683370190505b50905261155a565b9450505050965096945050505050565b60008060008086868681811061120557611205612a4e565b919091013560f81c9150506000819003611229575060009250829150839050611492565b60006112358287612d0f565b611240906001612d0f565b905060008260421480156112865750888861125c896001612d0f565b81811061126b5761126b612a4e565b9050013560f81c60f81b6001600160f81b031916605b60f81b145b80156112c45750888861129a600185612e31565b8181106112a9576112a9612a4e565b9050013560f81c60f81b6001600160f81b031916605d60f81b145b1561133c57611334600060408b8b6112dd8c6002612d0f565b906112e9600189612e31565b926112f693929190612e44565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929493925050611c2d9050565b50905061136e565b8888611349896001612d0f565b61135592859290612e44565b604051611363929190612e6e565b604051809103902090505b600080600061137e8c8c876111ed565b925092509250600082856040516020016113a2929190918252602082015260400190565b60408051601f198184030181529082905280516020909101207f0178b8bf0000000000000000000000000000000000000000000000000000000082526004820181905291506000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630178b8bf90602401602060405180830381865afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145f9190612a64565b90506001600160a01b03811615611483579950975089965061149295505050505050565b50929850919650909450505050505b93509350939050565b60008060006114aa8585611cfe565b90925090508161151c57600185516114c29190612e31565b84146115105760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d650000006044820152606401610b15565b50600091506103569050565b611526858261149b565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6020810151516060906000808267ffffffffffffffff81111561157f5761157f6121f4565b6040519080825280602002602001820160405280156115dd57816020015b6115ca604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b81526020019060019003908161159d5790505b50905060008367ffffffffffffffff8111156115fb576115fb6121f4565b60405190808252806020026020018201604052801561164157816020015b6040805180820190915260008152606060208201528152602001906001900390816116195790505b5090508367ffffffffffffffff81111561165d5761165d6121f4565b60405190808252806020026020018201604052801561169057816020015b606081526020019060019003908161167b5790505b5086515160a088015191965015906000906116aa90611db5565b9050876080015115806116ba5750805b6117525760405162461bcd60e51b815260206004820152604660248201527f556e6976657273616c5265736f6c7665723a2057696c6463617264206f6e206e60448201527f6f6e2d657874656e646564207265736f6c76657273206973206e6f742073757060648201527f706f727465640000000000000000000000000000000000000000000000000000608482015260a401610b15565b60005b868110156119425760008960200151828151811061177557611775612a4e565b6020026020010151905060008a60e00151838151811061179757611797612a4e565b6020026020010151905080156117cc57818a84815181106117ba576117ba612a4e565b60200260200101819052505050611930565b841580156117d75750835b1561181d578a516040516117f091908490602401612ccb565b60408051601f198184030181529190526020810180516001600160e01b0316639061b92360e01b17905291505b6000806000806118318f60a0015187611e30565b935093509350935083156118a657828060200190518101906118539190612efe565b8b8d8151811061186557611865612a4e565b6020026020010181905250818a888151811061188357611883612a4e565b602090810291909101015261189960018d612d0f565b9b50505050505050611930565b8080156118b05750875b156118cc57828060200190518101906118c99190612d3b565b92505b828e88815181106118df576118df612a4e565b60200260200101819052508e60200151878151811061190057611900612a4e565b60200260200101518a888151811061191a5761191a612a4e565b6020026020010151602001819052505050505050505b8061193a81612d22565b915050611755565b508460000361195657505050505050919050565b84845230886040015163a780bab660e01b866040516024016119789190612ff9565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050508a606001518b608001518c60a001518d604001518e60c001518a6040516020016119d995949392919061305b565b60408051601f1981840301815290829052630556f18360e41b8252610b159594939291600401613118565b805160609060009081908490611a1b816002612d0f565b67ffffffffffffffff811115611a3357611a336121f4565b6040519080825280601f01601f191660200182016040528015611a5d576020820181803683370190505b50945060009350808403611aa257600060f81b85600081518110611a8357611a83612a4e565b60200101906001600160f81b031916908160001a905350505050915091565b60001981015b828181518110611aba57611aba612a4e565b01602001517fff00000000000000000000000000000000000000000000000000000000000000167f2e0000000000000000000000000000000000000000000000000000000000000003611b7c578360f81b868260010181518110611b2057611b20612a4e565b60200101906001600160f81b031916908160001a90535084611b49846001840160ff8816611fa9565b60408051602081019390935282015260600160405160208183030381529060405280519060200120945060009350611bcc565b600184019350828181518110611b9457611b94612a4e565b602001015160f81c60f81b868260010181518110611bb457611bb4612a4e565b60200101906001600160f81b031916908160001a9053505b8015611bdb5760001901611aa8565b5083611bec83600060ff8716611fa9565b6040805160208101939093528201526060016040516020818303038152906040528051906020012093508260f81b85600081518110611a8357611a83612a4e565b8251600090600190831115611c4157600080fd5b611c92565b6000603a8210602f83111615611c5e5750602f190190565b60478210604083111615611c7457506036190190565b60678210606083111615611c8a57506056190190565b5060ff919050565b60208501845b84811015611cf457611caf8183015160001a611c46565b611cc16001830184015160001a611c46565b60ff811460ff83141715611cda57600094505050611cf4565b60049190911b1760089490941b9390931792600201611c98565b5050935093915050565b60008083518310611d515760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e647300006044820152606401610b15565b6000848481518110611d6557611d65612a4e565b016020015160f81c90508015611d9157611d8a85611d84866001612d0f565b83611fa9565b9250611d96565b600092505b611da08185612d0f565b611dab906001612d0f565b9150509250929050565b6040516301ffc9a760e01b8152639061b92360e01b60048201526000906001600160a01b038316906301ffc9a79061c350906024016020604051808303818786fa93505050508015611e24575060408051601f3d908101601f19168201909252611e219181019061314c565b60015b61035657506000919050565b60408051808201909152600080825260606020830181905290916000611e568686611fcd565b90503d8115611e7c576000611e6c60008361205f565b909550935060019150610a8c9050565b60048110611f9f576000611e926000600461205f565b90506000611eaa6004611ea58186612e31565b61205f565b9050630556f18360e41b611ebd83613169565b6001600160e01b03191603611f8b57600080600080600085806020019051810190611ee891906131a1565b945094509450945094508d6001600160a01b0316856001600160a01b031603611f81576040518060600160405280866001600160a01b0316815260200185815260200184815250604051602001611f3f9190613251565b60408051601f198184030181528282019091526001600160e01b03199093168152602081019190915260019b50909950975060009650610a8c95505050505050565b5050505050611f9c565b600096509450859250610a8c915050565b50505b5092959194509250565b8251600090611fb88385612d0f565b1115611fc357600080fd5b5091016020012090565b60006001600160a01b0383163b61204c5760405162461bcd60e51b815260206004820152602e60248201527f4c6f774c6576656c43616c6c5574696c733a207374617469632063616c6c207460448201527f6f206e6f6e2d636f6e74726163740000000000000000000000000000000000006064820152608401610b15565b600080835160208501865afa9392505050565b60608167ffffffffffffffff81111561207a5761207a6121f4565b6040519080825280601f01601f1916602001820160405280156120a4576020820181803683370190505b5090508183602083013e92915050565b8280548282559060005260206000209081019282156120fa579160200282015b828111156120fa57825182906120ea90826132b3565b50916020019190600101906120d4565b5061210692915061210a565b5090565b8082111561210657600061211e8282612127565b5060010161210a565b5080546121339061297d565b6000825580601f10612143575050565b601f016020900490600052602060002090810190610b2791905b80821115612106576000815560010161215d565b6001600160e01b031981168114610b2757600080fd5b60006020828403121561219957600080fd5b81356121a481612171565b9392505050565b60008083601f8401126121bd57600080fd5b50813567ffffffffffffffff8111156121d557600080fd5b6020830191508360208285010111156121ed57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561222d5761222d6121f4565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561225c5761225c6121f4565b604052919050565b600067ffffffffffffffff82111561227e5761227e6121f4565b50601f01601f191660200190565b600061229f61229a84612264565b612233565b90508281528383830111156122b357600080fd5b828260208301376000602084830101529392505050565b600082601f8301126122db57600080fd5b6121a48383356020850161228c565b600067ffffffffffffffff821115612304576123046121f4565b5060051b60200190565b600082601f83011261231f57600080fd5b8135602061232f61229a836122ea565b82815260059290921b8401810191818101908684111561234e57600080fd5b8286015b848110156123a357803567ffffffffffffffff8111156123725760008081fd5b8701603f810189136123845760008081fd5b61239589868301356040840161228c565b845250918301918301612352565b509695505050505050565b600080600080606085870312156123c457600080fd5b843567ffffffffffffffff808211156123dc57600080fd5b6123e8888389016121ab565b9096509450602087013591508082111561240157600080fd5b61240d888389016122ca565b9350604087013591508082111561242357600080fd5b506124308782880161230e565b91505092959194509250565b60005b8381101561245757818101518382015260200161243f565b50506000910152565b6000815180845261247881602086016020860161243c565b601f01601f19169290920160200192915050565b60408152600061249f6040830185612460565b90506001600160a01b03831660208301529392505050565b600082601f8301126124c857600080fd5b813560206124d861229a836122ea565b82815260059290921b840181019181810190868411156124f757600080fd5b8286015b848110156123a357803567ffffffffffffffff81111561251b5760008081fd5b6125298986838b01016122ca565b8452509183019183016124fb565b60008060006040848603121561254c57600080fd5b833567ffffffffffffffff8082111561256457600080fd5b612570878388016121ab565b9095509350602086013591508082111561258957600080fd5b50612596868287016124b7565b9150509250925092565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b838110156125f757605f198887030185526125e5868351612460565b955093820193908201906001016125c9565b50508394506001600160a01b03871681870152505050509392505050565b6000806000806040858703121561262b57600080fd5b843567ffffffffffffffff8082111561264357600080fd5b61264f888389016121ab565b9096509450602087013591508082111561266857600080fd5b50612675878288016121ab565b95989497509550505050565b6080815260006126946080830187612460565b6001600160a01b0395861660208401529385166040830152509216606090920191909152919050565b600080600080606085870312156126d357600080fd5b843567ffffffffffffffff808211156126eb57600080fd5b6126f7888389016121ab565b9096509450602087013591508082111561271057600080fd5b61240d888389016124b7565b60008060008060008060a0878903121561273557600080fd5b863567ffffffffffffffff8082111561274d57600080fd5b6127598a838b016121ab565b9098509650602089013591508082111561277257600080fd5b61277e8a838b016122ca565b9550604089013591508082111561279457600080fd5b6127a08a838b0161230e565b9450606089013591506127b282612171565b909250608088013590808211156127c857600080fd5b506127d589828a016122ca565b9150509295509295509295565b6000602082840312156127f457600080fd5b813567ffffffffffffffff81111561280b57600080fd5b6128178482850161230e565b949350505050565b60008060006040848603121561283457600080fd5b833567ffffffffffffffff8082111561284c57600080fd5b612858878388016121ab565b9095509350602086013591508082111561287157600080fd5b50612596868287016122ca565b6000806020838503121561289157600080fd5b823567ffffffffffffffff8111156128a857600080fd5b6128b4858286016121ab565b90969095509350505050565b6000602082840312156128d257600080fd5b5035919050565b6020815260006121a46020830184612460565b60008060006040848603121561290157600080fd5b833567ffffffffffffffff8082111561291957600080fd5b612925878388016121ab565b9095509350602086013591508082111561293e57600080fd5b506125968682870161230e565b6001600160a01b0381168114610b2757600080fd5b60006020828403121561297257600080fd5b81356121a48161294b565b600181811c9082168061299157607f821691505b6020821081036129b157634e487b7160e01b600052602260045260246000fd5b50919050565b600082601f8301126129c857600080fd5b81516129d661229a82612264565b8181528460208386010111156129eb57600080fd5b61281782602083016020870161243c565b60008060408385031215612a0f57600080fd5b825167ffffffffffffffff811115612a2657600080fd5b612a32858286016129b7565b9250506020830151612a438161294b565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612a7657600080fd5b81516121a48161294b565b8015158114610b2757600080fd5b60008060408385031215612aa257600080fd5b823567ffffffffffffffff80821115612aba57600080fd5b818501915085601f830112612ace57600080fd5b81356020612ade61229a836122ea565b82815260059290921b84018101918181019089841115612afd57600080fd5b948201945b83861015612b24578535612b1581612a81565b82529482019490820190612b02565b96505086013592505080821115612b3a57600080fd5b50611dab858286016124b7565b600080600080600060a08688031215612b5f57600080fd5b612b698635612a81565b85359450612b7a602087013561294b565b6020860135935067ffffffffffffffff8060408801351115612b9b57600080fd5b612bab886040890135890161230e565b93508060608801351115612bbe57600080fd5b612bce88606089013589016122ca565b92508060808801351115612be157600080fd5b6080870135870188601f820112612bf757600080fd5b612c0461229a82356122ea565b81358082526020808301929160051b8401018b1015612c2257600080fd5b602083015b6020843560051b850101811015612cb9578481351115612c4657600080fd5b803584016040818e03601f19011215612c5e57600080fd5b612c6661220a565b612c736020830135612171565b602082013581528660408301351115612c8b57600080fd5b612c9e8e602060408501358501016122ca565b60208201528085525050602083019250602081019050612c27565b50809450505050509295509295909350565b604081526000612cde6040830185612460565b8281036020840152612cf08185612460565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561035657610356612cf9565b600060018201612d3457612d34612cf9565b5060010190565b600060208284031215612d4d57600080fd5b815167ffffffffffffffff811115612d6457600080fd5b612817848285016129b7565b600082825180855260208086019550808260051b84010181860160005b84811015612dbb57601f19868403018952612da9838351612460565b98840198925090830190600101612d8d565b5090979650505050505050565b60a081526000612ddb60a0830188612460565b8281036020840152612ded8188612460565b90508281036040840152612e018187612d70565b90506001600160e01b0319851660608401528281036080840152612e258185612460565b98975050505050505050565b8181038181111561035657610356612cf9565b60008085851115612e5457600080fd5b83861115612e6157600080fd5b5050820193919092039150565b8183823760009101908152919050565b600082601f830112612e8f57600080fd5b81516020612e9f61229a836122ea565b82815260059290921b84018101918181019086841115612ebe57600080fd5b8286015b848110156123a357805167ffffffffffffffff811115612ee25760008081fd5b612ef08986838b01016129b7565b845250918301918301612ec2565b600060208284031215612f1057600080fd5b815167ffffffffffffffff80821115612f2857600080fd5b9083019060608286031215612f3c57600080fd5b604051606081018181108382111715612f5757612f576121f4565b6040528251612f658161294b565b8152602083015182811115612f7957600080fd5b612f8587828601612e7e565b602083015250604083015182811115612f9d57600080fd5b612fa9878286016129b7565b60408301525095945050505050565b6001600160a01b0381511682526000602082015160606020850152612fe06060850182612d70565b905060408301518482036040860152612cf08282612460565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561304e57603f1988860301845261303c858351612fb8565b94509285019290850190600101613020565b5092979650505050505050565b8515158152600060206001600160a01b03871681840152604060a08185015261308760a0850188612d70565b84810360608601526130998188612460565b905084810360808601528086518083528483019150848160051b84010185890160005b8381101561310557858303601f19018552815180516001600160e01b03191684528801518884018890526130f288850182612460565b95890195935050908701906001016130bc565b50909d9c50505050505050505050505050565b6001600160a01b038616815260a06020820152600061313a60a0830187612d70565b8281036040840152612e018187612460565b60006020828403121561315e57600080fd5b81516121a481612a81565b6000815160208301516001600160e01b0319808216935060048310156131995780818460040360031b1b83161693505b505050919050565b600080600080600060a086880312156131b957600080fd5b85516131c48161294b565b602087015190955067ffffffffffffffff808211156131e257600080fd5b6131ee89838a01612e7e565b9550604088015191508082111561320457600080fd5b61321089838a016129b7565b94506060880151915061322282612171565b60808801519193508082111561323757600080fd5b50613244888289016129b7565b9150509295509295909350565b6020815260006121a46020830184612fb8565b601f8211156132ae57600081815260208120601f850160051c8101602086101561328b5750805b601f850160051c820191505b818110156132aa57828155600101613297565b5050505b505050565b815167ffffffffffffffff8111156132cd576132cd6121f4565b6132e1816132db845461297d565b84613264565b602080601f83116001811461331657600084156132fe5750858301515b600019600386901b1c1916600185901b1785556132aa565b600085815260208120601f198616915b8281101561334557888601518255948401946001909101908401613326565b50858210156133635787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220c75a929088eba339e8efd5544f5405265d4fcf80b2ff6979b74bf7f1e4398c6f64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101365760003560e01c80638e5ea8df116100b2578063b241d0d311610081578063e0a8541211610066578063e0a85412146102ec578063ec11c823146102ff578063f2fde38b1461031257600080fd5b8063b241d0d3146102c6578063b4a85801146102d957600080fd5b80638e5ea8df146102485780639061b9231461025b578063a1cbcbaf1461026e578063a6b16419146102a657600080fd5b8063715018a6116101095780637b103999116100ee5780637b103999146101e55780638da5cb5b146102245780638e25a0f31461023557600080fd5b8063715018a6146101c857806376286c00146101d257600080fd5b806301ffc9a71461013b5780630667cfea14610163578063206c74c9146101845780636dc4fb73146101a5575b600080fd5b61014e610149366004612187565b610325565b60405190151581526020015b60405180910390f35b6101766101713660046123ae565b61035c565b60405161015a92919061248c565b610197610192366004612537565b610391565b60405161015a9291906125a0565b6101b86101b3366004612615565b61047e565b60405161015a9493929190612681565b6101d061054b565b005b6101976101e03660046126bd565b61055f565b61020c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161015a565b6000546001600160a01b031661020c565b61017661024336600461271c565b610587565b6101d06102563660046127e2565b61061d565b61017661026936600461281f565b61063c565b61028161027c36600461287e565b610735565b604080516001600160a01b03909416845260208401929092529082015260600161015a565b6102b96102b43660046128c0565b61075b565b60405161015a91906128d9565b6101b86102d43660046128ec565b610807565b6101976102e7366004612615565b6108f8565b6101766102fa366004612615565b61093c565b6101b861030d36600461287e565b6109a0565b6101d0610320366004612960565b610a95565b60006001600160e01b03198216639061b92360e01b148061035657506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060006103848686868663e0a8541260e01b60405180602001604052806000815250610587565b9150915094509492505050565b606060006104728585856001805480602002602001604051908101604052809291908181526020016000905b828210156104695783829060005260206000200180546103dc9061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546104089061297d565b80156104555780601f1061042a57610100808354040283529160200191610455565b820191906000526020600020905b81548152906001019060200180831161043857829003601f168201915b5050505050815260200190600101906103bd565b5050505061055f565b91509150935093915050565b6060600080808080808061049c8c8c8c8c636dc4fb7360e01b610b2a565b935093509350935060008151111561050e57600080828060200190518101906104c591906129fc565b915091506000866000815181106104de576104de612a4e565b60200260200101518060200190518101906104f99190612a64565b929a5091985096509294506105409350505050565b6105338460008151811061052457610524612a4e565b60200260200101518484610eb0565b9750975097509750505050505b945094509450949050565b610553611011565b61055d600061106b565b565b606060006103848686868663b4a8580160e01b604051806020016040528060008152506110d3565b6040805160018082528183019092526060916000918291816020015b60608152602001906001900390816105a357905050905086816000815181106105ce576105ce612a4e565b60200260200101819052506000806105ea8b8b858b8b8b6110d3565b915091508160008151811061060157610601612a4e565b602002602001015181945094505050505b965096945050505050565b610625611011565b80516106389060019060208401906120b4565b5050565b606060006104728585856001805480602002602001604051908101604052809291908181526020016000905b828210156107145783829060005260206000200180546106879061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546106b39061297d565b80156107005780601f106106d557610100808354040283529160200191610700565b820191906000526020600020905b8154815290600101906020018083116106e357829003601f168201915b505050505081526020019060010190610668565b5050505063e0a8541260e01b60405180602001604052806000815250610587565b60008060008060008061074a888860006111ed565b919750955093505050509250925092565b6001818154811061076b57600080fd5b9060005260206000200160009150905080546107869061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546107b29061297d565b80156107ff5780601f106107d4576101008083540402835291602001916107ff565b820191906000526020600020905b8154815290600101906020018083116107e257829003601f168201915b505050505081565b6060600080600080610853600089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061149b9050565b60405160240161086591815260200190565b60408051601f19818403018152918152602080830180516001600160e01b03167f691f3431000000000000000000000000000000000000000000000000000000001790528151908101909152600080825291925081906108d5908b908b9086908c90636dc4fb7360e01b90610587565b915091506108e482828a610eb0565b965096509650965050505093509350935093565b60606000808061092b888888887fb4a8580100000000000000000000000000000000000000000000000000000000610b2a565b50919a909950975050505050505050565b60606000808061096f888888887fe0a8541200000000000000000000000000000000000000000000000000000000610b2a565b5050915091508160008151811061098857610988612a4e565b60200260200101518193509350505094509492505050565b60606000806000610a8386866001805480602002602001604051908101604052809291908181526020016000905b82821015610a7a5783829060005260206000200180546109ed9061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a199061297d565b8015610a665780601f10610a3b57610100808354040283529160200191610a66565b820191906000526020600020905b815481529060010190602001808311610a4957829003601f168201915b5050505050815260200190600101906109ce565b50505050610807565b93509350935093505b92959194509250565b610a9d611011565b6001600160a01b038116610b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610b278161106b565b50565b60606000606080610b8e60405180610100016040528060608152602001606081526020016060815260200160006001600160e01b031916815260200160001515815260200160006001600160a01b0316815260200160608152602001606081525090565b6001600160e01b031986166060820152600080610bad8b8d018d612a8f565b90925090506060610bc08a8c018c612b47565b60c089019190915260408801919091526001600160a01b0390911660a08701529015156080860152805183519192501015610bfa57600080fd5b805167ffffffffffffffff811115610c1457610c146121f4565b604051908082528060200260200182016040528015610c4757816020015b6060815260200190600190039081610c325790505b506020850152805167ffffffffffffffff811115610c6757610c676121f4565b604051908082528060200260200182016040528015610c90578160200160208202803683370190505b5060e08501526000805b8251811015610e7e578251600090849083908110610cba57610cba612a4e565b6020026020010151600001516001600160e01b03191603610d1957828181518110610ce757610ce7612a4e565b60200260200101516020015186602001518281518110610d0957610d09612a4e565b6020026020010181905250610e6c565b848281518110610d2b57610d2b612a4e565b602002602001015115610da25760018660e001518281518110610d5057610d50612a4e565b602002602001019015159081151581525050838281518110610d7457610d74612a4e565b602002602001015186602001518281518110610d9257610d92612a4e565b6020026020010181905250610e5e565b828181518110610db457610db4612a4e565b602002602001015160000151848381518110610dd257610dd2612a4e565b6020026020010151848381518110610dec57610dec612a4e565b602002602001015160200151604051602401610e09929190612ccb565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505086602001518281518110610e5257610e52612a4e565b60200260200101819052505b610e69826001612d0f565b91505b80610e7681612d22565b915050610c9a565b50610e888561155a565b8560a0015186604001518760c001519850985098509850505050505095509550955095915050565b606060008060008087806020019051810190610ecc9190612d3b565b9050600080610eda83611a04565b91509150600081604051602401610ef391815260200190565b60408051601f19818403018152918152602080830180516001600160e01b03167f3b3b57de000000000000000000000000000000000000000000000000000000001790529051919250600091610f4d9187918e910161248c565b6040516020818303038152906040529050600080306001600160a01b0316638e25a0f387868f636dc4fb7360e01b886040518663ffffffff1660e01b8152600401610f9c959493929190612dc8565b600060405180830381865afa158015610fb9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fe191908101906129fc565b91509150600082806020019051810190610ffb9190612a64565b979f979e50909b50959950505050505050505050565b6000546001600160a01b0316331461055d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b15565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060008060006110e48a8a610735565b919450849350909150506001600160a01b0382166111085750600091506106129050565b604080516101206020601f8d01819004028201810190925261010081018b8152831515926111dd929182918f908f9081908501838280828437600092019190915250505090825250602081018c9052604081018b90526001600160e01b03198a16606082015283151560808201526001600160a01b03871660a082015260c081018990528b5160e09091019067ffffffffffffffff8111156111ac576111ac6121f4565b6040519080825280602002602001820160405280156111d5578160200160208202803683370190505b50905261155a565b9450505050965096945050505050565b60008060008086868681811061120557611205612a4e565b919091013560f81c9150506000819003611229575060009250829150839050611492565b60006112358287612d0f565b611240906001612d0f565b905060008260421480156112865750888861125c896001612d0f565b81811061126b5761126b612a4e565b9050013560f81c60f81b6001600160f81b031916605b60f81b145b80156112c45750888861129a600185612e31565b8181106112a9576112a9612a4e565b9050013560f81c60f81b6001600160f81b031916605d60f81b145b1561133c57611334600060408b8b6112dd8c6002612d0f565b906112e9600189612e31565b926112f693929190612e44565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929493925050611c2d9050565b50905061136e565b8888611349896001612d0f565b61135592859290612e44565b604051611363929190612e6e565b604051809103902090505b600080600061137e8c8c876111ed565b925092509250600082856040516020016113a2929190918252602082015260400190565b60408051601f198184030181529082905280516020909101207f0178b8bf0000000000000000000000000000000000000000000000000000000082526004820181905291506000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630178b8bf90602401602060405180830381865afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145f9190612a64565b90506001600160a01b03811615611483579950975089965061149295505050505050565b50929850919650909450505050505b93509350939050565b60008060006114aa8585611cfe565b90925090508161151c57600185516114c29190612e31565b84146115105760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d650000006044820152606401610b15565b50600091506103569050565b611526858261149b565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6020810151516060906000808267ffffffffffffffff81111561157f5761157f6121f4565b6040519080825280602002602001820160405280156115dd57816020015b6115ca604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b81526020019060019003908161159d5790505b50905060008367ffffffffffffffff8111156115fb576115fb6121f4565b60405190808252806020026020018201604052801561164157816020015b6040805180820190915260008152606060208201528152602001906001900390816116195790505b5090508367ffffffffffffffff81111561165d5761165d6121f4565b60405190808252806020026020018201604052801561169057816020015b606081526020019060019003908161167b5790505b5086515160a088015191965015906000906116aa90611db5565b9050876080015115806116ba5750805b6117525760405162461bcd60e51b815260206004820152604660248201527f556e6976657273616c5265736f6c7665723a2057696c6463617264206f6e206e60448201527f6f6e2d657874656e646564207265736f6c76657273206973206e6f742073757060648201527f706f727465640000000000000000000000000000000000000000000000000000608482015260a401610b15565b60005b868110156119425760008960200151828151811061177557611775612a4e565b6020026020010151905060008a60e00151838151811061179757611797612a4e565b6020026020010151905080156117cc57818a84815181106117ba576117ba612a4e565b60200260200101819052505050611930565b841580156117d75750835b1561181d578a516040516117f091908490602401612ccb565b60408051601f198184030181529190526020810180516001600160e01b0316639061b92360e01b17905291505b6000806000806118318f60a0015187611e30565b935093509350935083156118a657828060200190518101906118539190612efe565b8b8d8151811061186557611865612a4e565b6020026020010181905250818a888151811061188357611883612a4e565b602090810291909101015261189960018d612d0f565b9b50505050505050611930565b8080156118b05750875b156118cc57828060200190518101906118c99190612d3b565b92505b828e88815181106118df576118df612a4e565b60200260200101819052508e60200151878151811061190057611900612a4e565b60200260200101518a888151811061191a5761191a612a4e565b6020026020010151602001819052505050505050505b8061193a81612d22565b915050611755565b508460000361195657505050505050919050565b84845230886040015163a780bab660e01b866040516024016119789190612ff9565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050508a606001518b608001518c60a001518d604001518e60c001518a6040516020016119d995949392919061305b565b60408051601f1981840301815290829052630556f18360e41b8252610b159594939291600401613118565b805160609060009081908490611a1b816002612d0f565b67ffffffffffffffff811115611a3357611a336121f4565b6040519080825280601f01601f191660200182016040528015611a5d576020820181803683370190505b50945060009350808403611aa257600060f81b85600081518110611a8357611a83612a4e565b60200101906001600160f81b031916908160001a905350505050915091565b60001981015b828181518110611aba57611aba612a4e565b01602001517fff00000000000000000000000000000000000000000000000000000000000000167f2e0000000000000000000000000000000000000000000000000000000000000003611b7c578360f81b868260010181518110611b2057611b20612a4e565b60200101906001600160f81b031916908160001a90535084611b49846001840160ff8816611fa9565b60408051602081019390935282015260600160405160208183030381529060405280519060200120945060009350611bcc565b600184019350828181518110611b9457611b94612a4e565b602001015160f81c60f81b868260010181518110611bb457611bb4612a4e565b60200101906001600160f81b031916908160001a9053505b8015611bdb5760001901611aa8565b5083611bec83600060ff8716611fa9565b6040805160208101939093528201526060016040516020818303038152906040528051906020012093508260f81b85600081518110611a8357611a83612a4e565b8251600090600190831115611c4157600080fd5b611c92565b6000603a8210602f83111615611c5e5750602f190190565b60478210604083111615611c7457506036190190565b60678210606083111615611c8a57506056190190565b5060ff919050565b60208501845b84811015611cf457611caf8183015160001a611c46565b611cc16001830184015160001a611c46565b60ff811460ff83141715611cda57600094505050611cf4565b60049190911b1760089490941b9390931792600201611c98565b5050935093915050565b60008083518310611d515760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e647300006044820152606401610b15565b6000848481518110611d6557611d65612a4e565b016020015160f81c90508015611d9157611d8a85611d84866001612d0f565b83611fa9565b9250611d96565b600092505b611da08185612d0f565b611dab906001612d0f565b9150509250929050565b6040516301ffc9a760e01b8152639061b92360e01b60048201526000906001600160a01b038316906301ffc9a79061c350906024016020604051808303818786fa93505050508015611e24575060408051601f3d908101601f19168201909252611e219181019061314c565b60015b61035657506000919050565b60408051808201909152600080825260606020830181905290916000611e568686611fcd565b90503d8115611e7c576000611e6c60008361205f565b909550935060019150610a8c9050565b60048110611f9f576000611e926000600461205f565b90506000611eaa6004611ea58186612e31565b61205f565b9050630556f18360e41b611ebd83613169565b6001600160e01b03191603611f8b57600080600080600085806020019051810190611ee891906131a1565b945094509450945094508d6001600160a01b0316856001600160a01b031603611f81576040518060600160405280866001600160a01b0316815260200185815260200184815250604051602001611f3f9190613251565b60408051601f198184030181528282019091526001600160e01b03199093168152602081019190915260019b50909950975060009650610a8c95505050505050565b5050505050611f9c565b600096509450859250610a8c915050565b50505b5092959194509250565b8251600090611fb88385612d0f565b1115611fc357600080fd5b5091016020012090565b60006001600160a01b0383163b61204c5760405162461bcd60e51b815260206004820152602e60248201527f4c6f774c6576656c43616c6c5574696c733a207374617469632063616c6c207460448201527f6f206e6f6e2d636f6e74726163740000000000000000000000000000000000006064820152608401610b15565b600080835160208501865afa9392505050565b60608167ffffffffffffffff81111561207a5761207a6121f4565b6040519080825280601f01601f1916602001820160405280156120a4576020820181803683370190505b5090508183602083013e92915050565b8280548282559060005260206000209081019282156120fa579160200282015b828111156120fa57825182906120ea90826132b3565b50916020019190600101906120d4565b5061210692915061210a565b5090565b8082111561210657600061211e8282612127565b5060010161210a565b5080546121339061297d565b6000825580601f10612143575050565b601f016020900490600052602060002090810190610b2791905b80821115612106576000815560010161215d565b6001600160e01b031981168114610b2757600080fd5b60006020828403121561219957600080fd5b81356121a481612171565b9392505050565b60008083601f8401126121bd57600080fd5b50813567ffffffffffffffff8111156121d557600080fd5b6020830191508360208285010111156121ed57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561222d5761222d6121f4565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561225c5761225c6121f4565b604052919050565b600067ffffffffffffffff82111561227e5761227e6121f4565b50601f01601f191660200190565b600061229f61229a84612264565b612233565b90508281528383830111156122b357600080fd5b828260208301376000602084830101529392505050565b600082601f8301126122db57600080fd5b6121a48383356020850161228c565b600067ffffffffffffffff821115612304576123046121f4565b5060051b60200190565b600082601f83011261231f57600080fd5b8135602061232f61229a836122ea565b82815260059290921b8401810191818101908684111561234e57600080fd5b8286015b848110156123a357803567ffffffffffffffff8111156123725760008081fd5b8701603f810189136123845760008081fd5b61239589868301356040840161228c565b845250918301918301612352565b509695505050505050565b600080600080606085870312156123c457600080fd5b843567ffffffffffffffff808211156123dc57600080fd5b6123e8888389016121ab565b9096509450602087013591508082111561240157600080fd5b61240d888389016122ca565b9350604087013591508082111561242357600080fd5b506124308782880161230e565b91505092959194509250565b60005b8381101561245757818101518382015260200161243f565b50506000910152565b6000815180845261247881602086016020860161243c565b601f01601f19169290920160200192915050565b60408152600061249f6040830185612460565b90506001600160a01b03831660208301529392505050565b600082601f8301126124c857600080fd5b813560206124d861229a836122ea565b82815260059290921b840181019181810190868411156124f757600080fd5b8286015b848110156123a357803567ffffffffffffffff81111561251b5760008081fd5b6125298986838b01016122ca565b8452509183019183016124fb565b60008060006040848603121561254c57600080fd5b833567ffffffffffffffff8082111561256457600080fd5b612570878388016121ab565b9095509350602086013591508082111561258957600080fd5b50612596868287016124b7565b9150509250925092565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b838110156125f757605f198887030185526125e5868351612460565b955093820193908201906001016125c9565b50508394506001600160a01b03871681870152505050509392505050565b6000806000806040858703121561262b57600080fd5b843567ffffffffffffffff8082111561264357600080fd5b61264f888389016121ab565b9096509450602087013591508082111561266857600080fd5b50612675878288016121ab565b95989497509550505050565b6080815260006126946080830187612460565b6001600160a01b0395861660208401529385166040830152509216606090920191909152919050565b600080600080606085870312156126d357600080fd5b843567ffffffffffffffff808211156126eb57600080fd5b6126f7888389016121ab565b9096509450602087013591508082111561271057600080fd5b61240d888389016124b7565b60008060008060008060a0878903121561273557600080fd5b863567ffffffffffffffff8082111561274d57600080fd5b6127598a838b016121ab565b9098509650602089013591508082111561277257600080fd5b61277e8a838b016122ca565b9550604089013591508082111561279457600080fd5b6127a08a838b0161230e565b9450606089013591506127b282612171565b909250608088013590808211156127c857600080fd5b506127d589828a016122ca565b9150509295509295509295565b6000602082840312156127f457600080fd5b813567ffffffffffffffff81111561280b57600080fd5b6128178482850161230e565b949350505050565b60008060006040848603121561283457600080fd5b833567ffffffffffffffff8082111561284c57600080fd5b612858878388016121ab565b9095509350602086013591508082111561287157600080fd5b50612596868287016122ca565b6000806020838503121561289157600080fd5b823567ffffffffffffffff8111156128a857600080fd5b6128b4858286016121ab565b90969095509350505050565b6000602082840312156128d257600080fd5b5035919050565b6020815260006121a46020830184612460565b60008060006040848603121561290157600080fd5b833567ffffffffffffffff8082111561291957600080fd5b612925878388016121ab565b9095509350602086013591508082111561293e57600080fd5b506125968682870161230e565b6001600160a01b0381168114610b2757600080fd5b60006020828403121561297257600080fd5b81356121a48161294b565b600181811c9082168061299157607f821691505b6020821081036129b157634e487b7160e01b600052602260045260246000fd5b50919050565b600082601f8301126129c857600080fd5b81516129d661229a82612264565b8181528460208386010111156129eb57600080fd5b61281782602083016020870161243c565b60008060408385031215612a0f57600080fd5b825167ffffffffffffffff811115612a2657600080fd5b612a32858286016129b7565b9250506020830151612a438161294b565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612a7657600080fd5b81516121a48161294b565b8015158114610b2757600080fd5b60008060408385031215612aa257600080fd5b823567ffffffffffffffff80821115612aba57600080fd5b818501915085601f830112612ace57600080fd5b81356020612ade61229a836122ea565b82815260059290921b84018101918181019089841115612afd57600080fd5b948201945b83861015612b24578535612b1581612a81565b82529482019490820190612b02565b96505086013592505080821115612b3a57600080fd5b50611dab858286016124b7565b600080600080600060a08688031215612b5f57600080fd5b612b698635612a81565b85359450612b7a602087013561294b565b6020860135935067ffffffffffffffff8060408801351115612b9b57600080fd5b612bab886040890135890161230e565b93508060608801351115612bbe57600080fd5b612bce88606089013589016122ca565b92508060808801351115612be157600080fd5b6080870135870188601f820112612bf757600080fd5b612c0461229a82356122ea565b81358082526020808301929160051b8401018b1015612c2257600080fd5b602083015b6020843560051b850101811015612cb9578481351115612c4657600080fd5b803584016040818e03601f19011215612c5e57600080fd5b612c6661220a565b612c736020830135612171565b602082013581528660408301351115612c8b57600080fd5b612c9e8e602060408501358501016122ca565b60208201528085525050602083019250602081019050612c27565b50809450505050509295509295909350565b604081526000612cde6040830185612460565b8281036020840152612cf08185612460565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561035657610356612cf9565b600060018201612d3457612d34612cf9565b5060010190565b600060208284031215612d4d57600080fd5b815167ffffffffffffffff811115612d6457600080fd5b612817848285016129b7565b600082825180855260208086019550808260051b84010181860160005b84811015612dbb57601f19868403018952612da9838351612460565b98840198925090830190600101612d8d565b5090979650505050505050565b60a081526000612ddb60a0830188612460565b8281036020840152612ded8188612460565b90508281036040840152612e018187612d70565b90506001600160e01b0319851660608401528281036080840152612e258185612460565b98975050505050505050565b8181038181111561035657610356612cf9565b60008085851115612e5457600080fd5b83861115612e6157600080fd5b5050820193919092039150565b8183823760009101908152919050565b600082601f830112612e8f57600080fd5b81516020612e9f61229a836122ea565b82815260059290921b84018101918181019086841115612ebe57600080fd5b8286015b848110156123a357805167ffffffffffffffff811115612ee25760008081fd5b612ef08986838b01016129b7565b845250918301918301612ec2565b600060208284031215612f1057600080fd5b815167ffffffffffffffff80821115612f2857600080fd5b9083019060608286031215612f3c57600080fd5b604051606081018181108382111715612f5757612f576121f4565b6040528251612f658161294b565b8152602083015182811115612f7957600080fd5b612f8587828601612e7e565b602083015250604083015182811115612f9d57600080fd5b612fa9878286016129b7565b60408301525095945050505050565b6001600160a01b0381511682526000602082015160606020850152612fe06060850182612d70565b905060408301518482036040860152612cf08282612460565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561304e57603f1988860301845261303c858351612fb8565b94509285019290850190600101613020565b5092979650505050505050565b8515158152600060206001600160a01b03871681840152604060a08185015261308760a0850188612d70565b84810360608601526130998188612460565b905084810360808601528086518083528483019150848160051b84010185890160005b8381101561310557858303601f19018552815180516001600160e01b03191684528801518884018890526130f288850182612460565b95890195935050908701906001016130bc565b50909d9c50505050505050505050505050565b6001600160a01b038616815260a06020820152600061313a60a0830187612d70565b8281036040840152612e018187612460565b60006020828403121561315e57600080fd5b81516121a481612a81565b6000815160208301516001600160e01b0319808216935060048310156131995780818460040360031b1b83161693505b505050919050565b600080600080600060a086880312156131b957600080fd5b85516131c48161294b565b602087015190955067ffffffffffffffff808211156131e257600080fd5b6131ee89838a01612e7e565b9550604088015191508082111561320457600080fd5b61321089838a016129b7565b94506060880151915061322282612171565b60808801519193508082111561323757600080fd5b50613244888289016129b7565b9150509295509295909350565b6020815260006121a46020830184612fb8565b601f8211156132ae57600081815260208120601f850160051c8101602086101561328b5750805b601f850160051c820191505b818110156132aa57828155600101613297565b5050505b505050565b815167ffffffffffffffff8111156132cd576132cd6121f4565b6132e1816132db845461297d565b84613264565b602080601f83116001811461331657600084156132fe5750858301515b600019600386901b1c1916600185901b1785556132aa565b600085815260208120601f198616915b8281101561334557888601518255948401946001909101908401613326565b50858210156133635787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220c75a929088eba339e8efd5544f5405265d4fcf80b2ff6979b74bf7f1e4398c6f64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "findResolver(bytes)": { + "details": "Finds a resolver by recursively querying the registry, starting at the longest name and progressively removing labels until it finds a result.", + "params": { + "name": "The name to resolve, in DNS-encoded and normalised form." + }, + "returns": { + "_0": "resolver The Resolver responsible for this name.", + "_1": "namehash The namehash of the full name.", + "_2": "finalOffset The offset of the first label with a resolver." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "resolve(bytes,bytes)": { + "details": "Performs ENS name resolution for the supplied name and resolution data.", + "params": { + "data": "The resolution data, as specified in ENSIP-10.", + "name": "The name to resolve, in normalised and DNS-encoded form." + }, + "returns": { + "_0": "The result of resolving the name." + } + }, + "reverse(bytes,string[])": { + "details": "Performs ENS name reverse resolution for the supplied reverse name.", + "params": { + "reverseName": "The reverse name to resolve, in normalised and DNS-encoded form. e.g. b6E040C9ECAaE172a89bD561c5F73e1C48d28cd9.addr.reverse" + }, + "returns": { + "_0": "The resolved name, the resolved address, the reverse resolver address, and the resolver address." + } + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "notice": "The Universal Resolver is a contract that handles the work of resolving a name entirely onchain, making it possible to make a single smart contract call to resolve an ENS name.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 444, + "contract": "contracts/utils/UniversalResolver.sol:UniversalResolver", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 18487, + "contract": "contracts/utils/UniversalResolver.sol:UniversalResolver", + "label": "batchGatewayURLs", + "offset": 0, + "slot": "1", + "type": "t_array(t_string_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/d9c9257453e2e2db50b4d0f9157288b3.json b/deployments/sepolia/solcInputs/d9c9257453e2e2db50b4d0f9157288b3.json new file mode 100644 index 00000000..c3d20f53 --- /dev/null +++ b/deployments/sepolia/solcInputs/d9c9257453e2e2db50b4d0f9157288b3.json @@ -0,0 +1,431 @@ +{ + "language": "Solidity", + "sources": { + "@ensdomains/buffer/contracts/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}\n" + }, + "@ensdomains/solsha1/contracts/SHA1.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary SHA1 {\n event Debug(bytes32 x);\n\n function sha1(bytes memory data) internal pure returns(bytes20 ret) {\n assembly {\n // Get a safe scratch location\n let scratch := mload(0x40)\n\n // Get the data length, and point data at the first byte\n let len := mload(data)\n data := add(data, 32)\n\n // Find the length after padding\n let totallen := add(and(add(len, 1), 0xFFFFFFFFFFFFFFC0), 64)\n switch lt(sub(totallen, len), 9)\n case 1 { totallen := add(totallen, 64) }\n\n let h := 0x6745230100EFCDAB890098BADCFE001032547600C3D2E1F0\n\n function readword(ptr, off, count) -> result {\n result := 0\n if lt(off, count) {\n result := mload(add(ptr, off))\n count := sub(count, off)\n if lt(count, 32) {\n let mask := not(sub(exp(256, sub(32, count)), 1))\n result := and(result, mask)\n }\n }\n }\n\n for { let i := 0 } lt(i, totallen) { i := add(i, 64) } {\n mstore(scratch, readword(data, i, len))\n mstore(add(scratch, 32), readword(data, add(i, 32), len))\n\n // If we loaded the last byte, store the terminator byte\n switch lt(sub(len, i), 64)\n case 1 { mstore8(add(scratch, sub(len, i)), 0x80) }\n\n // If this is the last block, store the length\n switch eq(i, sub(totallen, 64))\n case 1 { mstore(add(scratch, 32), or(mload(add(scratch, 32)), mul(len, 8))) }\n\n // Expand the 16 32-bit words into 80\n for { let j := 64 } lt(j, 128) { j := add(j, 12) } {\n let temp := xor(xor(mload(add(scratch, sub(j, 12))), mload(add(scratch, sub(j, 32)))), xor(mload(add(scratch, sub(j, 56))), mload(add(scratch, sub(j, 64)))))\n temp := or(and(mul(temp, 2), 0xFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFE), and(div(temp, 0x80000000), 0x0000000100000001000000010000000100000001000000010000000100000001))\n mstore(add(scratch, j), temp)\n }\n for { let j := 128 } lt(j, 320) { j := add(j, 24) } {\n let temp := xor(xor(mload(add(scratch, sub(j, 24))), mload(add(scratch, sub(j, 64)))), xor(mload(add(scratch, sub(j, 112))), mload(add(scratch, sub(j, 128)))))\n temp := or(and(mul(temp, 4), 0xFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFC), and(div(temp, 0x40000000), 0x0000000300000003000000030000000300000003000000030000000300000003))\n mstore(add(scratch, j), temp)\n }\n\n let x := h\n let f := 0\n let k := 0\n for { let j := 0 } lt(j, 80) { j := add(j, 1) } {\n switch div(j, 20)\n case 0 {\n // f = d xor (b and (c xor d))\n f := xor(div(x, 0x100000000000000000000), div(x, 0x10000000000))\n f := and(div(x, 0x1000000000000000000000000000000), f)\n f := xor(div(x, 0x10000000000), f)\n k := 0x5A827999\n }\n case 1{\n // f = b xor c xor d\n f := xor(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := xor(div(x, 0x10000000000), f)\n k := 0x6ED9EBA1\n }\n case 2 {\n // f = (b and c) or (d and (b or c))\n f := or(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := and(div(x, 0x10000000000), f)\n f := or(and(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000)), f)\n k := 0x8F1BBCDC\n }\n case 3 {\n // f = b xor c xor d\n f := xor(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := xor(div(x, 0x10000000000), f)\n k := 0xCA62C1D6\n }\n // temp = (a leftrotate 5) + f + e + k + w[i]\n let temp := and(div(x, 0x80000000000000000000000000000000000000000000000), 0x1F)\n temp := or(and(div(x, 0x800000000000000000000000000000000000000), 0xFFFFFFE0), temp)\n temp := add(f, temp)\n temp := add(and(x, 0xFFFFFFFF), temp)\n temp := add(k, temp)\n temp := add(div(mload(add(scratch, mul(j, 4))), 0x100000000000000000000000000000000000000000000000000000000), temp)\n x := or(div(x, 0x10000000000), mul(temp, 0x10000000000000000000000000000000000000000))\n x := or(and(x, 0xFFFFFFFF00FFFFFFFF000000000000FFFFFFFF00FFFFFFFF), mul(or(and(div(x, 0x4000000000000), 0xC0000000), and(div(x, 0x400000000000000000000), 0x3FFFFFFF)), 0x100000000000000000000))\n }\n\n h := and(add(h, x), 0xFFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF)\n }\n ret := mul(or(or(or(or(and(div(h, 0x100000000), 0xFFFFFFFF00000000000000000000000000000000), and(div(h, 0x1000000), 0xFFFFFFFF000000000000000000000000)), and(div(h, 0x10000), 0xFFFFFFFF0000000000000000)), and(div(h, 0x100), 0xFFFFFFFF00000000)), and(h, 0xFFFFFFFF)), 0x1000000000000000000000000)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "contracts/dnsregistrar/DNSClaimChecker.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../utils/HexUtils.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\nlibrary DNSClaimChecker {\n using BytesUtils for bytes;\n using HexUtils for bytes;\n using RRUtils for *;\n using Buffer for Buffer.buffer;\n\n uint16 constant CLASS_INET = 1;\n uint16 constant TYPE_TXT = 16;\n\n function getOwnerAddress(\n bytes memory name,\n bytes memory data\n ) internal pure returns (address, bool) {\n // Add \"_ens.\" to the front of the name.\n Buffer.buffer memory buf;\n buf.init(name.length + 5);\n buf.append(\"\\x04_ens\");\n buf.append(name);\n\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n if (iter.name().compareNames(buf.buf) != 0) continue;\n bool found;\n address addr;\n (addr, found) = parseRR(data, iter.rdataOffset, iter.nextOffset);\n if (found) {\n return (addr, true);\n }\n }\n\n return (address(0x0), false);\n }\n\n function parseRR(\n bytes memory rdata,\n uint256 idx,\n uint256 endIdx\n ) internal pure returns (address, bool) {\n while (idx < endIdx) {\n uint256 len = rdata.readUint8(idx);\n idx += 1;\n\n bool found;\n address addr;\n (addr, found) = parseString(rdata, idx, len);\n\n if (found) return (addr, true);\n idx += len;\n }\n\n return (address(0x0), false);\n }\n\n function parseString(\n bytes memory str,\n uint256 idx,\n uint256 len\n ) internal pure returns (address, bool) {\n // TODO: More robust parsing that handles whitespace and multiple key/value pairs\n if (str.readUint32(idx) != 0x613d3078) return (address(0x0), false); // 0x613d3078 == 'a=0x'\n return str.hexToAddress(idx + 4, idx + len);\n }\n}\n" + }, + "contracts/dnsregistrar/DNSRegistrar.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../registry/ENSRegistry.sol\";\nimport \"../root/Root.sol\";\nimport \"../resolvers/profiles/AddrResolver.sol\";\nimport \"./DNSClaimChecker.sol\";\nimport \"./PublicSuffixList.sol\";\nimport \"./IDNSRegistrar.sol\";\n\n/**\n * @dev An ENS registrar that allows the owner of a DNS name to claim the\n * corresponding name in ENS.\n */\ncontract DNSRegistrar is IDNSRegistrar, IERC165 {\n using BytesUtils for bytes;\n using Buffer for Buffer.buffer;\n using RRUtils for *;\n\n ENS public immutable ens;\n DNSSEC public immutable oracle;\n PublicSuffixList public suffixes;\n address public immutable previousRegistrar;\n address public immutable resolver;\n // A mapping of the most recent signatures seen for each claimed domain.\n mapping(bytes32 => uint32) public inceptions;\n\n error NoOwnerRecordFound();\n error PermissionDenied(address caller, address owner);\n error PreconditionNotMet();\n error StaleProof();\n error InvalidPublicSuffix(bytes name);\n\n struct OwnerRecord {\n bytes name;\n address owner;\n address resolver;\n uint64 ttl;\n }\n\n event Claim(\n bytes32 indexed node,\n address indexed owner,\n bytes dnsname,\n uint32 inception\n );\n event NewPublicSuffixList(address suffixes);\n\n constructor(\n address _previousRegistrar,\n address _resolver,\n DNSSEC _dnssec,\n PublicSuffixList _suffixes,\n ENS _ens\n ) {\n previousRegistrar = _previousRegistrar;\n resolver = _resolver;\n oracle = _dnssec;\n suffixes = _suffixes;\n emit NewPublicSuffixList(address(suffixes));\n ens = _ens;\n }\n\n /**\n * @dev This contract's owner-only functions can be invoked by the owner of the ENS root.\n */\n modifier onlyOwner() {\n Root root = Root(ens.owner(bytes32(0)));\n address owner = root.owner();\n require(msg.sender == owner);\n _;\n }\n\n function setPublicSuffixList(PublicSuffixList _suffixes) public onlyOwner {\n suffixes = _suffixes;\n emit NewPublicSuffixList(address(suffixes));\n }\n\n /**\n * @dev Submits proofs to the DNSSEC oracle, then claims a name using those proofs.\n * @param name The name to claim, in DNS wire format.\n * @param input A chain of signed DNS RRSETs ending with a text record.\n */\n function proveAndClaim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) public override {\n (bytes32 rootNode, bytes32 labelHash, address addr) = _claim(\n name,\n input\n );\n ens.setSubnodeOwner(rootNode, labelHash, addr);\n }\n\n function proveAndClaimWithResolver(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input,\n address resolver,\n address addr\n ) public override {\n (bytes32 rootNode, bytes32 labelHash, address owner) = _claim(\n name,\n input\n );\n if (msg.sender != owner) {\n revert PermissionDenied(msg.sender, owner);\n }\n ens.setSubnodeRecord(rootNode, labelHash, owner, resolver, 0);\n if (addr != address(0)) {\n if (resolver == address(0)) {\n revert PreconditionNotMet();\n }\n bytes32 node = keccak256(abi.encodePacked(rootNode, labelHash));\n // Set the resolver record\n AddrResolver(resolver).setAddr(node, addr);\n }\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure override returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IDNSRegistrar).interfaceId;\n }\n\n function _claim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) internal returns (bytes32 parentNode, bytes32 labelHash, address addr) {\n (bytes memory data, uint32 inception) = oracle.verifyRRSet(input);\n\n // Get the first label\n uint256 labelLen = name.readUint8(0);\n labelHash = name.keccak(1, labelLen);\n\n bytes memory parentName = name.substring(\n labelLen + 1,\n name.length - labelLen - 1\n );\n\n // Make sure the parent name is enabled\n parentNode = enableNode(parentName);\n\n bytes32 node = keccak256(abi.encodePacked(parentNode, labelHash));\n if (!RRUtils.serialNumberGte(inception, inceptions[node])) {\n revert StaleProof();\n }\n inceptions[node] = inception;\n\n bool found;\n (addr, found) = DNSClaimChecker.getOwnerAddress(name, data);\n if (!found) {\n revert NoOwnerRecordFound();\n }\n\n emit Claim(node, addr, name, inception);\n }\n\n function enableNode(bytes memory domain) public returns (bytes32 node) {\n // Name must be in the public suffix list.\n if (!suffixes.isPublicSuffix(domain)) {\n revert InvalidPublicSuffix(domain);\n }\n return _enableNode(domain, 0);\n }\n\n function _enableNode(\n bytes memory domain,\n uint256 offset\n ) internal returns (bytes32 node) {\n uint256 len = domain.readUint8(offset);\n if (len == 0) {\n return bytes32(0);\n }\n\n bytes32 parentNode = _enableNode(domain, offset + len + 1);\n bytes32 label = domain.keccak(offset + 1, len);\n node = keccak256(abi.encodePacked(parentNode, label));\n address owner = ens.owner(node);\n if (owner == address(0) || owner == previousRegistrar) {\n if (parentNode == bytes32(0)) {\n Root root = Root(ens.owner(bytes32(0)));\n root.setSubnodeOwner(label, address(this));\n ens.setResolver(node, resolver);\n } else {\n ens.setSubnodeRecord(\n parentNode,\n label,\n address(this),\n resolver,\n 0\n );\n }\n } else if (owner != address(this)) {\n revert PreconditionNotMet();\n }\n return node;\n }\n}\n" + }, + "contracts/dnsregistrar/IDNSRegistrar.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/DNSSEC.sol\";\n\ninterface IDNSRegistrar {\n function proveAndClaim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) external;\n\n function proveAndClaimWithResolver(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input,\n address resolver,\n address addr\n ) external;\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyDnsRegistrarDNSSEC.sol": { + "content": "pragma solidity ^0.8.4;\n\ncontract DummyDNSSEC {\n uint16 expectedType;\n bytes expectedName;\n uint32 inception;\n uint64 inserted;\n bytes20 hash;\n\n function setData(\n uint16 _expectedType,\n bytes memory _expectedName,\n uint32 _inception,\n uint64 _inserted,\n bytes memory _proof\n ) public {\n expectedType = _expectedType;\n expectedName = _expectedName;\n inception = _inception;\n inserted = _inserted;\n if (_proof.length != 0) {\n hash = bytes20(keccak256(_proof));\n }\n }\n\n function rrdata(\n uint16 dnstype,\n bytes memory name\n ) public view returns (uint32, uint64, bytes20) {\n require(dnstype == expectedType);\n require(keccak256(name) == keccak256(expectedName));\n return (inception, inserted, hash);\n }\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyExtendedDNSSECResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../resolvers/profiles/IExtendedDNSResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract DummyExtendedDNSSECResolver is IExtendedDNSResolver, IERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) external pure override returns (bool) {\n return interfaceId == type(IExtendedDNSResolver).interfaceId;\n }\n\n function resolve(\n bytes memory /* name */,\n bytes memory /* data */,\n bytes memory context\n ) external view override returns (bytes memory) {\n return abi.encode(context);\n }\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyLegacyTextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../resolvers/profiles/ITextResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract DummyLegacyTextResolver is ITextResolver, IERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) external pure override returns (bool) {\n return interfaceId == type(ITextResolver).interfaceId;\n }\n\n function text(\n bytes32 /* node */,\n string calldata key\n ) external view override returns (string memory) {\n return key;\n }\n}\n" + }, + "contracts/dnsregistrar/OffchainDNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../contracts/resolvers/profiles/IAddrResolver.sol\";\nimport \"../../contracts/resolvers/profiles/IExtendedResolver.sol\";\nimport \"../../contracts/resolvers/profiles/IExtendedDNSResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../registry/ENSRegistry.sol\";\nimport \"../utils/HexUtils.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\ninterface IDNSGateway {\n function resolve(\n bytes memory name,\n uint16 qtype\n ) external returns (DNSSEC.RRSetWithSignature[] memory);\n}\n\nuint16 constant CLASS_INET = 1;\nuint16 constant TYPE_TXT = 16;\n\ncontract OffchainDNSResolver is IExtendedResolver {\n using RRUtils for *;\n using BytesUtils for bytes;\n using HexUtils for bytes;\n\n ENS public immutable ens;\n DNSSEC public immutable oracle;\n string public gatewayURL;\n\n error CouldNotResolve(bytes name);\n\n constructor(ENS _ens, DNSSEC _oracle, string memory _gatewayURL) {\n ens = _ens;\n oracle = _oracle;\n gatewayURL = _gatewayURL;\n }\n\n function resolve(\n bytes calldata name,\n bytes calldata data\n ) external view returns (bytes memory) {\n string[] memory urls = new string[](1);\n urls[0] = gatewayURL;\n\n revert OffchainLookup(\n address(this),\n urls,\n abi.encodeCall(IDNSGateway.resolve, (name, TYPE_TXT)),\n OffchainDNSResolver.resolveCallback.selector,\n abi.encode(name, data)\n );\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory) {\n (bytes memory name, bytes memory query) = abi.decode(\n extraData,\n (bytes, bytes)\n );\n DNSSEC.RRSetWithSignature[] memory rrsets = abi.decode(\n response,\n (DNSSEC.RRSetWithSignature[])\n );\n\n (bytes memory data, ) = oracle.verifyRRSet(rrsets);\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n // Ignore records with wrong name, type, or class\n bytes memory rrname = RRUtils.readName(iter.data, iter.offset);\n if (\n !rrname.equals(name) ||\n iter.class != CLASS_INET ||\n iter.dnstype != TYPE_TXT\n ) {\n continue;\n }\n\n // Look for a valid ENS-DNS TXT record\n (address dnsresolver, bytes memory context) = parseRR(\n iter.data,\n iter.rdataOffset,\n iter.nextOffset\n );\n\n // If we found a valid record, try to resolve it\n if (dnsresolver != address(0)) {\n if (\n IERC165(dnsresolver).supportsInterface(\n IExtendedDNSResolver.resolve.selector\n )\n ) {\n return\n IExtendedDNSResolver(dnsresolver).resolve(\n name,\n query,\n context\n );\n } else if (\n IERC165(dnsresolver).supportsInterface(\n IExtendedResolver.resolve.selector\n )\n ) {\n return IExtendedResolver(dnsresolver).resolve(name, query);\n } else {\n (bool ok, bytes memory ret) = address(dnsresolver)\n .staticcall(query);\n if (ok) {\n return ret;\n } else {\n revert CouldNotResolve(name);\n }\n }\n }\n }\n\n // No valid records; revert.\n revert CouldNotResolve(name);\n }\n\n function parseRR(\n bytes memory data,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address, bytes memory) {\n bytes memory txt = readTXT(data, idx, lastIdx);\n\n // Must start with the magic word\n if (txt.length < 5 || !txt.equals(0, \"ENS1 \", 0, 5)) {\n return (address(0), \"\");\n }\n\n // Parse the name or address\n uint256 lastTxtIdx = txt.find(5, txt.length - 5, \" \");\n if (lastTxtIdx > txt.length) {\n address dnsResolver = parseAndResolve(txt, 5, txt.length);\n return (dnsResolver, \"\");\n } else {\n address dnsResolver = parseAndResolve(txt, 5, lastTxtIdx);\n return (\n dnsResolver,\n txt.substring(lastTxtIdx + 1, txt.length - lastTxtIdx - 1)\n );\n }\n }\n\n function readTXT(\n bytes memory data,\n uint256 startIdx,\n uint256 lastIdx\n ) internal pure returns (bytes memory) {\n // TODO: Concatenate multiple text fields\n uint256 fieldLength = data.readUint8(startIdx);\n assert(startIdx + fieldLength < lastIdx);\n return data.substring(startIdx + 1, fieldLength);\n }\n\n function parseAndResolve(\n bytes memory nameOrAddress,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address) {\n if (nameOrAddress[idx] == \"0\" && nameOrAddress[idx + 1] == \"x\") {\n (address ret, bool valid) = nameOrAddress.hexToAddress(\n idx + 2,\n lastIdx\n );\n if (valid) {\n return ret;\n }\n }\n return resolveName(nameOrAddress, idx, lastIdx);\n }\n\n function resolveName(\n bytes memory name,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address) {\n bytes32 node = textNamehash(name, idx, lastIdx);\n address resolver = ens.resolver(node);\n if (resolver == address(0)) {\n return address(0);\n }\n return IAddrResolver(resolver).addr(node);\n }\n\n /**\n * @dev Namehash function that operates on dot-separated names (not dns-encoded names)\n * @param name Name to hash\n * @param idx Index to start at\n * @param lastIdx Index to end at\n */\n function textNamehash(\n bytes memory name,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (bytes32) {\n uint256 separator = name.find(idx, name.length - idx, bytes1(\".\"));\n bytes32 parentNode = bytes32(0);\n if (separator < lastIdx) {\n parentNode = textNamehash(name, separator + 1, lastIdx);\n } else {\n separator = lastIdx;\n }\n return\n keccak256(\n abi.encodePacked(parentNode, name.keccak(idx, separator - idx))\n );\n }\n}\n" + }, + "contracts/dnsregistrar/PublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\n\ninterface PublicSuffixList {\n function isPublicSuffix(bytes calldata name) external view returns (bool);\n}\n" + }, + "contracts/dnsregistrar/RecordParser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.11;\n\nimport \"../dnssec-oracle/BytesUtils.sol\";\n\nlibrary RecordParser {\n using BytesUtils for bytes;\n\n /**\n * @dev Parses a key-value record into a key and value.\n * @param input The input string\n * @param offset The offset to start reading at\n */\n function readKeyValue(\n bytes memory input,\n uint256 offset,\n uint256 len\n )\n internal\n pure\n returns (bytes memory key, bytes memory value, uint256 nextOffset)\n {\n uint256 separator = input.find(offset, len, \"=\");\n if (separator == type(uint256).max) {\n return (\"\", \"\", type(uint256).max);\n }\n\n uint256 terminator = input.find(\n separator,\n len + offset - separator,\n \" \"\n );\n if (terminator == type(uint256).max) {\n terminator = input.length;\n }\n\n key = input.substring(offset, separator - offset);\n value = input.substring(separator + 1, terminator - separator - 1);\n nextOffset = terminator + 1;\n }\n}\n" + }, + "contracts/dnsregistrar/SimplePublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nimport \"../root/Ownable.sol\";\nimport \"./PublicSuffixList.sol\";\n\ncontract SimplePublicSuffixList is PublicSuffixList, Ownable {\n mapping(bytes => bool) suffixes;\n\n function addPublicSuffixes(bytes[] memory names) public onlyOwner {\n for (uint256 i = 0; i < names.length; i++) {\n suffixes[names[i]] = true;\n }\n }\n\n function isPublicSuffix(\n bytes calldata name\n ) external view override returns (bool) {\n return suffixes[name];\n }\n}\n" + }, + "contracts/dnsregistrar/TLDPublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"./PublicSuffixList.sol\";\n\n/**\n * @dev A public suffix list that treats all TLDs as public suffixes.\n */\ncontract TLDPublicSuffixList is PublicSuffixList {\n using BytesUtils for bytes;\n\n function isPublicSuffix(\n bytes calldata name\n ) external view override returns (bool) {\n uint256 labellen = name.readUint8(0);\n return labellen > 0 && name.readUint8(labellen + 1) == 0;\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev An interface for contracts implementing a DNSSEC (signing) algorithm.\n */\ninterface Algorithm {\n /**\n * @dev Verifies a signature.\n * @param key The public key to verify with.\n * @param data The signed data to verify.\n * @param signature The signature to verify.\n * @return True iff the signature is valid.\n */\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata signature\n ) external view virtual returns (bool);\n}\n" + }, + "contracts/dnssec-oracle/algorithms/DummyAlgorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\n\n/**\n * @dev Implements a dummy DNSSEC (signing) algorithm that approves all\n * signatures, for testing.\n */\ncontract DummyAlgorithm is Algorithm {\n function verify(\n bytes calldata,\n bytes calldata,\n bytes calldata\n ) external view override returns (bool) {\n return true;\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/EllipticCurve.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @title EllipticCurve\n *\n * @author Tilman Drerup;\n *\n * @notice Implements elliptic curve math; Parametrized for SECP256R1.\n *\n * Includes components of code by Andreas Olofsson, Alexander Vlasov\n * (https://github.com/BANKEX/CurveArithmetics), and Avi Asayag\n * (https://github.com/orbs-network/elliptic-curve-solidity)\n *\n * Source: https://github.com/tdrerup/elliptic-curve-solidity\n *\n * @dev NOTE: To disambiguate public keys when verifying signatures, activate\n * condition 'rs[1] > lowSmax' in validateSignature().\n */\ncontract EllipticCurve {\n // Set parameters for curve.\n uint256 constant a =\n 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;\n uint256 constant b =\n 0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B;\n uint256 constant gx =\n 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296;\n uint256 constant gy =\n 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5;\n uint256 constant p =\n 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF;\n uint256 constant n =\n 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;\n\n uint256 constant lowSmax =\n 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0;\n\n /**\n * @dev Inverse of u in the field of modulo m.\n */\n function inverseMod(uint256 u, uint256 m) internal pure returns (uint256) {\n unchecked {\n if (u == 0 || u == m || m == 0) return 0;\n if (u > m) u = u % m;\n\n int256 t1;\n int256 t2 = 1;\n uint256 r1 = m;\n uint256 r2 = u;\n uint256 q;\n\n while (r2 != 0) {\n q = r1 / r2;\n (t1, t2, r1, r2) = (t2, t1 - int256(q) * t2, r2, r1 - q * r2);\n }\n\n if (t1 < 0) return (m - uint256(-t1));\n\n return uint256(t1);\n }\n }\n\n /**\n * @dev Transform affine coordinates into projective coordinates.\n */\n function toProjectivePoint(\n uint256 x0,\n uint256 y0\n ) internal pure returns (uint256[3] memory P) {\n P[2] = addmod(0, 1, p);\n P[0] = mulmod(x0, P[2], p);\n P[1] = mulmod(y0, P[2], p);\n }\n\n /**\n * @dev Add two points in affine coordinates and return projective point.\n */\n function addAndReturnProjectivePoint(\n uint256 x1,\n uint256 y1,\n uint256 x2,\n uint256 y2\n ) internal pure returns (uint256[3] memory P) {\n uint256 x;\n uint256 y;\n (x, y) = add(x1, y1, x2, y2);\n P = toProjectivePoint(x, y);\n }\n\n /**\n * @dev Transform from projective to affine coordinates.\n */\n function toAffinePoint(\n uint256 x0,\n uint256 y0,\n uint256 z0\n ) internal pure returns (uint256 x1, uint256 y1) {\n uint256 z0Inv;\n z0Inv = inverseMod(z0, p);\n x1 = mulmod(x0, z0Inv, p);\n y1 = mulmod(y0, z0Inv, p);\n }\n\n /**\n * @dev Return the zero curve in projective coordinates.\n */\n function zeroProj()\n internal\n pure\n returns (uint256 x, uint256 y, uint256 z)\n {\n return (0, 1, 0);\n }\n\n /**\n * @dev Return the zero curve in affine coordinates.\n */\n function zeroAffine() internal pure returns (uint256 x, uint256 y) {\n return (0, 0);\n }\n\n /**\n * @dev Check if the curve is the zero curve.\n */\n function isZeroCurve(\n uint256 x0,\n uint256 y0\n ) internal pure returns (bool isZero) {\n if (x0 == 0 && y0 == 0) {\n return true;\n }\n return false;\n }\n\n /**\n * @dev Check if a point in affine coordinates is on the curve.\n */\n function isOnCurve(uint256 x, uint256 y) internal pure returns (bool) {\n if (0 == x || x == p || 0 == y || y == p) {\n return false;\n }\n\n uint256 LHS = mulmod(y, y, p); // y^2\n uint256 RHS = mulmod(mulmod(x, x, p), x, p); // x^3\n\n if (a != 0) {\n RHS = addmod(RHS, mulmod(x, a, p), p); // x^3 + a*x\n }\n if (b != 0) {\n RHS = addmod(RHS, b, p); // x^3 + a*x + b\n }\n\n return LHS == RHS;\n }\n\n /**\n * @dev Double an elliptic curve point in projective coordinates. See\n * https://www.nayuki.io/page/elliptic-curve-point-addition-in-projective-coordinates\n */\n function twiceProj(\n uint256 x0,\n uint256 y0,\n uint256 z0\n ) internal pure returns (uint256 x1, uint256 y1, uint256 z1) {\n uint256 t;\n uint256 u;\n uint256 v;\n uint256 w;\n\n if (isZeroCurve(x0, y0)) {\n return zeroProj();\n }\n\n u = mulmod(y0, z0, p);\n u = mulmod(u, 2, p);\n\n v = mulmod(u, x0, p);\n v = mulmod(v, y0, p);\n v = mulmod(v, 2, p);\n\n x0 = mulmod(x0, x0, p);\n t = mulmod(x0, 3, p);\n\n z0 = mulmod(z0, z0, p);\n z0 = mulmod(z0, a, p);\n t = addmod(t, z0, p);\n\n w = mulmod(t, t, p);\n x0 = mulmod(2, v, p);\n w = addmod(w, p - x0, p);\n\n x0 = addmod(v, p - w, p);\n x0 = mulmod(t, x0, p);\n y0 = mulmod(y0, u, p);\n y0 = mulmod(y0, y0, p);\n y0 = mulmod(2, y0, p);\n y1 = addmod(x0, p - y0, p);\n\n x1 = mulmod(u, w, p);\n\n z1 = mulmod(u, u, p);\n z1 = mulmod(z1, u, p);\n }\n\n /**\n * @dev Add two elliptic curve points in projective coordinates. See\n * https://www.nayuki.io/page/elliptic-curve-point-addition-in-projective-coordinates\n */\n function addProj(\n uint256 x0,\n uint256 y0,\n uint256 z0,\n uint256 x1,\n uint256 y1,\n uint256 z1\n ) internal pure returns (uint256 x2, uint256 y2, uint256 z2) {\n uint256 t0;\n uint256 t1;\n uint256 u0;\n uint256 u1;\n\n if (isZeroCurve(x0, y0)) {\n return (x1, y1, z1);\n } else if (isZeroCurve(x1, y1)) {\n return (x0, y0, z0);\n }\n\n t0 = mulmod(y0, z1, p);\n t1 = mulmod(y1, z0, p);\n\n u0 = mulmod(x0, z1, p);\n u1 = mulmod(x1, z0, p);\n\n if (u0 == u1) {\n if (t0 == t1) {\n return twiceProj(x0, y0, z0);\n } else {\n return zeroProj();\n }\n }\n\n (x2, y2, z2) = addProj2(mulmod(z0, z1, p), u0, u1, t1, t0);\n }\n\n /**\n * @dev Helper function that splits addProj to avoid too many local variables.\n */\n function addProj2(\n uint256 v,\n uint256 u0,\n uint256 u1,\n uint256 t1,\n uint256 t0\n ) private pure returns (uint256 x2, uint256 y2, uint256 z2) {\n uint256 u;\n uint256 u2;\n uint256 u3;\n uint256 w;\n uint256 t;\n\n t = addmod(t0, p - t1, p);\n u = addmod(u0, p - u1, p);\n u2 = mulmod(u, u, p);\n\n w = mulmod(t, t, p);\n w = mulmod(w, v, p);\n u1 = addmod(u1, u0, p);\n u1 = mulmod(u1, u2, p);\n w = addmod(w, p - u1, p);\n\n x2 = mulmod(u, w, p);\n\n u3 = mulmod(u2, u, p);\n u0 = mulmod(u0, u2, p);\n u0 = addmod(u0, p - w, p);\n t = mulmod(t, u0, p);\n t0 = mulmod(t0, u3, p);\n\n y2 = addmod(t, p - t0, p);\n\n z2 = mulmod(u3, v, p);\n }\n\n /**\n * @dev Add two elliptic curve points in affine coordinates.\n */\n function add(\n uint256 x0,\n uint256 y0,\n uint256 x1,\n uint256 y1\n ) internal pure returns (uint256, uint256) {\n uint256 z0;\n\n (x0, y0, z0) = addProj(x0, y0, 1, x1, y1, 1);\n\n return toAffinePoint(x0, y0, z0);\n }\n\n /**\n * @dev Double an elliptic curve point in affine coordinates.\n */\n function twice(\n uint256 x0,\n uint256 y0\n ) internal pure returns (uint256, uint256) {\n uint256 z0;\n\n (x0, y0, z0) = twiceProj(x0, y0, 1);\n\n return toAffinePoint(x0, y0, z0);\n }\n\n /**\n * @dev Multiply an elliptic curve point by a 2 power base (i.e., (2^exp)*P)).\n */\n function multiplyPowerBase2(\n uint256 x0,\n uint256 y0,\n uint256 exp\n ) internal pure returns (uint256, uint256) {\n uint256 base2X = x0;\n uint256 base2Y = y0;\n uint256 base2Z = 1;\n\n for (uint256 i = 0; i < exp; i++) {\n (base2X, base2Y, base2Z) = twiceProj(base2X, base2Y, base2Z);\n }\n\n return toAffinePoint(base2X, base2Y, base2Z);\n }\n\n /**\n * @dev Multiply an elliptic curve point by a scalar.\n */\n function multiplyScalar(\n uint256 x0,\n uint256 y0,\n uint256 scalar\n ) internal pure returns (uint256 x1, uint256 y1) {\n if (scalar == 0) {\n return zeroAffine();\n } else if (scalar == 1) {\n return (x0, y0);\n } else if (scalar == 2) {\n return twice(x0, y0);\n }\n\n uint256 base2X = x0;\n uint256 base2Y = y0;\n uint256 base2Z = 1;\n uint256 z1 = 1;\n x1 = x0;\n y1 = y0;\n\n if (scalar % 2 == 0) {\n x1 = y1 = 0;\n }\n\n scalar = scalar >> 1;\n\n while (scalar > 0) {\n (base2X, base2Y, base2Z) = twiceProj(base2X, base2Y, base2Z);\n\n if (scalar % 2 == 1) {\n (x1, y1, z1) = addProj(base2X, base2Y, base2Z, x1, y1, z1);\n }\n\n scalar = scalar >> 1;\n }\n\n return toAffinePoint(x1, y1, z1);\n }\n\n /**\n * @dev Multiply the curve's generator point by a scalar.\n */\n function multipleGeneratorByScalar(\n uint256 scalar\n ) internal pure returns (uint256, uint256) {\n return multiplyScalar(gx, gy, scalar);\n }\n\n /**\n * @dev Validate combination of message, signature, and public key.\n */\n function validateSignature(\n bytes32 message,\n uint256[2] memory rs,\n uint256[2] memory Q\n ) internal pure returns (bool) {\n // To disambiguate between public key solutions, include comment below.\n if (rs[0] == 0 || rs[0] >= n || rs[1] == 0) {\n // || rs[1] > lowSmax)\n return false;\n }\n if (!isOnCurve(Q[0], Q[1])) {\n return false;\n }\n\n uint256 x1;\n uint256 x2;\n uint256 y1;\n uint256 y2;\n\n uint256 sInv = inverseMod(rs[1], n);\n (x1, y1) = multiplyScalar(gx, gy, mulmod(uint256(message), sInv, n));\n (x2, y2) = multiplyScalar(Q[0], Q[1], mulmod(rs[0], sInv, n));\n uint256[3] memory P = addAndReturnProjectivePoint(x1, y1, x2, y2);\n\n if (P[2] == 0) {\n return false;\n }\n\n uint256 Px = inverseMod(P[2], p);\n Px = mulmod(P[0], mulmod(Px, Px, p), p);\n\n return Px % n == rs[0];\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/ModexpPrecompile.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary ModexpPrecompile {\n /**\n * @dev Computes (base ^ exponent) % modulus over big numbers.\n */\n function modexp(\n bytes memory base,\n bytes memory exponent,\n bytes memory modulus\n ) internal view returns (bool success, bytes memory output) {\n bytes memory input = abi.encodePacked(\n uint256(base.length),\n uint256(exponent.length),\n uint256(modulus.length),\n base,\n exponent,\n modulus\n );\n\n output = new bytes(modulus.length);\n\n assembly {\n success := staticcall(\n gas(),\n 5,\n add(input, 32),\n mload(input),\n add(output, 32),\n mload(modulus)\n )\n }\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/P256SHA256Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"./EllipticCurve.sol\";\nimport \"../BytesUtils.sol\";\n\ncontract P256SHA256Algorithm is Algorithm, EllipticCurve {\n using BytesUtils for *;\n\n /**\n * @dev Verifies a signature.\n * @param key The public key to verify with.\n * @param data The signed data to verify.\n * @param signature The signature to verify.\n * @return True iff the signature is valid.\n */\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata signature\n ) external view override returns (bool) {\n return\n validateSignature(\n sha256(data),\n parseSignature(signature),\n parseKey(key)\n );\n }\n\n function parseSignature(\n bytes memory data\n ) internal pure returns (uint256[2] memory) {\n require(data.length == 64, \"Invalid p256 signature length\");\n return [uint256(data.readBytes32(0)), uint256(data.readBytes32(32))];\n }\n\n function parseKey(\n bytes memory data\n ) internal pure returns (uint256[2] memory) {\n require(data.length == 68, \"Invalid p256 key length\");\n return [uint256(data.readBytes32(4)), uint256(data.readBytes32(36))];\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSASHA1Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"../BytesUtils.sol\";\nimport \"./RSAVerify.sol\";\nimport \"@ensdomains/solsha1/contracts/SHA1.sol\";\n\n/**\n * @dev Implements the DNSSEC RSASHA1 algorithm.\n */\ncontract RSASHA1Algorithm is Algorithm {\n using BytesUtils for *;\n\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata sig\n ) external view override returns (bool) {\n bytes memory exponent;\n bytes memory modulus;\n\n uint16 exponentLen = uint16(key.readUint8(4));\n if (exponentLen != 0) {\n exponent = key.substring(5, exponentLen);\n modulus = key.substring(\n exponentLen + 5,\n key.length - exponentLen - 5\n );\n } else {\n exponentLen = key.readUint16(5);\n exponent = key.substring(7, exponentLen);\n modulus = key.substring(\n exponentLen + 7,\n key.length - exponentLen - 7\n );\n }\n\n // Recover the message from the signature\n bool ok;\n bytes memory result;\n (ok, result) = RSAVerify.rsarecover(modulus, exponent, sig);\n\n // Verify it ends with the hash of our data\n return ok && SHA1.sha1(data) == result.readBytes20(result.length - 20);\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSASHA256Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"../BytesUtils.sol\";\nimport \"./RSAVerify.sol\";\n\n/**\n * @dev Implements the DNSSEC RSASHA256 algorithm.\n */\ncontract RSASHA256Algorithm is Algorithm {\n using BytesUtils for *;\n\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata sig\n ) external view override returns (bool) {\n bytes memory exponent;\n bytes memory modulus;\n\n uint16 exponentLen = uint16(key.readUint8(4));\n if (exponentLen != 0) {\n exponent = key.substring(5, exponentLen);\n modulus = key.substring(\n exponentLen + 5,\n key.length - exponentLen - 5\n );\n } else {\n exponentLen = key.readUint16(5);\n exponent = key.substring(7, exponentLen);\n modulus = key.substring(\n exponentLen + 7,\n key.length - exponentLen - 7\n );\n }\n\n // Recover the message from the signature\n bool ok;\n bytes memory result;\n (ok, result) = RSAVerify.rsarecover(modulus, exponent, sig);\n\n // Verify it ends with the hash of our data\n return ok && sha256(data) == result.readBytes32(result.length - 32);\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSAVerify.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../BytesUtils.sol\";\nimport \"./ModexpPrecompile.sol\";\n\nlibrary RSAVerify {\n /**\n * @dev Recovers the input data from an RSA signature, returning the result in S.\n * @param N The RSA public modulus.\n * @param E The RSA public exponent.\n * @param S The signature to recover.\n * @return True if the recovery succeeded.\n */\n function rsarecover(\n bytes memory N,\n bytes memory E,\n bytes memory S\n ) internal view returns (bool, bytes memory) {\n return ModexpPrecompile.modexp(S, E, N);\n }\n}\n" + }, + "contracts/dnssec-oracle/BytesUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary BytesUtils {\n error OffsetOutOfBoundsError(uint256 offset, uint256 length);\n\n /*\n * @dev Returns the keccak-256 hash of a byte range.\n * @param self The byte string to hash.\n * @param offset The position to start hashing at.\n * @param len The number of bytes to hash.\n * @return The hash of the byte range.\n */\n function keccak(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(offset + len <= self.length);\n assembly {\n ret := keccak256(add(add(self, 32), offset), len)\n }\n }\n\n /*\n * @dev Returns a positive number if `other` comes lexicographically after\n * `self`, a negative number if it comes before, or zero if the\n * contents of the two bytes are equal.\n * @param self The first bytes to compare.\n * @param other The second bytes to compare.\n * @return The result of the comparison.\n */\n function compare(\n bytes memory self,\n bytes memory other\n ) internal pure returns (int256) {\n return compare(self, 0, self.length, other, 0, other.length);\n }\n\n /*\n * @dev Returns a positive number if `other` comes lexicographically after\n * `self`, a negative number if it comes before, or zero if the\n * contents of the two bytes are equal. Comparison is done per-rune,\n * on unicode codepoints.\n * @param self The first bytes to compare.\n * @param offset The offset of self.\n * @param len The length of self.\n * @param other The second bytes to compare.\n * @param otheroffset The offset of the other string.\n * @param otherlen The length of the other string.\n * @return The result of the comparison.\n */\n function compare(\n bytes memory self,\n uint256 offset,\n uint256 len,\n bytes memory other,\n uint256 otheroffset,\n uint256 otherlen\n ) internal pure returns (int256) {\n if (offset + len > self.length) {\n revert OffsetOutOfBoundsError(offset + len, self.length);\n }\n if (otheroffset + otherlen > other.length) {\n revert OffsetOutOfBoundsError(otheroffset + otherlen, other.length);\n }\n\n uint256 shortest = len;\n if (otherlen < len) shortest = otherlen;\n\n uint256 selfptr;\n uint256 otherptr;\n\n assembly {\n selfptr := add(self, add(offset, 32))\n otherptr := add(other, add(otheroffset, 32))\n }\n for (uint256 idx = 0; idx < shortest; idx += 32) {\n uint256 a;\n uint256 b;\n assembly {\n a := mload(selfptr)\n b := mload(otherptr)\n }\n if (a != b) {\n // Mask out irrelevant bytes and check again\n uint256 mask;\n if (shortest - idx >= 32) {\n mask = type(uint256).max;\n } else {\n mask = ~(2 ** (8 * (idx + 32 - shortest)) - 1);\n }\n int256 diff = int256(a & mask) - int256(b & mask);\n if (diff != 0) return diff;\n }\n selfptr += 32;\n otherptr += 32;\n }\n\n return int256(len) - int256(otherlen);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @param otherOffset The offset into the second byte range.\n * @param len The number of bytes to compare\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other,\n uint256 otherOffset,\n uint256 len\n ) internal pure returns (bool) {\n return keccak(self, offset, len) == keccak(other, otherOffset, len);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal with offsets.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @param otherOffset The offset into the second byte range.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other,\n uint256 otherOffset\n ) internal pure returns (bool) {\n return\n keccak(self, offset, self.length - offset) ==\n keccak(other, otherOffset, other.length - otherOffset);\n }\n\n /*\n * @dev Compares a range of 'self' to all of 'other' and returns True iff\n * they are equal.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other\n ) internal pure returns (bool) {\n return\n self.length == offset + other.length &&\n equals(self, offset, other, 0, other.length);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal.\n * @param self The first byte range to compare.\n * @param other The second byte range to compare.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n bytes memory other\n ) internal pure returns (bool) {\n return\n self.length == other.length &&\n equals(self, 0, other, 0, self.length);\n }\n\n /*\n * @dev Returns the 8-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 8 bits of the string, interpreted as an integer.\n */\n function readUint8(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint8 ret) {\n return uint8(self[idx]);\n }\n\n /*\n * @dev Returns the 16-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 16 bits of the string, interpreted as an integer.\n */\n function readUint16(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint16 ret) {\n require(idx + 2 <= self.length);\n assembly {\n ret := and(mload(add(add(self, 2), idx)), 0xFFFF)\n }\n }\n\n /*\n * @dev Returns the 32-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bits of the string, interpreted as an integer.\n */\n function readUint32(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint32 ret) {\n require(idx + 4 <= self.length);\n assembly {\n ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF)\n }\n }\n\n /*\n * @dev Returns the 32 byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bytes of the string.\n */\n function readBytes32(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes32 ret) {\n require(idx + 32 <= self.length);\n assembly {\n ret := mload(add(add(self, 32), idx))\n }\n }\n\n /*\n * @dev Returns the 32 byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bytes of the string.\n */\n function readBytes20(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes20 ret) {\n require(idx + 20 <= self.length);\n assembly {\n ret := and(\n mload(add(add(self, 32), idx)),\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000\n )\n }\n }\n\n /*\n * @dev Returns the n byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes.\n * @param len The number of bytes.\n * @return The specified 32 bytes of the string.\n */\n function readBytesN(\n bytes memory self,\n uint256 idx,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(len <= 32);\n require(idx + len <= self.length);\n assembly {\n let mask := not(sub(exp(256, sub(32, len)), 1))\n ret := and(mload(add(add(self, 32), idx)), mask)\n }\n }\n\n function memcpy(uint256 dest, uint256 src, uint256 len) private pure {\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint256 mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n }\n\n /*\n * @dev Copies a substring into a new byte string.\n * @param self The byte string to copy from.\n * @param offset The offset to start copying at.\n * @param len The number of bytes to copy.\n */\n function substring(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes memory) {\n require(offset + len <= self.length);\n\n bytes memory ret = new bytes(len);\n uint256 dest;\n uint256 src;\n\n assembly {\n dest := add(ret, 32)\n src := add(add(self, 32), offset)\n }\n memcpy(dest, src, len);\n\n return ret;\n }\n\n // Maps characters from 0x30 to 0x7A to their base32 values.\n // 0xFF represents invalid characters in that range.\n bytes constant base32HexTable =\n hex\"00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F\";\n\n /**\n * @dev Decodes unpadded base32 data of up to one word in length.\n * @param self The data to decode.\n * @param off Offset into the string to start at.\n * @param len Number of characters to decode.\n * @return The decoded data, left aligned.\n */\n function base32HexDecodeWord(\n bytes memory self,\n uint256 off,\n uint256 len\n ) internal pure returns (bytes32) {\n require(len <= 52);\n\n uint256 ret = 0;\n uint8 decoded;\n for (uint256 i = 0; i < len; i++) {\n bytes1 char = self[off + i];\n require(char >= 0x30 && char <= 0x7A);\n decoded = uint8(base32HexTable[uint256(uint8(char)) - 0x30]);\n require(decoded <= 0x20);\n if (i == len - 1) {\n break;\n }\n ret = (ret << 5) | decoded;\n }\n\n uint256 bitlen = len * 5;\n if (len % 8 == 0) {\n // Multiple of 8 characters, no padding\n ret = (ret << 5) | decoded;\n } else if (len % 8 == 2) {\n // Two extra characters - 1 byte\n ret = (ret << 3) | (decoded >> 2);\n bitlen -= 2;\n } else if (len % 8 == 4) {\n // Four extra characters - 2 bytes\n ret = (ret << 1) | (decoded >> 4);\n bitlen -= 4;\n } else if (len % 8 == 5) {\n // Five extra characters - 3 bytes\n ret = (ret << 4) | (decoded >> 1);\n bitlen -= 1;\n } else if (len % 8 == 7) {\n // Seven extra characters - 4 bytes\n ret = (ret << 2) | (decoded >> 3);\n bitlen -= 3;\n } else {\n revert();\n }\n\n return bytes32(ret << (256 - bitlen));\n }\n\n /**\n * @dev Finds the first occurrence of the byte `needle` in `self`.\n * @param self The string to search\n * @param off The offset to start searching at\n * @param len The number of bytes to search\n * @param needle The byte to search for\n * @return The offset of `needle` in `self`, or 2**256-1 if it was not found.\n */\n function find(\n bytes memory self,\n uint256 off,\n uint256 len,\n bytes1 needle\n ) internal pure returns (uint256) {\n for (uint256 idx = off; idx < off + len; idx++) {\n if (self[idx] == needle) {\n return idx;\n }\n }\n return type(uint256).max;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev An interface for contracts implementing a DNSSEC digest.\n */\ninterface Digest {\n /**\n * @dev Verifies a cryptographic hash.\n * @param data The data to hash.\n * @param hash The hash to compare to.\n * @return True iff the hashed data matches the provided hash value.\n */\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure virtual returns (bool);\n}\n" + }, + "contracts/dnssec-oracle/digests/DummyDigest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\n\n/**\n * @dev Implements a dummy DNSSEC digest that approves all hashes, for testing.\n */\ncontract DummyDigest is Digest {\n function verify(\n bytes calldata,\n bytes calldata\n ) external pure override returns (bool) {\n return true;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/SHA1Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\nimport \"../BytesUtils.sol\";\nimport \"@ensdomains/solsha1/contracts/SHA1.sol\";\n\n/**\n * @dev Implements the DNSSEC SHA1 digest.\n */\ncontract SHA1Digest is Digest {\n using BytesUtils for *;\n\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure override returns (bool) {\n require(hash.length == 20, \"Invalid sha1 hash length\");\n bytes32 expected = hash.readBytes20(0);\n bytes20 computed = SHA1.sha1(data);\n return expected == computed;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/SHA256Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\nimport \"../BytesUtils.sol\";\n\n/**\n * @dev Implements the DNSSEC SHA256 digest.\n */\ncontract SHA256Digest is Digest {\n using BytesUtils for *;\n\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure override returns (bool) {\n require(hash.length == 32, \"Invalid sha256 hash length\");\n return sha256(data) == hash.readBytes32(0);\n }\n}\n" + }, + "contracts/dnssec-oracle/DNSSEC.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nabstract contract DNSSEC {\n bytes public anchors;\n\n struct RRSetWithSignature {\n bytes rrset;\n bytes sig;\n }\n\n event AlgorithmUpdated(uint8 id, address addr);\n event DigestUpdated(uint8 id, address addr);\n\n function verifyRRSet(\n RRSetWithSignature[] memory input\n ) external view virtual returns (bytes memory rrs, uint32 inception);\n\n function verifyRRSet(\n RRSetWithSignature[] memory input,\n uint256 now\n ) public view virtual returns (bytes memory rrs, uint32 inception);\n}\n" + }, + "contracts/dnssec-oracle/DNSSECImpl.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nimport \"./Owned.sol\";\nimport \"./BytesUtils.sol\";\nimport \"./RRUtils.sol\";\nimport \"./DNSSEC.sol\";\nimport \"./algorithms/Algorithm.sol\";\nimport \"./digests/Digest.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\n/*\n * @dev An oracle contract that verifies and stores DNSSEC-validated DNS records.\n * @note This differs from the DNSSEC spec defined in RFC4034 and RFC4035 in some key regards:\n * - NSEC & NSEC3 are not supported; only positive proofs are allowed.\n * - Proofs involving wildcard names will not validate.\n * - TTLs on records are ignored, as data is not stored persistently.\n * - Canonical form of names is not checked; in ENS this is done on the frontend, so submitting\n * proofs with non-canonical names will only result in registering unresolvable ENS names.\n */\ncontract DNSSECImpl is DNSSEC, Owned {\n using Buffer for Buffer.buffer;\n using BytesUtils for bytes;\n using RRUtils for *;\n\n uint16 constant DNSCLASS_IN = 1;\n\n uint16 constant DNSTYPE_DS = 43;\n uint16 constant DNSTYPE_DNSKEY = 48;\n\n uint256 constant DNSKEY_FLAG_ZONEKEY = 0x100;\n\n error InvalidLabelCount(bytes name, uint256 labelsExpected);\n error SignatureNotValidYet(uint32 inception, uint32 now);\n error SignatureExpired(uint32 expiration, uint32 now);\n error InvalidClass(uint16 class);\n error InvalidRRSet();\n error SignatureTypeMismatch(uint16 rrsetType, uint16 sigType);\n error InvalidSignerName(bytes rrsetName, bytes signerName);\n error InvalidProofType(uint16 proofType);\n error ProofNameMismatch(bytes signerName, bytes proofName);\n error NoMatchingProof(bytes signerName);\n\n mapping(uint8 => Algorithm) public algorithms;\n mapping(uint8 => Digest) public digests;\n\n /**\n * @dev Constructor.\n * @param _anchors The binary format RR entries for the root DS records.\n */\n constructor(bytes memory _anchors) {\n // Insert the 'trust anchors' - the key hashes that start the chain\n // of trust for all other records.\n anchors = _anchors;\n }\n\n /**\n * @dev Sets the contract address for a signature verification algorithm.\n * Callable only by the owner.\n * @param id The algorithm ID\n * @param algo The address of the algorithm contract.\n */\n function setAlgorithm(uint8 id, Algorithm algo) public owner_only {\n algorithms[id] = algo;\n emit AlgorithmUpdated(id, address(algo));\n }\n\n /**\n * @dev Sets the contract address for a digest verification algorithm.\n * Callable only by the owner.\n * @param id The digest ID\n * @param digest The address of the digest contract.\n */\n function setDigest(uint8 id, Digest digest) public owner_only {\n digests[id] = digest;\n emit DigestUpdated(id, address(digest));\n }\n\n /**\n * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.\n * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.\n * @param input A list of signed RRSets.\n * @return rrs The RRData from the last RRSet in the chain.\n * @return inception The inception time of the signed record set.\n */\n function verifyRRSet(\n RRSetWithSignature[] memory input\n )\n external\n view\n virtual\n override\n returns (bytes memory rrs, uint32 inception)\n {\n return verifyRRSet(input, block.timestamp);\n }\n\n /**\n * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.\n * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.\n * @param input A list of signed RRSets.\n * @param now The Unix timestamp to validate the records at.\n * @return rrs The RRData from the last RRSet in the chain.\n * @return inception The inception time of the signed record set.\n */\n function verifyRRSet(\n RRSetWithSignature[] memory input,\n uint256 now\n )\n public\n view\n virtual\n override\n returns (bytes memory rrs, uint32 inception)\n {\n bytes memory proof = anchors;\n for (uint256 i = 0; i < input.length; i++) {\n RRUtils.SignedSet memory rrset = validateSignedSet(\n input[i],\n proof,\n now\n );\n proof = rrset.data;\n inception = rrset.inception;\n }\n return (proof, inception);\n }\n\n /**\n * @dev Validates an RRSet against the already trusted RR provided in `proof`.\n *\n * @param input The signed RR set. This is in the format described in section\n * 5.3.2 of RFC4035: The RRDATA section from the RRSIG without the signature\n * data, followed by a series of canonicalised RR records that the signature\n * applies to.\n * @param proof The DNSKEY or DS to validate the signature against.\n * @param now The current timestamp.\n */\n function validateSignedSet(\n RRSetWithSignature memory input,\n bytes memory proof,\n uint256 now\n ) internal view returns (RRUtils.SignedSet memory rrset) {\n rrset = input.rrset.readSignedSet();\n\n // Do some basic checks on the RRs and extract the name\n bytes memory name = validateRRs(rrset, rrset.typeCovered);\n if (name.labelCount(0) != rrset.labels) {\n revert InvalidLabelCount(name, rrset.labels);\n }\n rrset.name = name;\n\n // All comparisons involving the Signature Expiration and\n // Inception fields MUST use \"serial number arithmetic\", as\n // defined in RFC 1982\n\n // o The validator's notion of the current time MUST be less than or\n // equal to the time listed in the RRSIG RR's Expiration field.\n if (!RRUtils.serialNumberGte(rrset.expiration, uint32(now))) {\n revert SignatureExpired(rrset.expiration, uint32(now));\n }\n\n // o The validator's notion of the current time MUST be greater than or\n // equal to the time listed in the RRSIG RR's Inception field.\n if (!RRUtils.serialNumberGte(uint32(now), rrset.inception)) {\n revert SignatureNotValidYet(rrset.inception, uint32(now));\n }\n\n // Validate the signature\n verifySignature(name, rrset, input, proof);\n\n return rrset;\n }\n\n /**\n * @dev Validates a set of RRs.\n * @param rrset The RR set.\n * @param typecovered The type covered by the RRSIG record.\n */\n function validateRRs(\n RRUtils.SignedSet memory rrset,\n uint16 typecovered\n ) internal pure returns (bytes memory name) {\n // Iterate over all the RRs\n for (\n RRUtils.RRIterator memory iter = rrset.rrs();\n !iter.done();\n iter.next()\n ) {\n // We only support class IN (Internet)\n if (iter.class != DNSCLASS_IN) {\n revert InvalidClass(iter.class);\n }\n\n if (name.length == 0) {\n name = iter.name();\n } else {\n // Name must be the same on all RRs. We do things this way to avoid copying the name\n // repeatedly.\n if (\n name.length != iter.data.nameLength(iter.offset) ||\n !name.equals(0, iter.data, iter.offset, name.length)\n ) {\n revert InvalidRRSet();\n }\n }\n\n // o The RRSIG RR's Type Covered field MUST equal the RRset's type.\n if (iter.dnstype != typecovered) {\n revert SignatureTypeMismatch(iter.dnstype, typecovered);\n }\n }\n }\n\n /**\n * @dev Performs signature verification.\n *\n * Throws or reverts if unable to verify the record.\n *\n * @param name The name of the RRSIG record, in DNS label-sequence format.\n * @param data The original data to verify.\n * @param proof A DS or DNSKEY record that's already verified by the oracle.\n */\n function verifySignature(\n bytes memory name,\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n bytes memory proof\n ) internal view {\n // o The RRSIG RR's Signer's Name field MUST be the name of the zone\n // that contains the RRset.\n if (!name.isSubdomainOf(rrset.signerName)) {\n revert InvalidSignerName(name, rrset.signerName);\n }\n\n RRUtils.RRIterator memory proofRR = proof.iterateRRs(0);\n // Check the proof\n if (proofRR.dnstype == DNSTYPE_DS) {\n verifyWithDS(rrset, data, proofRR);\n } else if (proofRR.dnstype == DNSTYPE_DNSKEY) {\n verifyWithKnownKey(rrset, data, proofRR);\n } else {\n revert InvalidProofType(proofRR.dnstype);\n }\n }\n\n /**\n * @dev Attempts to verify a signed RRSET against an already known public key.\n * @param rrset The signed set to verify.\n * @param data The original data the signed set was read from.\n * @param proof The serialized DS or DNSKEY record to use as proof.\n */\n function verifyWithKnownKey(\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n RRUtils.RRIterator memory proof\n ) internal view {\n // Check the DNSKEY's owner name matches the signer name on the RRSIG\n for (; !proof.done(); proof.next()) {\n bytes memory proofName = proof.name();\n if (!proofName.equals(rrset.signerName)) {\n revert ProofNameMismatch(rrset.signerName, proofName);\n }\n\n bytes memory keyrdata = proof.rdata();\n RRUtils.DNSKEY memory dnskey = keyrdata.readDNSKEY(\n 0,\n keyrdata.length\n );\n if (verifySignatureWithKey(dnskey, keyrdata, rrset, data)) {\n return;\n }\n }\n revert NoMatchingProof(rrset.signerName);\n }\n\n /**\n * @dev Attempts to verify some data using a provided key and a signature.\n * @param dnskey The dns key record to verify the signature with.\n * @param rrset The signed RRSET being verified.\n * @param data The original data `rrset` was decoded from.\n * @return True iff the key verifies the signature.\n */\n function verifySignatureWithKey(\n RRUtils.DNSKEY memory dnskey,\n bytes memory keyrdata,\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data\n ) internal view returns (bool) {\n // TODO: Check key isn't expired, unless updating key itself\n\n // The Protocol Field MUST have value 3 (RFC4034 2.1.2)\n if (dnskey.protocol != 3) {\n return false;\n }\n\n // o The RRSIG RR's Signer's Name, Algorithm, and Key Tag fields MUST\n // match the owner name, algorithm, and key tag for some DNSKEY RR in\n // the zone's apex DNSKEY RRset.\n if (dnskey.algorithm != rrset.algorithm) {\n return false;\n }\n uint16 computedkeytag = keyrdata.computeKeytag();\n if (computedkeytag != rrset.keytag) {\n return false;\n }\n\n // o The matching DNSKEY RR MUST be present in the zone's apex DNSKEY\n // RRset, and MUST have the Zone Flag bit (DNSKEY RDATA Flag bit 7)\n // set.\n if (dnskey.flags & DNSKEY_FLAG_ZONEKEY == 0) {\n return false;\n }\n\n Algorithm algorithm = algorithms[dnskey.algorithm];\n if (address(algorithm) == address(0)) {\n return false;\n }\n return algorithm.verify(keyrdata, data.rrset, data.sig);\n }\n\n /**\n * @dev Attempts to verify a signed RRSET against an already known hash. This function assumes\n * that the record\n * @param rrset The signed set to verify.\n * @param data The original data the signed set was read from.\n * @param proof The serialized DS or DNSKEY record to use as proof.\n */\n function verifyWithDS(\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n RRUtils.RRIterator memory proof\n ) internal view {\n uint256 proofOffset = proof.offset;\n for (\n RRUtils.RRIterator memory iter = rrset.rrs();\n !iter.done();\n iter.next()\n ) {\n if (iter.dnstype != DNSTYPE_DNSKEY) {\n revert InvalidProofType(iter.dnstype);\n }\n\n bytes memory keyrdata = iter.rdata();\n RRUtils.DNSKEY memory dnskey = keyrdata.readDNSKEY(\n 0,\n keyrdata.length\n );\n if (verifySignatureWithKey(dnskey, keyrdata, rrset, data)) {\n // It's self-signed - look for a DS record to verify it.\n if (\n verifyKeyWithDS(rrset.signerName, proof, dnskey, keyrdata)\n ) {\n return;\n }\n // Rewind proof iterator to the start for the next loop iteration.\n proof.nextOffset = proofOffset;\n proof.next();\n }\n }\n revert NoMatchingProof(rrset.signerName);\n }\n\n /**\n * @dev Attempts to verify a key using DS records.\n * @param keyname The DNS name of the key, in DNS label-sequence format.\n * @param dsrrs The DS records to use in verification.\n * @param dnskey The dnskey to verify.\n * @param keyrdata The RDATA section of the key.\n * @return True if a DS record verifies this key.\n */\n function verifyKeyWithDS(\n bytes memory keyname,\n RRUtils.RRIterator memory dsrrs,\n RRUtils.DNSKEY memory dnskey,\n bytes memory keyrdata\n ) internal view returns (bool) {\n uint16 keytag = keyrdata.computeKeytag();\n for (; !dsrrs.done(); dsrrs.next()) {\n bytes memory proofName = dsrrs.name();\n if (!proofName.equals(keyname)) {\n revert ProofNameMismatch(keyname, proofName);\n }\n\n RRUtils.DS memory ds = dsrrs.data.readDS(\n dsrrs.rdataOffset,\n dsrrs.nextOffset - dsrrs.rdataOffset\n );\n if (ds.keytag != keytag) {\n continue;\n }\n if (ds.algorithm != dnskey.algorithm) {\n continue;\n }\n\n Buffer.buffer memory buf;\n buf.init(keyname.length + keyrdata.length);\n buf.append(keyname);\n buf.append(keyrdata);\n if (verifyDSHash(ds.digestType, buf.buf, ds.digest)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @dev Attempts to verify a DS record's hash value against some data.\n * @param digesttype The digest ID from the DS record.\n * @param data The data to digest.\n * @param digest The digest data to check against.\n * @return True iff the digest matches.\n */\n function verifyDSHash(\n uint8 digesttype,\n bytes memory data,\n bytes memory digest\n ) internal view returns (bool) {\n if (address(digests[digesttype]) == address(0)) {\n return false;\n }\n return digests[digesttype].verify(data, digest);\n }\n}\n" + }, + "contracts/dnssec-oracle/Owned.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev Contract mixin for 'owned' contracts.\n */\ncontract Owned {\n address public owner;\n\n modifier owner_only() {\n require(msg.sender == owner);\n _;\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function setOwner(address newOwner) public owner_only {\n owner = newOwner;\n }\n}\n" + }, + "contracts/dnssec-oracle/RRUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./BytesUtils.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\n/**\n * @dev RRUtils is a library that provides utilities for parsing DNS resource records.\n */\nlibrary RRUtils {\n using BytesUtils for *;\n using Buffer for *;\n\n /**\n * @dev Returns the number of bytes in the DNS name at 'offset' in 'self'.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return The length of the DNS name at 'offset', in bytes.\n */\n function nameLength(\n bytes memory self,\n uint256 offset\n ) internal pure returns (uint256) {\n uint256 idx = offset;\n while (true) {\n assert(idx < self.length);\n uint256 labelLen = self.readUint8(idx);\n idx += labelLen + 1;\n if (labelLen == 0) {\n break;\n }\n }\n return idx - offset;\n }\n\n /**\n * @dev Returns a DNS format name at the specified offset of self.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return ret The name.\n */\n function readName(\n bytes memory self,\n uint256 offset\n ) internal pure returns (bytes memory ret) {\n uint256 len = nameLength(self, offset);\n return self.substring(offset, len);\n }\n\n /**\n * @dev Returns the number of labels in the DNS name at 'offset' in 'self'.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return The number of labels in the DNS name at 'offset', in bytes.\n */\n function labelCount(\n bytes memory self,\n uint256 offset\n ) internal pure returns (uint256) {\n uint256 count = 0;\n while (true) {\n assert(offset < self.length);\n uint256 labelLen = self.readUint8(offset);\n offset += labelLen + 1;\n if (labelLen == 0) {\n break;\n }\n count += 1;\n }\n return count;\n }\n\n uint256 constant RRSIG_TYPE = 0;\n uint256 constant RRSIG_ALGORITHM = 2;\n uint256 constant RRSIG_LABELS = 3;\n uint256 constant RRSIG_TTL = 4;\n uint256 constant RRSIG_EXPIRATION = 8;\n uint256 constant RRSIG_INCEPTION = 12;\n uint256 constant RRSIG_KEY_TAG = 16;\n uint256 constant RRSIG_SIGNER_NAME = 18;\n\n struct SignedSet {\n uint16 typeCovered;\n uint8 algorithm;\n uint8 labels;\n uint32 ttl;\n uint32 expiration;\n uint32 inception;\n uint16 keytag;\n bytes signerName;\n bytes data;\n bytes name;\n }\n\n function readSignedSet(\n bytes memory data\n ) internal pure returns (SignedSet memory self) {\n self.typeCovered = data.readUint16(RRSIG_TYPE);\n self.algorithm = data.readUint8(RRSIG_ALGORITHM);\n self.labels = data.readUint8(RRSIG_LABELS);\n self.ttl = data.readUint32(RRSIG_TTL);\n self.expiration = data.readUint32(RRSIG_EXPIRATION);\n self.inception = data.readUint32(RRSIG_INCEPTION);\n self.keytag = data.readUint16(RRSIG_KEY_TAG);\n self.signerName = readName(data, RRSIG_SIGNER_NAME);\n self.data = data.substring(\n RRSIG_SIGNER_NAME + self.signerName.length,\n data.length - RRSIG_SIGNER_NAME - self.signerName.length\n );\n }\n\n function rrs(\n SignedSet memory rrset\n ) internal pure returns (RRIterator memory) {\n return iterateRRs(rrset.data, 0);\n }\n\n /**\n * @dev An iterator over resource records.\n */\n struct RRIterator {\n bytes data;\n uint256 offset;\n uint16 dnstype;\n uint16 class;\n uint32 ttl;\n uint256 rdataOffset;\n uint256 nextOffset;\n }\n\n /**\n * @dev Begins iterating over resource records.\n * @param self The byte string to read from.\n * @param offset The offset to start reading at.\n * @return ret An iterator object.\n */\n function iterateRRs(\n bytes memory self,\n uint256 offset\n ) internal pure returns (RRIterator memory ret) {\n ret.data = self;\n ret.nextOffset = offset;\n next(ret);\n }\n\n /**\n * @dev Returns true iff there are more RRs to iterate.\n * @param iter The iterator to check.\n * @return True iff the iterator has finished.\n */\n function done(RRIterator memory iter) internal pure returns (bool) {\n return iter.offset >= iter.data.length;\n }\n\n /**\n * @dev Moves the iterator to the next resource record.\n * @param iter The iterator to advance.\n */\n function next(RRIterator memory iter) internal pure {\n iter.offset = iter.nextOffset;\n if (iter.offset >= iter.data.length) {\n return;\n }\n\n // Skip the name\n uint256 off = iter.offset + nameLength(iter.data, iter.offset);\n\n // Read type, class, and ttl\n iter.dnstype = iter.data.readUint16(off);\n off += 2;\n iter.class = iter.data.readUint16(off);\n off += 2;\n iter.ttl = iter.data.readUint32(off);\n off += 4;\n\n // Read the rdata\n uint256 rdataLength = iter.data.readUint16(off);\n off += 2;\n iter.rdataOffset = off;\n iter.nextOffset = off + rdataLength;\n }\n\n /**\n * @dev Returns the name of the current record.\n * @param iter The iterator.\n * @return A new bytes object containing the owner name from the RR.\n */\n function name(RRIterator memory iter) internal pure returns (bytes memory) {\n return\n iter.data.substring(\n iter.offset,\n nameLength(iter.data, iter.offset)\n );\n }\n\n /**\n * @dev Returns the rdata portion of the current record.\n * @param iter The iterator.\n * @return A new bytes object containing the RR's RDATA.\n */\n function rdata(\n RRIterator memory iter\n ) internal pure returns (bytes memory) {\n return\n iter.data.substring(\n iter.rdataOffset,\n iter.nextOffset - iter.rdataOffset\n );\n }\n\n uint256 constant DNSKEY_FLAGS = 0;\n uint256 constant DNSKEY_PROTOCOL = 2;\n uint256 constant DNSKEY_ALGORITHM = 3;\n uint256 constant DNSKEY_PUBKEY = 4;\n\n struct DNSKEY {\n uint16 flags;\n uint8 protocol;\n uint8 algorithm;\n bytes publicKey;\n }\n\n function readDNSKEY(\n bytes memory data,\n uint256 offset,\n uint256 length\n ) internal pure returns (DNSKEY memory self) {\n self.flags = data.readUint16(offset + DNSKEY_FLAGS);\n self.protocol = data.readUint8(offset + DNSKEY_PROTOCOL);\n self.algorithm = data.readUint8(offset + DNSKEY_ALGORITHM);\n self.publicKey = data.substring(\n offset + DNSKEY_PUBKEY,\n length - DNSKEY_PUBKEY\n );\n }\n\n uint256 constant DS_KEY_TAG = 0;\n uint256 constant DS_ALGORITHM = 2;\n uint256 constant DS_DIGEST_TYPE = 3;\n uint256 constant DS_DIGEST = 4;\n\n struct DS {\n uint16 keytag;\n uint8 algorithm;\n uint8 digestType;\n bytes digest;\n }\n\n function readDS(\n bytes memory data,\n uint256 offset,\n uint256 length\n ) internal pure returns (DS memory self) {\n self.keytag = data.readUint16(offset + DS_KEY_TAG);\n self.algorithm = data.readUint8(offset + DS_ALGORITHM);\n self.digestType = data.readUint8(offset + DS_DIGEST_TYPE);\n self.digest = data.substring(offset + DS_DIGEST, length - DS_DIGEST);\n }\n\n function isSubdomainOf(\n bytes memory self,\n bytes memory other\n ) internal pure returns (bool) {\n uint256 off = 0;\n uint256 counts = labelCount(self, 0);\n uint256 othercounts = labelCount(other, 0);\n\n while (counts > othercounts) {\n off = progress(self, off);\n counts--;\n }\n\n return self.equals(off, other, 0);\n }\n\n function compareNames(\n bytes memory self,\n bytes memory other\n ) internal pure returns (int256) {\n if (self.equals(other)) {\n return 0;\n }\n\n uint256 off;\n uint256 otheroff;\n uint256 prevoff;\n uint256 otherprevoff;\n uint256 counts = labelCount(self, 0);\n uint256 othercounts = labelCount(other, 0);\n\n // Keep removing labels from the front of the name until both names are equal length\n while (counts > othercounts) {\n prevoff = off;\n off = progress(self, off);\n counts--;\n }\n\n while (othercounts > counts) {\n otherprevoff = otheroff;\n otheroff = progress(other, otheroff);\n othercounts--;\n }\n\n // Compare the last nonequal labels to each other\n while (counts > 0 && !self.equals(off, other, otheroff)) {\n prevoff = off;\n off = progress(self, off);\n otherprevoff = otheroff;\n otheroff = progress(other, otheroff);\n counts -= 1;\n }\n\n if (off == 0) {\n return -1;\n }\n if (otheroff == 0) {\n return 1;\n }\n\n return\n self.compare(\n prevoff + 1,\n self.readUint8(prevoff),\n other,\n otherprevoff + 1,\n other.readUint8(otherprevoff)\n );\n }\n\n /**\n * @dev Compares two serial numbers using RFC1982 serial number math.\n */\n function serialNumberGte(\n uint32 i1,\n uint32 i2\n ) internal pure returns (bool) {\n unchecked {\n return int32(i1) - int32(i2) >= 0;\n }\n }\n\n function progress(\n bytes memory body,\n uint256 off\n ) internal pure returns (uint256) {\n return off + 1 + body.readUint8(off);\n }\n\n /**\n * @dev Computes the keytag for a chunk of data.\n * @param data The data to compute a keytag for.\n * @return The computed key tag.\n */\n function computeKeytag(bytes memory data) internal pure returns (uint16) {\n /* This function probably deserves some explanation.\n * The DNSSEC keytag function is a checksum that relies on summing up individual bytes\n * from the input string, with some mild bitshifting. Here's a Naive solidity implementation:\n *\n * function computeKeytag(bytes memory data) internal pure returns (uint16) {\n * uint ac;\n * for (uint i = 0; i < data.length; i++) {\n * ac += i & 1 == 0 ? uint16(data.readUint8(i)) << 8 : data.readUint8(i);\n * }\n * return uint16(ac + (ac >> 16));\n * }\n *\n * The EVM, with its 256 bit words, is exceedingly inefficient at doing byte-by-byte operations;\n * the code above, on reasonable length inputs, consumes over 100k gas. But we can make the EVM's\n * large words work in our favour.\n *\n * The code below works by treating the input as a series of 256 bit words. It first masks out\n * even and odd bytes from each input word, adding them to two separate accumulators `ac1` and `ac2`.\n * The bytes are separated by empty bytes, so as long as no individual sum exceeds 2^16-1, we're\n * effectively summing 16 different numbers with each EVM ADD opcode.\n *\n * Once it's added up all the inputs, it has to add all the 16 bit values in `ac1` and `ac2` together.\n * It does this using the same trick - mask out every other value, shift to align them, add them together.\n * After the first addition on both accumulators, there's enough room to add the two accumulators together,\n * and the remaining sums can be done just on ac1.\n */\n unchecked {\n require(data.length <= 8192, \"Long keys not permitted\");\n uint256 ac1;\n uint256 ac2;\n for (uint256 i = 0; i < data.length + 31; i += 32) {\n uint256 word;\n assembly {\n word := mload(add(add(data, 32), i))\n }\n if (i + 32 > data.length) {\n uint256 unused = 256 - (data.length - i) * 8;\n word = (word >> unused) << unused;\n }\n ac1 +=\n (word &\n 0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00) >>\n 8;\n ac2 += (word &\n 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF);\n }\n ac1 =\n (ac1 &\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\n ((ac1 &\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\n 16);\n ac2 =\n (ac2 &\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\n ((ac2 &\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\n 16);\n ac1 = (ac1 << 8) + ac2;\n ac1 =\n (ac1 &\n 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) +\n ((ac1 &\n 0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000) >>\n 32);\n ac1 =\n (ac1 &\n 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) +\n ((ac1 &\n 0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000) >>\n 64);\n ac1 =\n (ac1 &\n 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) +\n (ac1 >> 128);\n ac1 += (ac1 >> 16) & 0xFFFF;\n return uint16(ac1);\n }\n }\n}\n" + }, + "contracts/dnssec-oracle/SHA1.sol": { + "content": "pragma solidity >=0.8.4;\n\nlibrary SHA1 {\n event Debug(bytes32 x);\n\n function sha1(bytes memory data) internal pure returns (bytes20 ret) {\n assembly {\n // Get a safe scratch location\n let scratch := mload(0x40)\n\n // Get the data length, and point data at the first byte\n let len := mload(data)\n data := add(data, 32)\n\n // Find the length after padding\n let totallen := add(and(add(len, 1), 0xFFFFFFFFFFFFFFC0), 64)\n switch lt(sub(totallen, len), 9)\n case 1 {\n totallen := add(totallen, 64)\n }\n\n let h := 0x6745230100EFCDAB890098BADCFE001032547600C3D2E1F0\n\n function readword(ptr, off, count) -> result {\n result := 0\n if lt(off, count) {\n result := mload(add(ptr, off))\n count := sub(count, off)\n if lt(count, 32) {\n let mask := not(sub(exp(256, sub(32, count)), 1))\n result := and(result, mask)\n }\n }\n }\n\n for {\n let i := 0\n } lt(i, totallen) {\n i := add(i, 64)\n } {\n mstore(scratch, readword(data, i, len))\n mstore(add(scratch, 32), readword(data, add(i, 32), len))\n\n // If we loaded the last byte, store the terminator byte\n switch lt(sub(len, i), 64)\n case 1 {\n mstore8(add(scratch, sub(len, i)), 0x80)\n }\n\n // If this is the last block, store the length\n switch eq(i, sub(totallen, 64))\n case 1 {\n mstore(\n add(scratch, 32),\n or(mload(add(scratch, 32)), mul(len, 8))\n )\n }\n\n // Expand the 16 32-bit words into 80\n for {\n let j := 64\n } lt(j, 128) {\n j := add(j, 12)\n } {\n let temp := xor(\n xor(\n mload(add(scratch, sub(j, 12))),\n mload(add(scratch, sub(j, 32)))\n ),\n xor(\n mload(add(scratch, sub(j, 56))),\n mload(add(scratch, sub(j, 64)))\n )\n )\n temp := or(\n and(\n mul(temp, 2),\n 0xFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFE\n ),\n and(\n div(temp, 0x80000000),\n 0x0000000100000001000000010000000100000001000000010000000100000001\n )\n )\n mstore(add(scratch, j), temp)\n }\n for {\n let j := 128\n } lt(j, 320) {\n j := add(j, 24)\n } {\n let temp := xor(\n xor(\n mload(add(scratch, sub(j, 24))),\n mload(add(scratch, sub(j, 64)))\n ),\n xor(\n mload(add(scratch, sub(j, 112))),\n mload(add(scratch, sub(j, 128)))\n )\n )\n temp := or(\n and(\n mul(temp, 4),\n 0xFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFC\n ),\n and(\n div(temp, 0x40000000),\n 0x0000000300000003000000030000000300000003000000030000000300000003\n )\n )\n mstore(add(scratch, j), temp)\n }\n\n let x := h\n let f := 0\n let k := 0\n for {\n let j := 0\n } lt(j, 80) {\n j := add(j, 1)\n } {\n switch div(j, 20)\n case 0 {\n // f = d xor (b and (c xor d))\n f := xor(\n div(x, 0x100000000000000000000),\n div(x, 0x10000000000)\n )\n f := and(div(x, 0x1000000000000000000000000000000), f)\n f := xor(div(x, 0x10000000000), f)\n k := 0x5A827999\n }\n case 1 {\n // f = b xor c xor d\n f := xor(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := xor(div(x, 0x10000000000), f)\n k := 0x6ED9EBA1\n }\n case 2 {\n // f = (b and c) or (d and (b or c))\n f := or(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := and(div(x, 0x10000000000), f)\n f := or(\n and(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n ),\n f\n )\n k := 0x8F1BBCDC\n }\n case 3 {\n // f = b xor c xor d\n f := xor(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := xor(div(x, 0x10000000000), f)\n k := 0xCA62C1D6\n }\n // temp = (a leftrotate 5) + f + e + k + w[i]\n let temp := and(\n div(\n x,\n 0x80000000000000000000000000000000000000000000000\n ),\n 0x1F\n )\n temp := or(\n and(\n div(x, 0x800000000000000000000000000000000000000),\n 0xFFFFFFE0\n ),\n temp\n )\n temp := add(f, temp)\n temp := add(and(x, 0xFFFFFFFF), temp)\n temp := add(k, temp)\n temp := add(\n div(\n mload(add(scratch, mul(j, 4))),\n 0x100000000000000000000000000000000000000000000000000000000\n ),\n temp\n )\n x := or(\n div(x, 0x10000000000),\n mul(temp, 0x10000000000000000000000000000000000000000)\n )\n x := or(\n and(\n x,\n 0xFFFFFFFF00FFFFFFFF000000000000FFFFFFFF00FFFFFFFF\n ),\n mul(\n or(\n and(div(x, 0x4000000000000), 0xC0000000),\n and(div(x, 0x400000000000000000000), 0x3FFFFFFF)\n ),\n 0x100000000000000000000\n )\n )\n }\n\n h := and(\n add(h, x),\n 0xFFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF\n )\n }\n ret := mul(\n or(\n or(\n or(\n or(\n and(\n div(h, 0x100000000),\n 0xFFFFFFFF00000000000000000000000000000000\n ),\n and(\n div(h, 0x1000000),\n 0xFFFFFFFF000000000000000000000000\n )\n ),\n and(div(h, 0x10000), 0xFFFFFFFF0000000000000000)\n ),\n and(div(h, 0x100), 0xFFFFFFFF00000000)\n ),\n and(h, 0xFFFFFFFF)\n ),\n 0x1000000000000000000000000\n )\n }\n }\n}\n" + }, + "contracts/ethregistrar/BaseRegistrarImplementation.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"./IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable {\n // A map of expiry times\n mapping(uint256 => uint256) expiries;\n // The ENS registry\n ENS public ens;\n // The namehash of the TLD this registrar owns (eg, .eth)\n bytes32 public baseNode;\n // A map of addresses that are authorised to register and renew names.\n mapping(address => bool) public controllers;\n uint256 public constant GRACE_PERIOD = 90 days;\n bytes4 private constant INTERFACE_META_ID =\n bytes4(keccak256(\"supportsInterface(bytes4)\"));\n bytes4 private constant ERC721_ID =\n bytes4(\n keccak256(\"balanceOf(address)\") ^\n keccak256(\"ownerOf(uint256)\") ^\n keccak256(\"approve(address,uint256)\") ^\n keccak256(\"getApproved(uint256)\") ^\n keccak256(\"setApprovalForAll(address,bool)\") ^\n keccak256(\"isApprovedForAll(address,address)\") ^\n keccak256(\"transferFrom(address,address,uint256)\") ^\n keccak256(\"safeTransferFrom(address,address,uint256)\") ^\n keccak256(\"safeTransferFrom(address,address,uint256,bytes)\")\n );\n bytes4 private constant RECLAIM_ID =\n bytes4(keccak256(\"reclaim(uint256,address)\"));\n\n /**\n * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187\n * @dev Returns whether the given spender can transfer a given token ID\n * @param spender address of the spender to query\n * @param tokenId uint256 ID of the token to be transferred\n * @return bool whether the msg.sender is approved for the given token ID,\n * is an operator of the owner, or is the owner of the token\n */\n function _isApprovedOrOwner(\n address spender,\n uint256 tokenId\n ) internal view override returns (bool) {\n address owner = ownerOf(tokenId);\n return (spender == owner ||\n getApproved(tokenId) == spender ||\n isApprovedForAll(owner, spender));\n }\n\n constructor(ENS _ens, bytes32 _baseNode) ERC721(\"\", \"\") {\n ens = _ens;\n baseNode = _baseNode;\n }\n\n modifier live() {\n require(ens.owner(baseNode) == address(this));\n _;\n }\n\n modifier onlyController() {\n require(controllers[msg.sender]);\n _;\n }\n\n /**\n * @dev Gets the owner of the specified token ID. Names become unowned\n * when their registration expires.\n * @param tokenId uint256 ID of the token to query the owner of\n * @return address currently marked as the owner of the given token ID\n */\n function ownerOf(\n uint256 tokenId\n ) public view override(IERC721, ERC721) returns (address) {\n require(expiries[tokenId] > block.timestamp);\n return super.ownerOf(tokenId);\n }\n\n // Authorises a controller, who can register and renew domains.\n function addController(address controller) external override onlyOwner {\n controllers[controller] = true;\n emit ControllerAdded(controller);\n }\n\n // Revoke controller permission for an address.\n function removeController(address controller) external override onlyOwner {\n controllers[controller] = false;\n emit ControllerRemoved(controller);\n }\n\n // Set the resolver for the TLD this registrar manages.\n function setResolver(address resolver) external override onlyOwner {\n ens.setResolver(baseNode, resolver);\n }\n\n // Returns the expiration timestamp of the specified id.\n function nameExpires(uint256 id) external view override returns (uint256) {\n return expiries[id];\n }\n\n // Returns true iff the specified name is available for registration.\n function available(uint256 id) public view override returns (bool) {\n // Not available if it's registered here or in its grace period.\n return expiries[id] + GRACE_PERIOD < block.timestamp;\n }\n\n /**\n * @dev Register a name.\n * @param id The token ID (keccak256 of the label).\n * @param owner The address that should own the registration.\n * @param duration Duration in seconds for the registration.\n */\n function register(\n uint256 id,\n address owner,\n uint256 duration\n ) external override returns (uint256) {\n return _register(id, owner, duration, true);\n }\n\n /**\n * @dev Register a name, without modifying the registry.\n * @param id The token ID (keccak256 of the label).\n * @param owner The address that should own the registration.\n * @param duration Duration in seconds for the registration.\n */\n function registerOnly(\n uint256 id,\n address owner,\n uint256 duration\n ) external returns (uint256) {\n return _register(id, owner, duration, false);\n }\n\n function _register(\n uint256 id,\n address owner,\n uint256 duration,\n bool updateRegistry\n ) internal live onlyController returns (uint256) {\n require(available(id));\n require(\n block.timestamp + duration + GRACE_PERIOD >\n block.timestamp + GRACE_PERIOD\n ); // Prevent future overflow\n\n expiries[id] = block.timestamp + duration;\n if (_exists(id)) {\n // Name was previously owned, and expired\n _burn(id);\n }\n _mint(owner, id);\n if (updateRegistry) {\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\n }\n\n emit NameRegistered(id, owner, block.timestamp + duration);\n\n return block.timestamp + duration;\n }\n\n function renew(\n uint256 id,\n uint256 duration\n ) external override live onlyController returns (uint256) {\n require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period\n require(\n expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\n ); // Prevent future overflow\n\n expiries[id] += duration;\n emit NameRenewed(id, expiries[id]);\n return expiries[id];\n }\n\n /**\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\n */\n function reclaim(uint256 id, address owner) external override live {\n require(_isApprovedOrOwner(msg.sender, id));\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view override(ERC721, IERC165) returns (bool) {\n return\n interfaceID == INTERFACE_META_ID ||\n interfaceID == ERC721_ID ||\n interfaceID == RECLAIM_ID;\n }\n}\n" + }, + "contracts/ethregistrar/BulkRenewal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../registry/ENS.sol\";\nimport \"./ETHRegistrarController.sol\";\nimport \"./IETHRegistrarController.sol\";\nimport \"../resolvers/Resolver.sol\";\nimport \"./IBulkRenewal.sol\";\nimport \"./IPriceOracle.sol\";\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract BulkRenewal is IBulkRenewal {\n bytes32 private constant ETH_NAMEHASH =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n\n constructor(ENS _ens) {\n ens = _ens;\n }\n\n function getController() internal view returns (ETHRegistrarController) {\n Resolver r = Resolver(ens.resolver(ETH_NAMEHASH));\n return\n ETHRegistrarController(\n r.interfaceImplementer(\n ETH_NAMEHASH,\n type(IETHRegistrarController).interfaceId\n )\n );\n }\n\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view override returns (uint256 total) {\n ETHRegistrarController controller = getController();\n uint256 length = names.length;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n unchecked {\n ++i;\n total += (price.base + price.premium);\n }\n }\n }\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable override {\n ETHRegistrarController controller = getController();\n uint256 length = names.length;\n uint256 total;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n uint256 totalPrice = price.base + price.premium;\n controller.renew{value: totalPrice}(names[i], duration);\n unchecked {\n ++i;\n total += totalPrice;\n }\n }\n // Send any excess funds back\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IBulkRenewal).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/DummyOracle.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyOracle {\n int256 value;\n\n constructor(int256 _value) public {\n set(_value);\n }\n\n function set(int256 _value) public {\n value = _value;\n }\n\n function latestAnswer() public view returns (int256) {\n return value;\n }\n}\n" + }, + "contracts/ethregistrar/ETHRegistrarController.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BaseRegistrarImplementation} from \"./BaseRegistrarImplementation.sol\";\nimport {StringUtils} from \"./StringUtils.sol\";\nimport {Resolver} from \"../resolvers/Resolver.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {ReverseRegistrar} from \"../reverseRegistrar/ReverseRegistrar.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {IETHRegistrarController, IPriceOracle} from \"./IETHRegistrarController.sol\";\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {INameWrapper} from \"../wrapper/INameWrapper.sol\";\nimport {ERC20Recoverable} from \"../utils/ERC20Recoverable.sol\";\n\nerror CommitmentTooNew(bytes32 commitment);\nerror CommitmentTooOld(bytes32 commitment);\nerror NameNotAvailable(string name);\nerror DurationTooShort(uint256 duration);\nerror ResolverRequiredWhenDataSupplied();\nerror UnexpiredCommitmentExists(bytes32 commitment);\nerror InsufficientValue();\nerror Unauthorised(bytes32 node);\nerror MaxCommitmentAgeTooLow();\nerror MaxCommitmentAgeTooHigh();\n\n/**\n * @dev A registrar controller for registering and renewing names at fixed cost.\n */\ncontract ETHRegistrarController is\n Ownable,\n IETHRegistrarController,\n IERC165,\n ERC20Recoverable,\n ReverseClaimer\n{\n using StringUtils for *;\n using Address for address;\n\n uint256 public constant MIN_REGISTRATION_DURATION = 28 days;\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n uint64 private constant MAX_EXPIRY = type(uint64).max;\n BaseRegistrarImplementation immutable base;\n IPriceOracle public immutable prices;\n uint256 public immutable minCommitmentAge;\n uint256 public immutable maxCommitmentAge;\n ReverseRegistrar public immutable reverseRegistrar;\n INameWrapper public immutable nameWrapper;\n\n mapping(bytes32 => uint256) public commitments;\n\n event NameRegistered(\n string name,\n bytes32 indexed label,\n address indexed owner,\n uint256 baseCost,\n uint256 premium,\n uint256 expires\n );\n event NameRenewed(\n string name,\n bytes32 indexed label,\n uint256 cost,\n uint256 expires\n );\n\n constructor(\n BaseRegistrarImplementation _base,\n IPriceOracle _prices,\n uint256 _minCommitmentAge,\n uint256 _maxCommitmentAge,\n ReverseRegistrar _reverseRegistrar,\n INameWrapper _nameWrapper,\n ENS _ens\n ) ReverseClaimer(_ens, msg.sender) {\n if (_maxCommitmentAge <= _minCommitmentAge) {\n revert MaxCommitmentAgeTooLow();\n }\n\n if (_maxCommitmentAge > block.timestamp) {\n revert MaxCommitmentAgeTooHigh();\n }\n\n base = _base;\n prices = _prices;\n minCommitmentAge = _minCommitmentAge;\n maxCommitmentAge = _maxCommitmentAge;\n reverseRegistrar = _reverseRegistrar;\n nameWrapper = _nameWrapper;\n }\n\n function rentPrice(\n string memory name,\n uint256 duration\n ) public view override returns (IPriceOracle.Price memory price) {\n bytes32 label = keccak256(bytes(name));\n price = prices.price(name, base.nameExpires(uint256(label)), duration);\n }\n\n function valid(string memory name) public pure returns (bool) {\n return name.strlen() >= 3;\n }\n\n function available(string memory name) public view override returns (bool) {\n bytes32 label = keccak256(bytes(name));\n return valid(name) && base.available(uint256(label));\n }\n\n function makeCommitment(\n string memory name,\n address owner,\n uint256 duration,\n bytes32 secret,\n address resolver,\n bytes[] calldata data,\n bool reverseRecord,\n uint16 ownerControlledFuses\n ) public pure override returns (bytes32) {\n bytes32 label = keccak256(bytes(name));\n if (data.length > 0 && resolver == address(0)) {\n revert ResolverRequiredWhenDataSupplied();\n }\n return\n keccak256(\n abi.encode(\n label,\n owner,\n duration,\n secret,\n resolver,\n data,\n reverseRecord,\n ownerControlledFuses\n )\n );\n }\n\n function commit(bytes32 commitment) public override {\n if (commitments[commitment] + maxCommitmentAge >= block.timestamp) {\n revert UnexpiredCommitmentExists(commitment);\n }\n commitments[commitment] = block.timestamp;\n }\n\n function register(\n string calldata name,\n address owner,\n uint256 duration,\n bytes32 secret,\n address resolver,\n bytes[] calldata data,\n bool reverseRecord,\n uint16 ownerControlledFuses\n ) public payable override {\n IPriceOracle.Price memory price = rentPrice(name, duration);\n if (msg.value < price.base + price.premium) {\n revert InsufficientValue();\n }\n\n _consumeCommitment(\n name,\n duration,\n makeCommitment(\n name,\n owner,\n duration,\n secret,\n resolver,\n data,\n reverseRecord,\n ownerControlledFuses\n )\n );\n\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\n name,\n owner,\n duration,\n resolver,\n ownerControlledFuses\n );\n\n if (data.length > 0) {\n _setRecords(resolver, keccak256(bytes(name)), data);\n }\n\n if (reverseRecord) {\n _setReverseRecord(name, resolver, msg.sender);\n }\n\n emit NameRegistered(\n name,\n keccak256(bytes(name)),\n owner,\n price.base,\n price.premium,\n expires\n );\n\n if (msg.value > (price.base + price.premium)) {\n payable(msg.sender).transfer(\n msg.value - (price.base + price.premium)\n );\n }\n }\n\n function renew(\n string calldata name,\n uint256 duration\n ) external payable override {\n bytes32 labelhash = keccak256(bytes(name));\n uint256 tokenId = uint256(labelhash);\n IPriceOracle.Price memory price = rentPrice(name, duration);\n if (msg.value < price.base) {\n revert InsufficientValue();\n }\n uint256 expires = nameWrapper.renew(tokenId, duration);\n\n if (msg.value > price.base) {\n payable(msg.sender).transfer(msg.value - price.base);\n }\n\n emit NameRenewed(name, labelhash, msg.value, expires);\n }\n\n function withdraw() public {\n payable(owner()).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IETHRegistrarController).interfaceId;\n }\n\n /* Internal functions */\n\n function _consumeCommitment(\n string memory name,\n uint256 duration,\n bytes32 commitment\n ) internal {\n // Require an old enough commitment.\n if (commitments[commitment] + minCommitmentAge > block.timestamp) {\n revert CommitmentTooNew(commitment);\n }\n\n // If the commitment is too old, or the name is registered, stop\n if (commitments[commitment] + maxCommitmentAge <= block.timestamp) {\n revert CommitmentTooOld(commitment);\n }\n if (!available(name)) {\n revert NameNotAvailable(name);\n }\n\n delete (commitments[commitment]);\n\n if (duration < MIN_REGISTRATION_DURATION) {\n revert DurationTooShort(duration);\n }\n }\n\n function _setRecords(\n address resolverAddress,\n bytes32 label,\n bytes[] calldata data\n ) internal {\n // use hardcoded .eth namehash\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, label));\n Resolver resolver = Resolver(resolverAddress);\n resolver.multicallWithNodeCheck(nodehash, data);\n }\n\n function _setReverseRecord(\n string memory name,\n address resolver,\n address owner\n ) internal {\n reverseRegistrar.setNameForAddr(\n msg.sender,\n owner,\n resolver,\n string.concat(name, \".eth\")\n );\n }\n}\n" + }, + "contracts/ethregistrar/ExponentialPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./StablePriceOracle.sol\";\n\ncontract ExponentialPremiumPriceOracle is StablePriceOracle {\n uint256 constant GRACE_PERIOD = 90 days;\n uint256 immutable startPremium;\n uint256 immutable endValue;\n\n constructor(\n AggregatorInterface _usdOracle,\n uint256[] memory _rentPrices,\n uint256 _startPremium,\n uint256 totalDays\n ) StablePriceOracle(_usdOracle, _rentPrices) {\n startPremium = _startPremium;\n endValue = _startPremium >> totalDays;\n }\n\n uint256 constant PRECISION = 1e18;\n uint256 constant bit1 = 999989423469314432; // 0.5 ^ 1/65536 * (10 ** 18)\n uint256 constant bit2 = 999978847050491904; // 0.5 ^ 2/65536 * (10 ** 18)\n uint256 constant bit3 = 999957694548431104;\n uint256 constant bit4 = 999915390886613504;\n uint256 constant bit5 = 999830788931929088;\n uint256 constant bit6 = 999661606496243712;\n uint256 constant bit7 = 999323327502650752;\n uint256 constant bit8 = 998647112890970240;\n uint256 constant bit9 = 997296056085470080;\n uint256 constant bit10 = 994599423483633152;\n uint256 constant bit11 = 989228013193975424;\n uint256 constant bit12 = 978572062087700096;\n uint256 constant bit13 = 957603280698573696;\n uint256 constant bit14 = 917004043204671232;\n uint256 constant bit15 = 840896415253714560;\n uint256 constant bit16 = 707106781186547584;\n\n /**\n * @dev Returns the pricing premium in internal base units.\n */\n function _premium(\n string memory,\n uint256 expires,\n uint256\n ) internal view override returns (uint256) {\n expires = expires + GRACE_PERIOD;\n if (expires > block.timestamp) {\n return 0;\n }\n\n uint256 elapsed = block.timestamp - expires;\n uint256 premium = decayedPremium(startPremium, elapsed);\n if (premium >= endValue) {\n return premium - endValue;\n }\n return 0;\n }\n\n /**\n * @dev Returns the premium price at current time elapsed\n * @param startPremium starting price\n * @param elapsed time past since expiry\n */\n function decayedPremium(\n uint256 startPremium,\n uint256 elapsed\n ) public pure returns (uint256) {\n uint256 daysPast = (elapsed * PRECISION) / 1 days;\n uint256 intDays = daysPast / PRECISION;\n uint256 premium = startPremium >> intDays;\n uint256 partDay = (daysPast - intDays * PRECISION);\n uint256 fraction = (partDay * (2 ** 16)) / PRECISION;\n uint256 totalPremium = addFractionalPremium(fraction, premium);\n return totalPremium;\n }\n\n function addFractionalPremium(\n uint256 fraction,\n uint256 premium\n ) internal pure returns (uint256) {\n if (fraction & (1 << 0) != 0) {\n premium = (premium * bit1) / PRECISION;\n }\n if (fraction & (1 << 1) != 0) {\n premium = (premium * bit2) / PRECISION;\n }\n if (fraction & (1 << 2) != 0) {\n premium = (premium * bit3) / PRECISION;\n }\n if (fraction & (1 << 3) != 0) {\n premium = (premium * bit4) / PRECISION;\n }\n if (fraction & (1 << 4) != 0) {\n premium = (premium * bit5) / PRECISION;\n }\n if (fraction & (1 << 5) != 0) {\n premium = (premium * bit6) / PRECISION;\n }\n if (fraction & (1 << 6) != 0) {\n premium = (premium * bit7) / PRECISION;\n }\n if (fraction & (1 << 7) != 0) {\n premium = (premium * bit8) / PRECISION;\n }\n if (fraction & (1 << 8) != 0) {\n premium = (premium * bit9) / PRECISION;\n }\n if (fraction & (1 << 9) != 0) {\n premium = (premium * bit10) / PRECISION;\n }\n if (fraction & (1 << 10) != 0) {\n premium = (premium * bit11) / PRECISION;\n }\n if (fraction & (1 << 11) != 0) {\n premium = (premium * bit12) / PRECISION;\n }\n if (fraction & (1 << 12) != 0) {\n premium = (premium * bit13) / PRECISION;\n }\n if (fraction & (1 << 13) != 0) {\n premium = (premium * bit14) / PRECISION;\n }\n if (fraction & (1 << 14) != 0) {\n premium = (premium * bit15) / PRECISION;\n }\n if (fraction & (1 << 15) != 0) {\n premium = (premium * bit16) / PRECISION;\n }\n return premium;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/ethregistrar/IBaseRegistrar.sol": { + "content": "import \"../registry/ENS.sol\";\nimport \"./IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\ninterface IBaseRegistrar is IERC721 {\n event ControllerAdded(address indexed controller);\n event ControllerRemoved(address indexed controller);\n event NameMigrated(\n uint256 indexed id,\n address indexed owner,\n uint256 expires\n );\n event NameRegistered(\n uint256 indexed id,\n address indexed owner,\n uint256 expires\n );\n event NameRenewed(uint256 indexed id, uint256 expires);\n\n // Authorises a controller, who can register and renew domains.\n function addController(address controller) external;\n\n // Revoke controller permission for an address.\n function removeController(address controller) external;\n\n // Set the resolver for the TLD this registrar manages.\n function setResolver(address resolver) external;\n\n // Returns the expiration timestamp of the specified label hash.\n function nameExpires(uint256 id) external view returns (uint256);\n\n // Returns true if the specified name is available for registration.\n function available(uint256 id) external view returns (bool);\n\n /**\n * @dev Register a name.\n */\n function register(\n uint256 id,\n address owner,\n uint256 duration\n ) external returns (uint256);\n\n function renew(uint256 id, uint256 duration) external returns (uint256);\n\n /**\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\n */\n function reclaim(uint256 id, address owner) external;\n}\n" + }, + "contracts/ethregistrar/IBulkRenewal.sol": { + "content": "interface IBulkRenewal {\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view returns (uint256 total);\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable;\n}\n" + }, + "contracts/ethregistrar/IETHRegistrarController.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\n\ninterface IETHRegistrarController {\n function rentPrice(\n string memory,\n uint256\n ) external view returns (IPriceOracle.Price memory);\n\n function available(string memory) external returns (bool);\n\n function makeCommitment(\n string memory,\n address,\n uint256,\n bytes32,\n address,\n bytes[] calldata,\n bool,\n uint16\n ) external pure returns (bytes32);\n\n function commit(bytes32) external;\n\n function register(\n string calldata,\n address,\n uint256,\n bytes32,\n address,\n bytes[] calldata,\n bool,\n uint16\n ) external payable;\n\n function renew(string calldata, uint256) external payable;\n}\n" + }, + "contracts/ethregistrar/ILinearPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface ILinearPremiumPriceOracle {\n function timeUntilPremium(\n uint256 expires,\n uint256 amount\n ) external view returns (uint256);\n}\n" + }, + "contracts/ethregistrar/IPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\ninterface IPriceOracle {\n struct Price {\n uint256 base;\n uint256 premium;\n }\n\n /**\n * @dev Returns the price to register or renew a name.\n * @param name The name being registered or renewed.\n * @param expires When the name presently expires (0 if this is a new registration).\n * @param duration How long the name is being registered or extended for, in seconds.\n * @return base premium tuple of base price + premium price\n */\n function price(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view returns (Price calldata);\n}\n" + }, + "contracts/ethregistrar/LinearPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./SafeMath.sol\";\nimport \"./StablePriceOracle.sol\";\n\ncontract LinearPremiumPriceOracle is StablePriceOracle {\n using SafeMath for *;\n\n uint256 immutable GRACE_PERIOD = 90 days;\n\n uint256 public immutable initialPremium;\n uint256 public immutable premiumDecreaseRate;\n\n bytes4 private constant TIME_UNTIL_PREMIUM_ID =\n bytes4(keccak256(\"timeUntilPremium(uint,uint\"));\n\n constructor(\n AggregatorInterface _usdOracle,\n uint256[] memory _rentPrices,\n uint256 _initialPremium,\n uint256 _premiumDecreaseRate\n ) public StablePriceOracle(_usdOracle, _rentPrices) {\n initialPremium = _initialPremium;\n premiumDecreaseRate = _premiumDecreaseRate;\n }\n\n function _premium(\n string memory name,\n uint256 expires,\n uint256 /*duration*/\n ) internal view override returns (uint256) {\n expires = expires.add(GRACE_PERIOD);\n if (expires > block.timestamp) {\n // No premium for renewals\n return 0;\n }\n\n // Calculate the discount off the maximum premium\n uint256 discount = premiumDecreaseRate.mul(\n block.timestamp.sub(expires)\n );\n\n // If we've run out the premium period, return 0.\n if (discount > initialPremium) {\n return 0;\n }\n\n return initialPremium - discount;\n }\n\n /**\n * @dev Returns the timestamp at which a name with the specified expiry date will have\n * the specified re-registration price premium.\n * @param expires The timestamp at which the name expires.\n * @param amount The amount, in wei, the caller is willing to pay\n * @return The timestamp at which the premium for this domain will be `amount`.\n */\n function timeUntilPremium(\n uint256 expires,\n uint256 amount\n ) external view returns (uint256) {\n amount = weiToAttoUSD(amount);\n require(amount <= initialPremium);\n\n expires = expires.add(GRACE_PERIOD);\n\n uint256 discount = initialPremium.sub(amount);\n uint256 duration = discount.div(premiumDecreaseRate);\n return expires.add(duration);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n (interfaceID == TIME_UNTIL_PREMIUM_ID) ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/ethregistrar/mocks/DummyProxyRegistry.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyProxyRegistry {\n address target;\n\n constructor(address _target) public {\n target = _target;\n }\n\n function proxies(address a) external view returns (address) {\n return target;\n }\n}\n" + }, + "contracts/ethregistrar/SafeMath.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\n/**\n * @title SafeMath\n * @dev Unsigned math operations with safety checks that revert on error\n */\nlibrary SafeMath {\n /**\n * @dev Multiplies two unsigned integers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two unsigned integers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),\n * reverts when dividing by zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0);\n return a % b;\n }\n}\n" + }, + "contracts/ethregistrar/StablePriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\nimport \"./StringUtils.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface AggregatorInterface {\n function latestAnswer() external view returns (int256);\n}\n\n// StablePriceOracle sets a price in USD, based on an oracle.\ncontract StablePriceOracle is IPriceOracle {\n using StringUtils for *;\n\n // Rent in base price units by length\n uint256 public immutable price1Letter;\n uint256 public immutable price2Letter;\n uint256 public immutable price3Letter;\n uint256 public immutable price4Letter;\n uint256 public immutable price5Letter;\n\n // Oracle address\n AggregatorInterface public immutable usdOracle;\n\n event RentPriceChanged(uint256[] prices);\n\n constructor(AggregatorInterface _usdOracle, uint256[] memory _rentPrices) {\n usdOracle = _usdOracle;\n price1Letter = _rentPrices[0];\n price2Letter = _rentPrices[1];\n price3Letter = _rentPrices[2];\n price4Letter = _rentPrices[3];\n price5Letter = _rentPrices[4];\n }\n\n function price(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view override returns (IPriceOracle.Price memory) {\n uint256 len = name.strlen();\n uint256 basePrice;\n\n if (len >= 5) {\n basePrice = price5Letter * duration;\n } else if (len == 4) {\n basePrice = price4Letter * duration;\n } else if (len == 3) {\n basePrice = price3Letter * duration;\n } else if (len == 2) {\n basePrice = price2Letter * duration;\n } else {\n basePrice = price1Letter * duration;\n }\n\n return\n IPriceOracle.Price({\n base: attoUSDToWei(basePrice),\n premium: attoUSDToWei(_premium(name, expires, duration))\n });\n }\n\n /**\n * @dev Returns the pricing premium in wei.\n */\n function premium(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view returns (uint256) {\n return attoUSDToWei(_premium(name, expires, duration));\n }\n\n /**\n * @dev Returns the pricing premium in internal base units.\n */\n function _premium(\n string memory name,\n uint256 expires,\n uint256 duration\n ) internal view virtual returns (uint256) {\n return 0;\n }\n\n function attoUSDToWei(uint256 amount) internal view returns (uint256) {\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\n return (amount * 1e8) / ethPrice;\n }\n\n function weiToAttoUSD(uint256 amount) internal view returns (uint256) {\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\n return (amount * ethPrice) / 1e8;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IPriceOracle).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/StaticBulkRenewal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./ETHRegistrarController.sol\";\nimport \"./IBulkRenewal.sol\";\nimport \"./IPriceOracle.sol\";\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract StaticBulkRenewal is IBulkRenewal {\n ETHRegistrarController controller;\n\n constructor(ETHRegistrarController _controller) {\n controller = _controller;\n }\n\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view override returns (uint256 total) {\n uint256 length = names.length;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n unchecked {\n ++i;\n total += (price.base + price.premium);\n }\n }\n }\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable override {\n uint256 length = names.length;\n uint256 total;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n uint256 totalPrice = price.base + price.premium;\n controller.renew{value: totalPrice}(names[i], duration);\n unchecked {\n ++i;\n total += totalPrice;\n }\n }\n // Send any excess funds back\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IBulkRenewal).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/StringUtils.sol": { + "content": "pragma solidity >=0.8.4;\n\nlibrary StringUtils {\n /**\n * @dev Returns the length of a given string\n *\n * @param s The string to measure the length of\n * @return The length of the input string\n */\n function strlen(string memory s) internal pure returns (uint256) {\n uint256 len;\n uint256 i = 0;\n uint256 bytelength = bytes(s).length;\n for (len = 0; i < bytelength; len++) {\n bytes1 b = bytes(s)[i];\n if (b < 0x80) {\n i += 1;\n } else if (b < 0xE0) {\n i += 2;\n } else if (b < 0xF0) {\n i += 3;\n } else if (b < 0xF8) {\n i += 4;\n } else if (b < 0xFC) {\n i += 5;\n } else {\n i += 6;\n }\n }\n return len;\n }\n}\n" + }, + "contracts/ethregistrar/TestResolver.sol": { + "content": "pragma solidity >=0.8.4;\n\n/**\n * @dev A test resolver implementation\n */\ncontract TestResolver {\n mapping(bytes32 => address) addresses;\n\n constructor() public {}\n\n function supportsInterface(bytes4 interfaceID) public pure returns (bool) {\n return interfaceID == 0x01ffc9a7 || interfaceID == 0x3b3b57de;\n }\n\n function addr(bytes32 node) public view returns (address) {\n return addresses[node];\n }\n\n function setAddr(bytes32 node, address addr) public {\n addresses[node] = addr;\n }\n}\n" + }, + "contracts/registry/ENS.sol": { + "content": "pragma solidity >=0.8.4;\n\ninterface ENS {\n // Logged when the owner of a node assigns a new owner to a subnode.\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\n\n // Logged when the owner of a node transfers ownership to a new account.\n event Transfer(bytes32 indexed node, address owner);\n\n // Logged when the resolver for a node changes.\n event NewResolver(bytes32 indexed node, address resolver);\n\n // Logged when the TTL of a node changes\n event NewTTL(bytes32 indexed node, uint64 ttl);\n\n // Logged when an operator is added or removed.\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeRecord(\n bytes32 node,\n bytes32 label,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) external returns (bytes32);\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setOwner(bytes32 node, address owner) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function setApprovalForAll(address operator, bool approved) external;\n\n function owner(bytes32 node) external view returns (address);\n\n function resolver(bytes32 node) external view returns (address);\n\n function ttl(bytes32 node) external view returns (uint64);\n\n function recordExists(bytes32 node) external view returns (bool);\n\n function isApprovedForAll(\n address owner,\n address operator\n ) external view returns (bool);\n}\n" + }, + "contracts/registry/ENSRegistry.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * The ENS registry contract.\n */\ncontract ENSRegistry is ENS {\n struct Record {\n address owner;\n address resolver;\n uint64 ttl;\n }\n\n mapping(bytes32 => Record) records;\n mapping(address => mapping(address => bool)) operators;\n\n // Permits modifications only by the owner of the specified node.\n modifier authorised(bytes32 node) {\n address owner = records[node].owner;\n require(owner == msg.sender || operators[owner][msg.sender]);\n _;\n }\n\n /**\n * @dev Constructs a new ENS registry.\n */\n constructor() public {\n records[0x0].owner = msg.sender;\n }\n\n /**\n * @dev Sets the record for a node.\n * @param node The node to update.\n * @param owner The address of the new owner.\n * @param resolver The address of the resolver.\n * @param ttl The TTL in seconds.\n */\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external virtual override {\n setOwner(node, owner);\n _setResolverAndTTL(node, resolver, ttl);\n }\n\n /**\n * @dev Sets the record for a subnode.\n * @param node The parent node.\n * @param label The hash of the label specifying the subnode.\n * @param owner The address of the new owner.\n * @param resolver The address of the resolver.\n * @param ttl The TTL in seconds.\n */\n function setSubnodeRecord(\n bytes32 node,\n bytes32 label,\n address owner,\n address resolver,\n uint64 ttl\n ) external virtual override {\n bytes32 subnode = setSubnodeOwner(node, label, owner);\n _setResolverAndTTL(subnode, resolver, ttl);\n }\n\n /**\n * @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.\n * @param node The node to transfer ownership of.\n * @param owner The address of the new owner.\n */\n function setOwner(\n bytes32 node,\n address owner\n ) public virtual override authorised(node) {\n _setOwner(node, owner);\n emit Transfer(node, owner);\n }\n\n /**\n * @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.\n * @param node The parent node.\n * @param label The hash of the label specifying the subnode.\n * @param owner The address of the new owner.\n */\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) public virtual override authorised(node) returns (bytes32) {\n bytes32 subnode = keccak256(abi.encodePacked(node, label));\n _setOwner(subnode, owner);\n emit NewOwner(node, label, owner);\n return subnode;\n }\n\n /**\n * @dev Sets the resolver address for the specified node.\n * @param node The node to update.\n * @param resolver The address of the resolver.\n */\n function setResolver(\n bytes32 node,\n address resolver\n ) public virtual override authorised(node) {\n emit NewResolver(node, resolver);\n records[node].resolver = resolver;\n }\n\n /**\n * @dev Sets the TTL for the specified node.\n * @param node The node to update.\n * @param ttl The TTL in seconds.\n */\n function setTTL(\n bytes32 node,\n uint64 ttl\n ) public virtual override authorised(node) {\n emit NewTTL(node, ttl);\n records[node].ttl = ttl;\n }\n\n /**\n * @dev Enable or disable approval for a third party (\"operator\") to manage\n * all of `msg.sender`'s ENS records. Emits the ApprovalForAll event.\n * @param operator Address to add to the set of authorized operators.\n * @param approved True if the operator is approved, false to revoke approval.\n */\n function setApprovalForAll(\n address operator,\n bool approved\n ) external virtual override {\n operators[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev Returns the address that owns the specified node.\n * @param node The specified node.\n * @return address of the owner.\n */\n function owner(\n bytes32 node\n ) public view virtual override returns (address) {\n address addr = records[node].owner;\n if (addr == address(this)) {\n return address(0x0);\n }\n\n return addr;\n }\n\n /**\n * @dev Returns the address of the resolver for the specified node.\n * @param node The specified node.\n * @return address of the resolver.\n */\n function resolver(\n bytes32 node\n ) public view virtual override returns (address) {\n return records[node].resolver;\n }\n\n /**\n * @dev Returns the TTL of a node, and any records associated with it.\n * @param node The specified node.\n * @return ttl of the node.\n */\n function ttl(bytes32 node) public view virtual override returns (uint64) {\n return records[node].ttl;\n }\n\n /**\n * @dev Returns whether a record has been imported to the registry.\n * @param node The specified node.\n * @return Bool if record exists\n */\n function recordExists(\n bytes32 node\n ) public view virtual override returns (bool) {\n return records[node].owner != address(0x0);\n }\n\n /**\n * @dev Query if an address is an authorized operator for another address.\n * @param owner The address that owns the records.\n * @param operator The address that acts on behalf of the owner.\n * @return True if `operator` is an approved operator for `owner`, false otherwise.\n */\n function isApprovedForAll(\n address owner,\n address operator\n ) external view virtual override returns (bool) {\n return operators[owner][operator];\n }\n\n function _setOwner(bytes32 node, address owner) internal virtual {\n records[node].owner = owner;\n }\n\n function _setResolverAndTTL(\n bytes32 node,\n address resolver,\n uint64 ttl\n ) internal {\n if (resolver != records[node].resolver) {\n records[node].resolver = resolver;\n emit NewResolver(node, resolver);\n }\n\n if (ttl != records[node].ttl) {\n records[node].ttl = ttl;\n emit NewTTL(node, ttl);\n }\n }\n}\n" + }, + "contracts/registry/ENSRegistryWithFallback.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\nimport \"./ENSRegistry.sol\";\n\n/**\n * The ENS registry contract.\n */\ncontract ENSRegistryWithFallback is ENSRegistry {\n ENS public old;\n\n /**\n * @dev Constructs a new ENS registrar.\n */\n constructor(ENS _old) public ENSRegistry() {\n old = _old;\n }\n\n /**\n * @dev Returns the address of the resolver for the specified node.\n * @param node The specified node.\n * @return address of the resolver.\n */\n function resolver(bytes32 node) public view override returns (address) {\n if (!recordExists(node)) {\n return old.resolver(node);\n }\n\n return super.resolver(node);\n }\n\n /**\n * @dev Returns the address that owns the specified node.\n * @param node The specified node.\n * @return address of the owner.\n */\n function owner(bytes32 node) public view override returns (address) {\n if (!recordExists(node)) {\n return old.owner(node);\n }\n\n return super.owner(node);\n }\n\n /**\n * @dev Returns the TTL of a node, and any records associated with it.\n * @param node The specified node.\n * @return ttl of the node.\n */\n function ttl(bytes32 node) public view override returns (uint64) {\n if (!recordExists(node)) {\n return old.ttl(node);\n }\n\n return super.ttl(node);\n }\n\n function _setOwner(bytes32 node, address owner) internal override {\n address addr = owner;\n if (addr == address(0x0)) {\n addr = address(this);\n }\n\n super._setOwner(node, addr);\n }\n}\n" + }, + "contracts/registry/FIFSRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * A registrar that allocates subdomains to the first person to claim them.\n */\ncontract FIFSRegistrar {\n ENS ens;\n bytes32 rootNode;\n\n modifier only_owner(bytes32 label) {\n address currentOwner = ens.owner(\n keccak256(abi.encodePacked(rootNode, label))\n );\n require(currentOwner == address(0x0) || currentOwner == msg.sender);\n _;\n }\n\n /**\n * Constructor.\n * @param ensAddr The address of the ENS registry.\n * @param node The node that this registrar administers.\n */\n constructor(ENS ensAddr, bytes32 node) public {\n ens = ensAddr;\n rootNode = node;\n }\n\n /**\n * Register a name, or change the owner of an existing registration.\n * @param label The hash of the label to register.\n * @param owner The address of the new owner.\n */\n function register(bytes32 label, address owner) public only_owner(label) {\n ens.setSubnodeOwner(rootNode, label, owner);\n }\n}\n" + }, + "contracts/registry/TestRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * A registrar that allocates subdomains to the first person to claim them, but\n * expires registrations a fixed period after they're initially claimed.\n */\ncontract TestRegistrar {\n uint256 constant registrationPeriod = 4 weeks;\n\n ENS public immutable ens;\n bytes32 public immutable rootNode;\n mapping(bytes32 => uint256) public expiryTimes;\n\n /**\n * Constructor.\n * @param ensAddr The address of the ENS registry.\n * @param node The node that this registrar administers.\n */\n constructor(ENS ensAddr, bytes32 node) {\n ens = ensAddr;\n rootNode = node;\n }\n\n /**\n * Register a name that's not currently registered\n * @param label The hash of the label to register.\n * @param owner The address of the new owner.\n */\n function register(bytes32 label, address owner) public {\n require(expiryTimes[label] < block.timestamp);\n\n expiryTimes[label] = block.timestamp + registrationPeriod;\n ens.setSubnodeOwner(rootNode, label, owner);\n }\n}\n" + }, + "contracts/resolvers/IMulticallable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IMulticallable {\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n function multicallWithNodeCheck(\n bytes32,\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n}\n" + }, + "contracts/resolvers/mocks/DummyNameWrapper.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev Implements a dummy NameWrapper which returns the caller's address\n */\ncontract DummyNameWrapper {\n function ownerOf(uint256 /* id */) public view returns (address) {\n return tx.origin;\n }\n}\n" + }, + "contracts/resolvers/Multicallable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"./IMulticallable.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\nabstract contract Multicallable is IMulticallable, ERC165 {\n function _multicall(\n bytes32 nodehash,\n bytes[] calldata data\n ) internal returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n if (nodehash != bytes32(0)) {\n bytes32 txNamehash = bytes32(data[i][4:36]);\n require(\n txNamehash == nodehash,\n \"multicall: All records must have a matching namehash\"\n );\n }\n (bool success, bytes memory result) = address(this).delegatecall(\n data[i]\n );\n require(success);\n results[i] = result;\n }\n return results;\n }\n\n // This function provides an extra security check when called\n // from priviledged contracts (such as EthRegistrarController)\n // that can set records on behalf of the node owners\n function multicallWithNodeCheck(\n bytes32 nodehash,\n bytes[] calldata data\n ) external returns (bytes[] memory results) {\n return _multicall(nodehash, data);\n }\n\n function multicall(\n bytes[] calldata data\n ) public override returns (bytes[] memory results) {\n return _multicall(bytes32(0), data);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IMulticallable).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/OwnedResolver.sol": { + "content": "pragma solidity >=0.8.4;\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./profiles/ABIResolver.sol\";\nimport \"./profiles/AddrResolver.sol\";\nimport \"./profiles/ContentHashResolver.sol\";\nimport \"./profiles/DNSResolver.sol\";\nimport \"./profiles/InterfaceResolver.sol\";\nimport \"./profiles/NameResolver.sol\";\nimport \"./profiles/PubkeyResolver.sol\";\nimport \"./profiles/TextResolver.sol\";\nimport \"./profiles/ExtendedResolver.sol\";\n\n/**\n * A simple resolver anyone can use; only allows the owner of a node to set its\n * address.\n */\ncontract OwnedResolver is\n Ownable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver,\n ExtendedResolver\n{\n function isAuthorised(bytes32) internal view override returns (bool) {\n return msg.sender == owner();\n }\n\n function supportsInterface(\n bytes4 interfaceID\n )\n public\n view\n virtual\n override(\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver\n )\n returns (bool)\n {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/ABIResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"./IABIResolver.sol\";\nimport \"../ResolverBase.sol\";\n\nabstract contract ABIResolver is IABIResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_abis;\n\n /**\n * Sets the ABI associated with an ENS node.\n * Nodes may have one ABI of each content type. To remove an ABI, set it to\n * the empty string.\n * @param node The node to update.\n * @param contentType The content type of the ABI\n * @param data The ABI data.\n */\n function setABI(\n bytes32 node,\n uint256 contentType,\n bytes calldata data\n ) external virtual authorised(node) {\n // Content types must be powers of 2\n require(((contentType - 1) & contentType) == 0);\n\n versionable_abis[recordVersions[node]][node][contentType] = data;\n emit ABIChanged(node, contentType);\n }\n\n /**\n * Returns the ABI associated with an ENS node.\n * Defined in EIP205.\n * @param node The ENS node to query\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\n * @return contentType The content type of the return value\n * @return data The ABI data\n */\n function ABI(\n bytes32 node,\n uint256 contentTypes\n ) external view virtual override returns (uint256, bytes memory) {\n mapping(uint256 => bytes) storage abiset = versionable_abis[\n recordVersions[node]\n ][node];\n\n for (\n uint256 contentType = 1;\n contentType <= contentTypes;\n contentType <<= 1\n ) {\n if (\n (contentType & contentTypes) != 0 &&\n abiset[contentType].length > 0\n ) {\n return (contentType, abiset[contentType]);\n }\n }\n\n return (0, bytes(\"\"));\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IABIResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/AddrResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IAddrResolver.sol\";\nimport \"./IAddressResolver.sol\";\n\nabstract contract AddrResolver is\n IAddrResolver,\n IAddressResolver,\n ResolverBase\n{\n uint256 private constant COIN_TYPE_ETH = 60;\n\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;\n\n /**\n * Sets the address associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param a The address to set.\n */\n function setAddr(\n bytes32 node,\n address a\n ) external virtual authorised(node) {\n setAddr(node, COIN_TYPE_ETH, addressToBytes(a));\n }\n\n /**\n * Returns the address associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated address.\n */\n function addr(\n bytes32 node\n ) public view virtual override returns (address payable) {\n bytes memory a = addr(node, COIN_TYPE_ETH);\n if (a.length == 0) {\n return payable(0);\n }\n return bytesToAddress(a);\n }\n\n function setAddr(\n bytes32 node,\n uint256 coinType,\n bytes memory a\n ) public virtual authorised(node) {\n emit AddressChanged(node, coinType, a);\n if (coinType == COIN_TYPE_ETH) {\n emit AddrChanged(node, bytesToAddress(a));\n }\n versionable_addresses[recordVersions[node]][node][coinType] = a;\n }\n\n function addr(\n bytes32 node,\n uint256 coinType\n ) public view virtual override returns (bytes memory) {\n return versionable_addresses[recordVersions[node]][node][coinType];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IAddrResolver).interfaceId ||\n interfaceID == type(IAddressResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n\n function bytesToAddress(\n bytes memory b\n ) internal pure returns (address payable a) {\n require(b.length == 20);\n assembly {\n a := div(mload(add(b, 32)), exp(256, 12))\n }\n }\n\n function addressToBytes(address a) internal pure returns (bytes memory b) {\n b = new bytes(20);\n assembly {\n mstore(add(b, 32), mul(a, exp(256, 12)))\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/ContentHashResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IContentHashResolver.sol\";\n\nabstract contract ContentHashResolver is IContentHashResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => bytes)) versionable_hashes;\n\n /**\n * Sets the contenthash associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param hash The contenthash to set\n */\n function setContenthash(\n bytes32 node,\n bytes calldata hash\n ) external virtual authorised(node) {\n versionable_hashes[recordVersions[node]][node] = hash;\n emit ContenthashChanged(node, hash);\n }\n\n /**\n * Returns the contenthash associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function contenthash(\n bytes32 node\n ) external view virtual override returns (bytes memory) {\n return versionable_hashes[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IContentHashResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/DNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"../../dnssec-oracle/RRUtils.sol\";\nimport \"./IDNSRecordResolver.sol\";\nimport \"./IDNSZoneResolver.sol\";\n\nabstract contract DNSResolver is\n IDNSRecordResolver,\n IDNSZoneResolver,\n ResolverBase\n{\n using RRUtils for *;\n using BytesUtils for bytes;\n\n // Zone hashes for the domains.\n // A zone hash is an EIP-1577 content hash in binary format that should point to a\n // resource containing a single zonefile.\n // node => contenthash\n mapping(uint64 => mapping(bytes32 => bytes)) private versionable_zonehashes;\n\n // The records themselves. Stored as binary RRSETs\n // node => version => name => resource => data\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))\n private versionable_records;\n\n // Count of number of entries for a given name. Required for DNS resolvers\n // when resolving wildcards.\n // node => version => name => number of records\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))\n private versionable_nameEntriesCount;\n\n /**\n * Set one or more DNS records. Records are supplied in wire-format.\n * Records with the same node/name/resource must be supplied one after the\n * other to ensure the data is updated correctly. For example, if the data\n * was supplied:\n * a.example.com IN A 1.2.3.4\n * a.example.com IN A 5.6.7.8\n * www.example.com IN CNAME a.example.com.\n * then this would store the two A records for a.example.com correctly as a\n * single RRSET, however if the data was supplied:\n * a.example.com IN A 1.2.3.4\n * www.example.com IN CNAME a.example.com.\n * a.example.com IN A 5.6.7.8\n * then this would store the first A record, the CNAME, then the second A\n * record which would overwrite the first.\n *\n * @param node the namehash of the node for which to set the records\n * @param data the DNS wire format records to set\n */\n function setDNSRecords(\n bytes32 node,\n bytes calldata data\n ) external virtual authorised(node) {\n uint16 resource = 0;\n uint256 offset = 0;\n bytes memory name;\n bytes memory value;\n bytes32 nameHash;\n uint64 version = recordVersions[node];\n // Iterate over the data to add the resource records\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n if (resource == 0) {\n resource = iter.dnstype;\n name = iter.name();\n nameHash = keccak256(abi.encodePacked(name));\n value = bytes(iter.rdata());\n } else {\n bytes memory newName = iter.name();\n if (resource != iter.dnstype || !name.equals(newName)) {\n setDNSRRSet(\n node,\n name,\n resource,\n data,\n offset,\n iter.offset - offset,\n value.length == 0,\n version\n );\n resource = iter.dnstype;\n offset = iter.offset;\n name = newName;\n nameHash = keccak256(name);\n value = bytes(iter.rdata());\n }\n }\n }\n if (name.length > 0) {\n setDNSRRSet(\n node,\n name,\n resource,\n data,\n offset,\n data.length - offset,\n value.length == 0,\n version\n );\n }\n }\n\n /**\n * Obtain a DNS record.\n * @param node the namehash of the node for which to fetch the record\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\n * @return the DNS record in wire format if present, otherwise empty\n */\n function dnsRecord(\n bytes32 node,\n bytes32 name,\n uint16 resource\n ) public view virtual override returns (bytes memory) {\n return versionable_records[recordVersions[node]][node][name][resource];\n }\n\n /**\n * Check if a given node has records.\n * @param node the namehash of the node for which to check the records\n * @param name the namehash of the node for which to check the records\n */\n function hasDNSRecords(\n bytes32 node,\n bytes32 name\n ) public view virtual returns (bool) {\n return (versionable_nameEntriesCount[recordVersions[node]][node][\n name\n ] != 0);\n }\n\n /**\n * setZonehash sets the hash for the zone.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param hash The zonehash to set\n */\n function setZonehash(\n bytes32 node,\n bytes calldata hash\n ) external virtual authorised(node) {\n uint64 currentRecordVersion = recordVersions[node];\n bytes memory oldhash = versionable_zonehashes[currentRecordVersion][\n node\n ];\n versionable_zonehashes[currentRecordVersion][node] = hash;\n emit DNSZonehashChanged(node, oldhash, hash);\n }\n\n /**\n * zonehash obtains the hash for the zone.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function zonehash(\n bytes32 node\n ) external view virtual override returns (bytes memory) {\n return versionable_zonehashes[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IDNSRecordResolver).interfaceId ||\n interfaceID == type(IDNSZoneResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n\n function setDNSRRSet(\n bytes32 node,\n bytes memory name,\n uint16 resource,\n bytes memory data,\n uint256 offset,\n uint256 size,\n bool deleteRecord,\n uint64 version\n ) private {\n bytes32 nameHash = keccak256(name);\n bytes memory rrData = data.substring(offset, size);\n if (deleteRecord) {\n if (\n versionable_records[version][node][nameHash][resource].length !=\n 0\n ) {\n versionable_nameEntriesCount[version][node][nameHash]--;\n }\n delete (versionable_records[version][node][nameHash][resource]);\n emit DNSRecordDeleted(node, name, resource);\n } else {\n if (\n versionable_records[version][node][nameHash][resource].length ==\n 0\n ) {\n versionable_nameEntriesCount[version][node][nameHash]++;\n }\n versionable_records[version][node][nameHash][resource] = rrData;\n emit DNSRecordChanged(node, name, resource, rrData);\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/ExtendedResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ncontract ExtendedResolver {\n function resolve(\n bytes memory /* name */,\n bytes memory data\n ) external view returns (bytes memory) {\n (bool success, bytes memory result) = address(this).staticcall(data);\n if (success) {\n return result;\n } else {\n // Revert with the reason provided by the call\n assembly {\n revert(add(result, 0x20), mload(result))\n }\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/IABIResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IABIResolver {\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\n\n /**\n * Returns the ABI associated with an ENS node.\n * Defined in EIP205.\n * @param node The ENS node to query\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\n * @return contentType The content type of the return value\n * @return data The ABI data\n */\n function ABI(\n bytes32 node,\n uint256 contentTypes\n ) external view returns (uint256, bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IAddressResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the new (multicoin) addr function.\n */\ninterface IAddressResolver {\n event AddressChanged(\n bytes32 indexed node,\n uint256 coinType,\n bytes newAddress\n );\n\n function addr(\n bytes32 node,\n uint256 coinType\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IAddrResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the legacy (ETH-only) addr function.\n */\ninterface IAddrResolver {\n event AddrChanged(bytes32 indexed node, address a);\n\n /**\n * Returns the address associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated address.\n */\n function addr(bytes32 node) external view returns (address payable);\n}\n" + }, + "contracts/resolvers/profiles/IContentHashResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IContentHashResolver {\n event ContenthashChanged(bytes32 indexed node, bytes hash);\n\n /**\n * Returns the contenthash associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function contenthash(bytes32 node) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IDNSRecordResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSRecordResolver {\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\n event DNSRecordChanged(\n bytes32 indexed node,\n bytes name,\n uint16 resource,\n bytes record\n );\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\n\n /**\n * Obtain a DNS record.\n * @param node the namehash of the node for which to fetch the record\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\n * @return the DNS record in wire format if present, otherwise empty\n */\n function dnsRecord(\n bytes32 node,\n bytes32 name,\n uint16 resource\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IDNSZoneResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSZoneResolver {\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\n event DNSZonehashChanged(\n bytes32 indexed node,\n bytes lastzonehash,\n bytes zonehash\n );\n\n /**\n * zonehash obtains the hash for the zone.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function zonehash(bytes32 node) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IExtendedDNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedDNSResolver {\n function resolve(\n bytes memory name,\n bytes memory data,\n bytes memory context\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IExtendedResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedResolver {\n function resolve(\n bytes memory name,\n bytes memory data\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IInterfaceResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IInterfaceResolver {\n event InterfaceChanged(\n bytes32 indexed node,\n bytes4 indexed interfaceID,\n address implementer\n );\n\n /**\n * Returns the address of a contract that implements the specified interface for this name.\n * If an implementer has not been set for this interfaceID and name, the resolver will query\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\n * will be returned.\n * @param node The ENS node to query.\n * @param interfaceID The EIP 165 interface ID to check for.\n * @return The address that implements this interface, or 0 if the interface is unsupported.\n */\n function interfaceImplementer(\n bytes32 node,\n bytes4 interfaceID\n ) external view returns (address);\n}\n" + }, + "contracts/resolvers/profiles/INameResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface INameResolver {\n event NameChanged(bytes32 indexed node, string name);\n\n /**\n * Returns the name associated with an ENS node, for reverse records.\n * Defined in EIP181.\n * @param node The ENS node to query.\n * @return The associated name.\n */\n function name(bytes32 node) external view returns (string memory);\n}\n" + }, + "contracts/resolvers/profiles/InterfaceResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../ResolverBase.sol\";\nimport \"./AddrResolver.sol\";\nimport \"./IInterfaceResolver.sol\";\n\nabstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {\n mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address))) versionable_interfaces;\n\n /**\n * Sets an interface associated with a name.\n * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.\n * @param node The node to update.\n * @param interfaceID The EIP 165 interface ID.\n * @param implementer The address of a contract that implements this interface for this node.\n */\n function setInterface(\n bytes32 node,\n bytes4 interfaceID,\n address implementer\n ) external virtual authorised(node) {\n versionable_interfaces[recordVersions[node]][node][\n interfaceID\n ] = implementer;\n emit InterfaceChanged(node, interfaceID, implementer);\n }\n\n /**\n * Returns the address of a contract that implements the specified interface for this name.\n * If an implementer has not been set for this interfaceID and name, the resolver will query\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\n * will be returned.\n * @param node The ENS node to query.\n * @param interfaceID The EIP 165 interface ID to check for.\n * @return The address that implements this interface, or 0 if the interface is unsupported.\n */\n function interfaceImplementer(\n bytes32 node,\n bytes4 interfaceID\n ) external view virtual override returns (address) {\n address implementer = versionable_interfaces[recordVersions[node]][\n node\n ][interfaceID];\n if (implementer != address(0)) {\n return implementer;\n }\n\n address a = addr(node);\n if (a == address(0)) {\n return address(0);\n }\n\n (bool success, bytes memory returnData) = a.staticcall(\n abi.encodeWithSignature(\n \"supportsInterface(bytes4)\",\n type(IERC165).interfaceId\n )\n );\n if (!success || returnData.length < 32 || returnData[31] == 0) {\n // EIP 165 not supported by target\n return address(0);\n }\n\n (success, returnData) = a.staticcall(\n abi.encodeWithSignature(\"supportsInterface(bytes4)\", interfaceID)\n );\n if (!success || returnData.length < 32 || returnData[31] == 0) {\n // Specified interface not supported by target\n return address(0);\n }\n\n return a;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IInterfaceResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/IPubkeyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IPubkeyResolver {\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\n\n /**\n * Returns the SECP256k1 public key associated with an ENS node.\n * Defined in EIP 619.\n * @param node The ENS node to query\n * @return x The X coordinate of the curve point for the public key.\n * @return y The Y coordinate of the curve point for the public key.\n */\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\n}\n" + }, + "contracts/resolvers/profiles/ITextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface ITextResolver {\n event TextChanged(\n bytes32 indexed node,\n string indexed indexedKey,\n string key,\n string value\n );\n\n /**\n * Returns the text data associated with an ENS node and key.\n * @param node The ENS node to query.\n * @param key The text data key to query.\n * @return The associated text data.\n */\n function text(\n bytes32 node,\n string calldata key\n ) external view returns (string memory);\n}\n" + }, + "contracts/resolvers/profiles/IVersionableResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IVersionableResolver {\n event VersionChanged(bytes32 indexed node, uint64 newVersion);\n\n function recordVersions(bytes32 node) external view returns (uint64);\n}\n" + }, + "contracts/resolvers/profiles/NameResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./INameResolver.sol\";\n\nabstract contract NameResolver is INameResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => string)) versionable_names;\n\n /**\n * Sets the name associated with an ENS node, for reverse records.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n */\n function setName(\n bytes32 node,\n string calldata newName\n ) external virtual authorised(node) {\n versionable_names[recordVersions[node]][node] = newName;\n emit NameChanged(node, newName);\n }\n\n /**\n * Returns the name associated with an ENS node, for reverse records.\n * Defined in EIP181.\n * @param node The ENS node to query.\n * @return The associated name.\n */\n function name(\n bytes32 node\n ) external view virtual override returns (string memory) {\n return versionable_names[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(INameResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/PubkeyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IPubkeyResolver.sol\";\n\nabstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {\n struct PublicKey {\n bytes32 x;\n bytes32 y;\n }\n\n mapping(uint64 => mapping(bytes32 => PublicKey)) versionable_pubkeys;\n\n /**\n * Sets the SECP256k1 public key associated with an ENS node.\n * @param node The ENS node to query\n * @param x the X coordinate of the curve point for the public key.\n * @param y the Y coordinate of the curve point for the public key.\n */\n function setPubkey(\n bytes32 node,\n bytes32 x,\n bytes32 y\n ) external virtual authorised(node) {\n versionable_pubkeys[recordVersions[node]][node] = PublicKey(x, y);\n emit PubkeyChanged(node, x, y);\n }\n\n /**\n * Returns the SECP256k1 public key associated with an ENS node.\n * Defined in EIP 619.\n * @param node The ENS node to query\n * @return x The X coordinate of the curve point for the public key.\n * @return y The Y coordinate of the curve point for the public key.\n */\n function pubkey(\n bytes32 node\n ) external view virtual override returns (bytes32 x, bytes32 y) {\n uint64 currentRecordVersion = recordVersions[node];\n return (\n versionable_pubkeys[currentRecordVersion][node].x,\n versionable_pubkeys[currentRecordVersion][node].y\n );\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IPubkeyResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/TextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./ITextResolver.sol\";\n\nabstract contract TextResolver is ITextResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => mapping(string => string))) versionable_texts;\n\n /**\n * Sets the text data associated with an ENS node and key.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param key The key to set.\n * @param value The text data value to set.\n */\n function setText(\n bytes32 node,\n string calldata key,\n string calldata value\n ) external virtual authorised(node) {\n versionable_texts[recordVersions[node]][node][key] = value;\n emit TextChanged(node, key, key, value);\n }\n\n /**\n * Returns the text data associated with an ENS node and key.\n * @param node The ENS node to query.\n * @param key The text data key to query.\n * @return The associated text data.\n */\n function text(\n bytes32 node,\n string calldata key\n ) external view virtual override returns (string memory) {\n return versionable_texts[recordVersions[node]][node][key];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(ITextResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/PublicResolver.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport \"../registry/ENS.sol\";\nimport \"./profiles/ABIResolver.sol\";\nimport \"./profiles/AddrResolver.sol\";\nimport \"./profiles/ContentHashResolver.sol\";\nimport \"./profiles/DNSResolver.sol\";\nimport \"./profiles/InterfaceResolver.sol\";\nimport \"./profiles/NameResolver.sol\";\nimport \"./profiles/PubkeyResolver.sol\";\nimport \"./profiles/TextResolver.sol\";\nimport \"./Multicallable.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {INameWrapper} from \"../wrapper/INameWrapper.sol\";\n\n/**\n * A simple resolver anyone can use; only allows the owner of a node to set its\n * address.\n */\ncontract PublicResolver is\n Multicallable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver,\n ReverseClaimer\n{\n ENS immutable ens;\n INameWrapper immutable nameWrapper;\n address immutable trustedETHController;\n address immutable trustedReverseRegistrar;\n\n /**\n * A mapping of operators. An address that is authorised for an address\n * may make any changes to the name that the owner could, but may not update\n * the set of authorisations.\n * (owner, operator) => approved\n */\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * A mapping of delegates. A delegate that is authorised by an owner\n * for a name may make changes to the name's resolver, but may not update\n * the set of token approvals.\n * (owner, name, delegate) => approved\n */\n mapping(address => mapping(bytes32 => mapping(address => bool)))\n private _tokenApprovals;\n\n // Logged when an operator is added or removed.\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n\n // Logged when a delegate is approved or an approval is revoked.\n event Approved(\n address owner,\n bytes32 indexed node,\n address indexed delegate,\n bool indexed approved\n );\n\n constructor(\n ENS _ens,\n INameWrapper wrapperAddress,\n address _trustedETHController,\n address _trustedReverseRegistrar\n ) ReverseClaimer(_ens, msg.sender) {\n ens = _ens;\n nameWrapper = wrapperAddress;\n trustedETHController = _trustedETHController;\n trustedReverseRegistrar = _trustedReverseRegistrar;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) external {\n require(\n msg.sender != operator,\n \"ERC1155: setting approval status for self\"\n );\n\n _operatorApprovals[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev Approve a delegate to be able to updated records on a node.\n */\n function approve(bytes32 node, address delegate, bool approved) external {\n require(msg.sender != delegate, \"Setting delegate status for self\");\n\n _tokenApprovals[msg.sender][node][delegate] = approved;\n emit Approved(msg.sender, node, delegate, approved);\n }\n\n /**\n * @dev Check to see if the delegate has been approved by the owner for the node.\n */\n function isApprovedFor(\n address owner,\n bytes32 node,\n address delegate\n ) public view returns (bool) {\n return _tokenApprovals[owner][node][delegate];\n }\n\n function isAuthorised(bytes32 node) internal view override returns (bool) {\n if (\n msg.sender == trustedETHController ||\n msg.sender == trustedReverseRegistrar\n ) {\n return true;\n }\n address owner = ens.owner(node);\n if (owner == address(nameWrapper)) {\n owner = nameWrapper.ownerOf(uint256(node));\n }\n return\n owner == msg.sender ||\n isApprovedForAll(owner, msg.sender) ||\n isApprovedFor(owner, node, msg.sender);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n )\n public\n view\n override(\n Multicallable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver\n )\n returns (bool)\n {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/Resolver.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"./profiles/IABIResolver.sol\";\nimport \"./profiles/IAddressResolver.sol\";\nimport \"./profiles/IAddrResolver.sol\";\nimport \"./profiles/IContentHashResolver.sol\";\nimport \"./profiles/IDNSRecordResolver.sol\";\nimport \"./profiles/IDNSZoneResolver.sol\";\nimport \"./profiles/IInterfaceResolver.sol\";\nimport \"./profiles/INameResolver.sol\";\nimport \"./profiles/IPubkeyResolver.sol\";\nimport \"./profiles/ITextResolver.sol\";\nimport \"./profiles/IExtendedResolver.sol\";\n\n/**\n * A generic resolver interface which includes all the functions including the ones deprecated\n */\ninterface Resolver is\n IERC165,\n IABIResolver,\n IAddressResolver,\n IAddrResolver,\n IContentHashResolver,\n IDNSRecordResolver,\n IDNSZoneResolver,\n IInterfaceResolver,\n INameResolver,\n IPubkeyResolver,\n ITextResolver,\n IExtendedResolver\n{\n /* Deprecated events */\n event ContentChanged(bytes32 indexed node, bytes32 hash);\n\n function setApprovalForAll(address, bool) external;\n\n function approve(bytes32 node, address delegate, bool approved) external;\n\n function isApprovedForAll(address account, address operator) external;\n\n function isApprovedFor(\n address owner,\n bytes32 node,\n address delegate\n ) external;\n\n function setABI(\n bytes32 node,\n uint256 contentType,\n bytes calldata data\n ) external;\n\n function setAddr(bytes32 node, address addr) external;\n\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\n\n function setContenthash(bytes32 node, bytes calldata hash) external;\n\n function setDnsrr(bytes32 node, bytes calldata data) external;\n\n function setName(bytes32 node, string calldata _name) external;\n\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\n\n function setText(\n bytes32 node,\n string calldata key,\n string calldata value\n ) external;\n\n function setInterface(\n bytes32 node,\n bytes4 interfaceID,\n address implementer\n ) external;\n\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n function multicallWithNodeCheck(\n bytes32 nodehash,\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n /* Deprecated functions */\n function content(bytes32 node) external view returns (bytes32);\n\n function multihash(bytes32 node) external view returns (bytes memory);\n\n function setContent(bytes32 node, bytes32 hash) external;\n\n function setMultihash(bytes32 node, bytes calldata hash) external;\n}\n" + }, + "contracts/resolvers/ResolverBase.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"./profiles/IVersionableResolver.sol\";\n\nabstract contract ResolverBase is ERC165, IVersionableResolver {\n mapping(bytes32 => uint64) public recordVersions;\n\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\n\n modifier authorised(bytes32 node) {\n require(isAuthorised(node));\n _;\n }\n\n /**\n * Increments the record version associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n */\n function clearRecords(bytes32 node) public virtual authorised(node) {\n recordVersions[node]++;\n emit VersionChanged(node, recordVersions[node]);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IVersionableResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/reverseRegistrar/IReverseRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\ninterface IReverseRegistrar {\n function setDefaultResolver(address resolver) external;\n\n function claim(address owner) external returns (bytes32);\n\n function claimForAddr(\n address addr,\n address owner,\n address resolver\n ) external returns (bytes32);\n\n function claimWithResolver(\n address owner,\n address resolver\n ) external returns (bytes32);\n\n function setName(string memory name) external returns (bytes32);\n\n function setNameForAddr(\n address addr,\n address owner,\n address resolver,\n string memory name\n ) external returns (bytes32);\n\n function node(address addr) external pure returns (bytes32);\n}\n" + }, + "contracts/reverseRegistrar/ReverseClaimer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IReverseRegistrar} from \"../reverseRegistrar/IReverseRegistrar.sol\";\n\ncontract ReverseClaimer {\n bytes32 constant ADDR_REVERSE_NODE =\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\n\n constructor(ENS ens, address claimant) {\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\n ens.owner(ADDR_REVERSE_NODE)\n );\n reverseRegistrar.claim(claimant);\n }\n}\n" + }, + "contracts/reverseRegistrar/ReverseRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"./IReverseRegistrar.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"../root/Controllable.sol\";\n\nabstract contract NameResolver {\n function setName(bytes32 node, string memory name) public virtual;\n}\n\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\n\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\n\n// namehash('addr.reverse')\n\ncontract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar {\n ENS public immutable ens;\n NameResolver public defaultResolver;\n\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\n event DefaultResolverChanged(NameResolver indexed resolver);\n\n /**\n * @dev Constructor\n * @param ensAddr The address of the ENS registry.\n */\n constructor(ENS ensAddr) {\n ens = ensAddr;\n\n // Assign ownership of the reverse record to our deployer\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\n ensAddr.owner(ADDR_REVERSE_NODE)\n );\n if (address(oldRegistrar) != address(0x0)) {\n oldRegistrar.claim(msg.sender);\n }\n }\n\n modifier authorised(address addr) {\n require(\n addr == msg.sender ||\n controllers[msg.sender] ||\n ens.isApprovedForAll(addr, msg.sender) ||\n ownsContract(addr),\n \"ReverseRegistrar: Caller is not a controller or authorised by address or the address itself\"\n );\n _;\n }\n\n function setDefaultResolver(address resolver) public override onlyOwner {\n require(\n address(resolver) != address(0),\n \"ReverseRegistrar: Resolver address must not be 0\"\n );\n defaultResolver = NameResolver(resolver);\n emit DefaultResolverChanged(NameResolver(resolver));\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @return The ENS node hash of the reverse record.\n */\n function claim(address owner) public override returns (bytes32) {\n return claimForAddr(msg.sender, owner, address(defaultResolver));\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param addr The reverse record to set\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @param resolver The resolver of the reverse node\n * @return The ENS node hash of the reverse record.\n */\n function claimForAddr(\n address addr,\n address owner,\n address resolver\n ) public override authorised(addr) returns (bytes32) {\n bytes32 labelHash = sha3HexAddress(addr);\n bytes32 reverseNode = keccak256(\n abi.encodePacked(ADDR_REVERSE_NODE, labelHash)\n );\n emit ReverseClaimed(addr, reverseNode);\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0);\n return reverseNode;\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\n * @return The ENS node hash of the reverse record.\n */\n function claimWithResolver(\n address owner,\n address resolver\n ) public override returns (bytes32) {\n return claimForAddr(msg.sender, owner, resolver);\n }\n\n /**\n * @dev Sets the `name()` record for the reverse ENS record associated with\n * the calling account. First updates the resolver to the default reverse\n * resolver if necessary.\n * @param name The name to set for this address.\n * @return The ENS node hash of the reverse record.\n */\n function setName(string memory name) public override returns (bytes32) {\n return\n setNameForAddr(\n msg.sender,\n msg.sender,\n address(defaultResolver),\n name\n );\n }\n\n /**\n * @dev Sets the `name()` record for the reverse ENS record associated with\n * the account provided. Updates the resolver to a designated resolver\n * Only callable by controllers and authorised users\n * @param addr The reverse record to set\n * @param owner The owner of the reverse node\n * @param resolver The resolver of the reverse node\n * @param name The name to set for this address.\n * @return The ENS node hash of the reverse record.\n */\n function setNameForAddr(\n address addr,\n address owner,\n address resolver,\n string memory name\n ) public override returns (bytes32) {\n bytes32 node = claimForAddr(addr, owner, resolver);\n NameResolver(resolver).setName(node, name);\n return node;\n }\n\n /**\n * @dev Returns the node hash for a given account's reverse records.\n * @param addr The address to hash\n * @return The ENS node hash.\n */\n function node(address addr) public pure override returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\n );\n }\n\n /**\n * @dev An optimised function to compute the sha3 of the lower-case\n * hexadecimal representation of an Ethereum address.\n * @param addr The address to hash\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\n * input address.\n */\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\n assembly {\n for {\n let i := 40\n } gt(i, 0) {\n\n } {\n i := sub(i, 1)\n mstore8(i, byte(and(addr, 0xf), lookup))\n addr := div(addr, 0x10)\n i := sub(i, 1)\n mstore8(i, byte(and(addr, 0xf), lookup))\n addr := div(addr, 0x10)\n }\n\n ret := keccak256(0, 40)\n }\n }\n\n function ownsContract(address addr) internal view returns (bool) {\n try Ownable(addr).owner() returns (address owner) {\n return owner == msg.sender;\n } catch {\n return false;\n }\n }\n}\n" + }, + "contracts/root/Controllable.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract Controllable is Ownable {\n mapping(address => bool) public controllers;\n\n event ControllerChanged(address indexed controller, bool enabled);\n\n modifier onlyController() {\n require(\n controllers[msg.sender],\n \"Controllable: Caller is not a controller\"\n );\n _;\n }\n\n function setController(address controller, bool enabled) public onlyOwner {\n controllers[controller] = enabled;\n emit ControllerChanged(controller, enabled);\n }\n}\n" + }, + "contracts/root/Ownable.sol": { + "content": "pragma solidity ^0.8.4;\n\ncontract Ownable {\n address public owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n modifier onlyOwner() {\n require(isOwner(msg.sender));\n _;\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n emit OwnershipTransferred(owner, newOwner);\n owner = newOwner;\n }\n\n function isOwner(address addr) public view returns (bool) {\n return owner == addr;\n }\n}\n" + }, + "contracts/root/Root.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./Controllable.sol\";\n\ncontract Root is Ownable, Controllable {\n bytes32 private constant ROOT_NODE = bytes32(0);\n\n bytes4 private constant INTERFACE_META_ID =\n bytes4(keccak256(\"supportsInterface(bytes4)\"));\n\n event TLDLocked(bytes32 indexed label);\n\n ENS public ens;\n mapping(bytes32 => bool) public locked;\n\n constructor(ENS _ens) public {\n ens = _ens;\n }\n\n function setSubnodeOwner(\n bytes32 label,\n address owner\n ) external onlyController {\n require(!locked[label]);\n ens.setSubnodeOwner(ROOT_NODE, label, owner);\n }\n\n function setResolver(address resolver) external onlyOwner {\n ens.setResolver(ROOT_NODE, resolver);\n }\n\n function lock(bytes32 label) external onlyOwner {\n emit TLDLocked(label);\n locked[label] = true;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return interfaceID == INTERFACE_META_ID;\n }\n}\n" + }, + "contracts/utils/ERC20Recoverable.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.\n */\n\ncontract ERC20Recoverable is Ownable {\n /**\n @notice Recover ERC20 tokens sent to the contract by mistake.\n @dev The contract is Ownable and only the owner can call the recover function.\n @param _to The address to send the tokens to.\n@param _token The address of the ERC20 token to recover\n @param _amount The amount of tokens to recover.\n */\n function recoverFunds(\n address _token,\n address _to,\n uint256 _amount\n ) external onlyOwner {\n IERC20(_token).transfer(_to, _amount);\n }\n}\n" + }, + "contracts/utils/HexUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nlibrary HexUtils {\n /**\n * @dev Attempts to parse bytes32 from a hex string\n * @param str The string to parse\n * @param idx The offset to start parsing at\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\n */\n function hexStringToBytes32(\n bytes memory str,\n uint256 idx,\n uint256 lastIdx\n ) internal pure returns (bytes32 r, bool valid) {\n valid = true;\n assembly {\n // check that the index to read to is not past the end of the string\n if gt(lastIdx, mload(str)) {\n revert(0, 0)\n }\n\n function getHex(c) -> ascii {\n // chars 48-57: 0-9\n if and(gt(c, 47), lt(c, 58)) {\n ascii := sub(c, 48)\n leave\n }\n // chars 65-70: A-F\n if and(gt(c, 64), lt(c, 71)) {\n ascii := add(sub(c, 65), 10)\n leave\n }\n // chars 97-102: a-f\n if and(gt(c, 96), lt(c, 103)) {\n ascii := add(sub(c, 97), 10)\n leave\n }\n // invalid char\n ascii := 0xff\n }\n\n let ptr := add(str, 32)\n for {\n let i := idx\n } lt(i, lastIdx) {\n i := add(i, 2)\n } {\n let byte1 := getHex(byte(0, mload(add(ptr, i))))\n let byte2 := getHex(byte(0, mload(add(ptr, add(i, 1)))))\n // if either byte is invalid, set invalid and break loop\n if or(eq(byte1, 0xff), eq(byte2, 0xff)) {\n valid := false\n break\n }\n let combined := or(shl(4, byte1), byte2)\n r := or(shl(8, r), combined)\n }\n }\n }\n\n /**\n * @dev Attempts to parse an address from a hex string\n * @param str The string to parse\n * @param idx The offset to start parsing at\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\n */\n function hexToAddress(\n bytes memory str,\n uint256 idx,\n uint256 lastIdx\n ) internal pure returns (address, bool) {\n if (lastIdx - idx < 40) return (address(0x0), false);\n (bytes32 r, bool valid) = hexStringToBytes32(str, idx, lastIdx);\n return (address(uint160(uint256(r))), valid);\n }\n}\n" + }, + "contracts/utils/LowLevelCallUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.13;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\n\nlibrary LowLevelCallUtils {\n using Address for address;\n\n /**\n * @dev Makes a static call to the specified `target` with `data`. Return data can be fetched with\n * `returnDataSize` and `readReturnData`.\n * @param target The address to staticcall.\n * @param data The data to pass to the call.\n * @return success True if the call succeeded, or false if it reverts.\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bool success) {\n require(\n target.isContract(),\n \"LowLevelCallUtils: static call to non-contract\"\n );\n assembly {\n success := staticcall(\n gas(),\n target,\n add(data, 32),\n mload(data),\n 0,\n 0\n )\n }\n }\n\n /**\n * @dev Returns the size of the return data of the most recent external call.\n */\n function returnDataSize() internal pure returns (uint256 len) {\n assembly {\n len := returndatasize()\n }\n }\n\n /**\n * @dev Reads return data from the most recent external call.\n * @param offset Offset into the return data.\n * @param length Number of bytes to return.\n */\n function readReturnData(\n uint256 offset,\n uint256 length\n ) internal pure returns (bytes memory data) {\n data = new bytes(length);\n assembly {\n returndatacopy(add(data, 32), offset, length)\n }\n }\n\n /**\n * @dev Reverts with the return data from the most recent external call.\n */\n function propagateRevert() internal pure {\n assembly {\n returndatacopy(0, 0, returndatasize())\n revert(0, returndatasize())\n }\n }\n}\n" + }, + "contracts/utils/NameEncoder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {BytesUtils} from \"../wrapper/BytesUtils.sol\";\n\nlibrary NameEncoder {\n using BytesUtils for bytes;\n\n function dnsEncodeName(\n string memory name\n ) internal pure returns (bytes memory dnsName, bytes32 node) {\n uint8 labelLength = 0;\n bytes memory bytesName = bytes(name);\n uint256 length = bytesName.length;\n dnsName = new bytes(length + 2);\n node = 0;\n if (length == 0) {\n dnsName[0] = 0;\n return (dnsName, node);\n }\n\n // use unchecked to save gas since we check for an underflow\n // and we check for the length before the loop\n unchecked {\n for (uint256 i = length - 1; i >= 0; i--) {\n if (bytesName[i] == \".\") {\n dnsName[i + 1] = bytes1(labelLength);\n node = keccak256(\n abi.encodePacked(\n node,\n bytesName.keccak(i + 1, labelLength)\n )\n );\n labelLength = 0;\n } else {\n labelLength += 1;\n dnsName[i + 1] = bytesName[i];\n }\n if (i == 0) {\n break;\n }\n }\n }\n\n node = keccak256(\n abi.encodePacked(node, bytesName.keccak(0, labelLength))\n );\n\n dnsName[0] = bytes1(labelLength);\n return (dnsName, node);\n }\n}\n" + }, + "contracts/utils/TestHexUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {HexUtils} from \"./HexUtils.sol\";\n\ncontract TestHexUtils {\n using HexUtils for *;\n\n function hexStringToBytes32(\n bytes calldata name,\n uint256 idx,\n uint256 lastInx\n ) public pure returns (bytes32, bool) {\n return name.hexStringToBytes32(idx, lastInx);\n }\n\n function hexToAddress(\n bytes calldata input,\n uint256 idx,\n uint256 lastInx\n ) public pure returns (address, bool) {\n return input.hexToAddress(idx, lastInx);\n }\n}\n" + }, + "contracts/utils/TestNameEncoder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {NameEncoder} from \"./NameEncoder.sol\";\n\ncontract TestNameEncoder {\n using NameEncoder for string;\n\n function encodeName(\n string memory name\n ) public pure returns (bytes memory, bytes32) {\n return name.dnsEncodeName();\n }\n}\n" + }, + "contracts/utils/UniversalResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ERC165} from \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {LowLevelCallUtils} from \"./LowLevelCallUtils.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IExtendedResolver} from \"../resolvers/profiles/IExtendedResolver.sol\";\nimport {Resolver, INameResolver, IAddrResolver} from \"../resolvers/Resolver.sol\";\nimport {NameEncoder} from \"./NameEncoder.sol\";\nimport {BytesUtils} from \"../wrapper/BytesUtils.sol\";\nimport {HexUtils} from \"./HexUtils.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\nstruct MulticallData {\n bytes name;\n bytes[] data;\n string[] gateways;\n bytes4 callbackFunction;\n bool isWildcard;\n address resolver;\n bytes metaData;\n bool[] failures;\n}\n\nstruct OffchainLookupCallData {\n address sender;\n string[] urls;\n bytes callData;\n}\n\nstruct OffchainLookupExtraData {\n bytes4 callbackFunction;\n bytes data;\n}\n\ninterface BatchGateway {\n function query(\n OffchainLookupCallData[] memory data\n ) external returns (bool[] memory failures, bytes[] memory responses);\n}\n\n/**\n * The Universal Resolver is a contract that handles the work of resolving a name entirely onchain,\n * making it possible to make a single smart contract call to resolve an ENS name.\n */\ncontract UniversalResolver is ERC165, Ownable {\n using Address for address;\n using NameEncoder for string;\n using BytesUtils for bytes;\n using HexUtils for bytes;\n\n string[] public batchGatewayURLs;\n ENS public immutable registry;\n\n constructor(address _registry, string[] memory _urls) {\n registry = ENS(_registry);\n batchGatewayURLs = _urls;\n }\n\n function setGatewayURLs(string[] memory _urls) public onlyOwner {\n batchGatewayURLs = _urls;\n }\n\n /**\n * @dev Performs ENS name resolution for the supplied name and resolution data.\n * @param name The name to resolve, in normalised and DNS-encoded form.\n * @param data The resolution data, as specified in ENSIP-10.\n * @return The result of resolving the name.\n */\n function resolve(\n bytes calldata name,\n bytes memory data\n ) external view returns (bytes memory, address) {\n return\n _resolveSingle(\n name,\n data,\n batchGatewayURLs,\n this.resolveSingleCallback.selector,\n \"\"\n );\n }\n\n function resolve(\n bytes calldata name,\n bytes[] memory data\n ) external view returns (bytes[] memory, address) {\n return resolve(name, data, batchGatewayURLs);\n }\n\n function resolve(\n bytes calldata name,\n bytes memory data,\n string[] memory gateways\n ) external view returns (bytes memory, address) {\n return\n _resolveSingle(\n name,\n data,\n gateways,\n this.resolveSingleCallback.selector,\n \"\"\n );\n }\n\n function resolve(\n bytes calldata name,\n bytes[] memory data,\n string[] memory gateways\n ) public view returns (bytes[] memory, address) {\n return\n _resolve(name, data, gateways, this.resolveCallback.selector, \"\");\n }\n\n function _resolveSingle(\n bytes calldata name,\n bytes memory data,\n string[] memory gateways,\n bytes4 callbackFunction,\n bytes memory metaData\n ) public view returns (bytes memory, address) {\n bytes[] memory dataArr = new bytes[](1);\n dataArr[0] = data;\n (bytes[] memory results, address resolver) = _resolve(\n name,\n dataArr,\n gateways,\n callbackFunction,\n metaData\n );\n return (results[0], resolver);\n }\n\n function _resolve(\n bytes calldata name,\n bytes[] memory data,\n string[] memory gateways,\n bytes4 callbackFunction,\n bytes memory metaData\n ) internal view returns (bytes[] memory results, address resolverAddress) {\n (Resolver resolver, , uint256 finalOffset) = findResolver(name);\n resolverAddress = address(resolver);\n if (resolverAddress == address(0)) {\n return (results, address(0));\n }\n\n bool isWildcard = finalOffset != 0;\n\n results = _multicall(\n MulticallData(\n name,\n data,\n gateways,\n callbackFunction,\n isWildcard,\n resolverAddress,\n metaData,\n new bool[](data.length)\n )\n );\n }\n\n function reverse(\n bytes calldata reverseName\n ) external view returns (string memory, address, address, address) {\n return reverse(reverseName, batchGatewayURLs);\n }\n\n /**\n * @dev Performs ENS name reverse resolution for the supplied reverse name.\n * @param reverseName The reverse name to resolve, in normalised and DNS-encoded form. e.g. b6E040C9ECAaE172a89bD561c5F73e1C48d28cd9.addr.reverse\n * @return The resolved name, the resolved address, the reverse resolver address, and the resolver address.\n */\n function reverse(\n bytes calldata reverseName,\n string[] memory gateways\n ) public view returns (string memory, address, address, address) {\n bytes memory encodedCall = abi.encodeCall(\n INameResolver.name,\n reverseName.namehash(0)\n );\n (\n bytes memory resolvedReverseData,\n address reverseResolverAddress\n ) = _resolveSingle(\n reverseName,\n encodedCall,\n gateways,\n this.reverseCallback.selector,\n \"\"\n );\n\n return\n getForwardDataFromReverse(\n resolvedReverseData,\n reverseResolverAddress,\n gateways\n );\n }\n\n function getForwardDataFromReverse(\n bytes memory resolvedReverseData,\n address reverseResolverAddress,\n string[] memory gateways\n ) internal view returns (string memory, address, address, address) {\n string memory resolvedName = abi.decode(resolvedReverseData, (string));\n\n (bytes memory encodedName, bytes32 namehash) = resolvedName\n .dnsEncodeName();\n\n bytes memory encodedCall = abi.encodeCall(IAddrResolver.addr, namehash);\n bytes memory metaData = abi.encode(\n resolvedName,\n reverseResolverAddress\n );\n (bytes memory resolvedData, address resolverAddress) = this\n ._resolveSingle(\n encodedName,\n encodedCall,\n gateways,\n this.reverseCallback.selector,\n metaData\n );\n\n address resolvedAddress = abi.decode(resolvedData, (address));\n\n return (\n resolvedName,\n resolvedAddress,\n reverseResolverAddress,\n resolverAddress\n );\n }\n\n function resolveSingleCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory, address) {\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\n response,\n extraData,\n this.resolveSingleCallback.selector\n );\n return (results[0], resolver);\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes[] memory, address) {\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\n response,\n extraData,\n this.resolveCallback.selector\n );\n return (results, resolver);\n }\n\n function reverseCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (string memory, address, address, address) {\n (\n bytes[] memory resolvedData,\n address resolverAddress,\n string[] memory gateways,\n bytes memory metaData\n ) = _resolveCallback(\n response,\n extraData,\n this.reverseCallback.selector\n );\n\n if (metaData.length > 0) {\n (string memory resolvedName, address reverseResolverAddress) = abi\n .decode(metaData, (string, address));\n address resolvedAddress = abi.decode(resolvedData[0], (address));\n return (\n resolvedName,\n resolvedAddress,\n reverseResolverAddress,\n resolverAddress\n );\n }\n\n return\n getForwardDataFromReverse(\n resolvedData[0],\n resolverAddress,\n gateways\n );\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == type(IExtendedResolver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function _resolveCallback(\n bytes calldata response,\n bytes calldata extraData,\n bytes4 callbackFunction\n )\n internal\n view\n returns (bytes[] memory, address, string[] memory, bytes memory)\n {\n MulticallData memory multicallData;\n multicallData.callbackFunction = callbackFunction;\n (bool[] memory failures, bytes[] memory responses) = abi.decode(\n response,\n (bool[], bytes[])\n );\n OffchainLookupExtraData[] memory extraDatas;\n (\n multicallData.isWildcard,\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData,\n extraDatas\n ) = abi.decode(\n extraData,\n (bool, address, string[], bytes, OffchainLookupExtraData[])\n );\n require(responses.length <= extraDatas.length);\n multicallData.data = new bytes[](extraDatas.length);\n multicallData.failures = new bool[](extraDatas.length);\n uint256 offchainCount = 0;\n for (uint256 i = 0; i < extraDatas.length; i++) {\n if (extraDatas[i].callbackFunction == bytes4(0)) {\n // This call did not require an offchain lookup; use the previous input data.\n multicallData.data[i] = extraDatas[i].data;\n } else {\n if (failures[offchainCount]) {\n multicallData.failures[i] = true;\n multicallData.data[i] = responses[offchainCount];\n } else {\n multicallData.data[i] = abi.encodeWithSelector(\n extraDatas[i].callbackFunction,\n responses[offchainCount],\n extraDatas[i].data\n );\n }\n offchainCount = offchainCount + 1;\n }\n }\n\n return (\n _multicall(multicallData),\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData\n );\n }\n\n /**\n * @dev Makes a call to `target` with `data`. If the call reverts with an `OffchainLookup` error, wraps\n * the error with the data necessary to continue the request where it left off.\n * @param target The address to call.\n * @param data The data to call `target` with.\n * @return offchain Whether the call reverted with an `OffchainLookup` error.\n * @return returnData If `target` did not revert, contains the return data from the call to `target`. Otherwise, contains a `OffchainLookupCallData` struct.\n * @return extraData If `target` did not revert, is empty. Otherwise, contains a `OffchainLookupExtraData` struct.\n * @return result Whether the call succeeded.\n */\n function callWithOffchainLookupPropagation(\n address target,\n bytes memory data\n )\n internal\n view\n returns (\n bool offchain,\n bytes memory returnData,\n OffchainLookupExtraData memory extraData,\n bool result\n )\n {\n result = LowLevelCallUtils.functionStaticCall(address(target), data);\n uint256 size = LowLevelCallUtils.returnDataSize();\n\n if (result) {\n return (\n false,\n LowLevelCallUtils.readReturnData(0, size),\n extraData,\n true\n );\n }\n\n // Failure\n if (size >= 4) {\n bytes memory errorId = LowLevelCallUtils.readReturnData(0, 4);\n // Offchain lookup. Decode the revert message and create our own that nests it.\n bytes memory revertData = LowLevelCallUtils.readReturnData(\n 4,\n size - 4\n );\n if (bytes4(errorId) == OffchainLookup.selector) {\n (\n address wrappedSender,\n string[] memory wrappedUrls,\n bytes memory wrappedCallData,\n bytes4 wrappedCallbackFunction,\n bytes memory wrappedExtraData\n ) = abi.decode(\n revertData,\n (address, string[], bytes, bytes4, bytes)\n );\n if (wrappedSender == target) {\n returnData = abi.encode(\n OffchainLookupCallData(\n wrappedSender,\n wrappedUrls,\n wrappedCallData\n )\n );\n extraData = OffchainLookupExtraData(\n wrappedCallbackFunction,\n wrappedExtraData\n );\n return (true, returnData, extraData, false);\n }\n } else {\n returnData = revertData;\n return (false, returnData, extraData, false);\n }\n }\n }\n\n /**\n * @dev Finds a resolver by recursively querying the registry, starting at the longest name and progressively\n * removing labels until it finds a result.\n * @param name The name to resolve, in DNS-encoded and normalised form.\n * @return resolver The Resolver responsible for this name.\n * @return namehash The namehash of the full name.\n * @return finalOffset The offset of the first label with a resolver.\n */\n function findResolver(\n bytes calldata name\n ) public view returns (Resolver, bytes32, uint256) {\n (\n address resolver,\n bytes32 namehash,\n uint256 finalOffset\n ) = findResolver(name, 0);\n return (Resolver(resolver), namehash, finalOffset);\n }\n\n function findResolver(\n bytes calldata name,\n uint256 offset\n ) internal view returns (address, bytes32, uint256) {\n uint256 labelLength = uint256(uint8(name[offset]));\n if (labelLength == 0) {\n return (address(0), bytes32(0), offset);\n }\n uint256 nextLabel = offset + labelLength + 1;\n bytes32 labelHash;\n if (\n labelLength == 66 &&\n // 0x5b == '['\n name[offset + 1] == 0x5b &&\n // 0x5d == ']'\n name[nextLabel - 1] == 0x5d\n ) {\n // Encrypted label\n (labelHash, ) = bytes(name[offset + 2:nextLabel - 1])\n .hexStringToBytes32(0, 64);\n } else {\n labelHash = keccak256(name[offset + 1:nextLabel]);\n }\n (\n address parentresolver,\n bytes32 parentnode,\n uint256 parentoffset\n ) = findResolver(name, nextLabel);\n bytes32 node = keccak256(abi.encodePacked(parentnode, labelHash));\n address resolver = registry.resolver(node);\n if (resolver != address(0)) {\n return (resolver, node, offset);\n }\n return (parentresolver, node, parentoffset);\n }\n\n function _hasExtendedResolver(\n address resolver\n ) internal view returns (bool) {\n try\n Resolver(resolver).supportsInterface{gas: 50000}(\n type(IExtendedResolver).interfaceId\n )\n returns (bool supported) {\n return supported;\n } catch {\n return false;\n }\n }\n\n function _multicall(\n MulticallData memory multicallData\n ) internal view returns (bytes[] memory results) {\n uint256 length = multicallData.data.length;\n uint256 offchainCount = 0;\n OffchainLookupCallData[]\n memory callDatas = new OffchainLookupCallData[](length);\n OffchainLookupExtraData[]\n memory extraDatas = new OffchainLookupExtraData[](length);\n results = new bytes[](length);\n bool isCallback = multicallData.name.length == 0;\n bool hasExtendedResolver = _hasExtendedResolver(multicallData.resolver);\n\n require(\n !multicallData.isWildcard || hasExtendedResolver,\n \"UniversalResolver: Wildcard on non-extended resolvers is not supported\"\n );\n\n for (uint256 i = 0; i < length; i++) {\n bytes memory item = multicallData.data[i];\n bool failure = multicallData.failures[i];\n if (failure) {\n results[i] = item;\n continue;\n }\n if (!isCallback && hasExtendedResolver) {\n item = abi.encodeCall(\n IExtendedResolver.resolve,\n (multicallData.name, item)\n );\n }\n (\n bool offchain,\n bytes memory returnData,\n OffchainLookupExtraData memory extraData,\n bool success\n ) = callWithOffchainLookupPropagation(multicallData.resolver, item);\n\n if (offchain) {\n callDatas[offchainCount] = abi.decode(\n returnData,\n (OffchainLookupCallData)\n );\n extraDatas[i] = extraData;\n offchainCount += 1;\n continue;\n }\n\n if (success && hasExtendedResolver) {\n // if this is a successful resolve() call, unwrap the result\n returnData = abi.decode(returnData, (bytes));\n }\n results[i] = returnData;\n extraDatas[i].data = multicallData.data[i];\n }\n\n if (offchainCount == 0) {\n return results;\n }\n\n // Trim callDatas if offchain data exists\n assembly {\n mstore(callDatas, offchainCount)\n }\n\n revert OffchainLookup(\n address(this),\n multicallData.gateways,\n abi.encodeWithSelector(BatchGateway.query.selector, callDatas),\n multicallData.callbackFunction,\n abi.encode(\n multicallData.isWildcard,\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData,\n extraDatas\n )\n );\n }\n}\n" + }, + "contracts/wrapper/BytesUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nlibrary BytesUtils {\n /*\n * @dev Returns the keccak-256 hash of a byte range.\n * @param self The byte string to hash.\n * @param offset The position to start hashing at.\n * @param len The number of bytes to hash.\n * @return The hash of the byte range.\n */\n function keccak(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(offset + len <= self.length);\n assembly {\n ret := keccak256(add(add(self, 32), offset), len)\n }\n }\n\n /**\n * @dev Returns the ENS namehash of a DNS-encoded name.\n * @param self The DNS-encoded name to hash.\n * @param offset The offset at which to start hashing.\n * @return The namehash of the name.\n */\n function namehash(\n bytes memory self,\n uint256 offset\n ) internal pure returns (bytes32) {\n (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);\n if (labelhash == bytes32(0)) {\n require(offset == self.length - 1, \"namehash: Junk at end of name\");\n return bytes32(0);\n }\n return\n keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));\n }\n\n /**\n * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.\n * @param self The byte string to read a label from.\n * @param idx The index to read a label at.\n * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.\n * @return newIdx The index of the start of the next label.\n */\n function readLabel(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes32 labelhash, uint256 newIdx) {\n require(idx < self.length, \"readLabel: Index out of bounds\");\n uint256 len = uint256(uint8(self[idx]));\n if (len > 0) {\n labelhash = keccak(self, idx + 1, len);\n } else {\n labelhash = bytes32(0);\n }\n newIdx = idx + len + 1;\n }\n}\n" + }, + "contracts/wrapper/Controllable.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract Controllable is Ownable {\n mapping(address => bool) public controllers;\n\n event ControllerChanged(address indexed controller, bool active);\n\n function setController(address controller, bool active) public onlyOwner {\n controllers[controller] = active;\n emit ControllerChanged(controller, active);\n }\n\n modifier onlyController() {\n require(\n controllers[msg.sender],\n \"Controllable: Caller is not a controller\"\n );\n _;\n }\n}\n" + }, + "contracts/wrapper/ERC1155Fuse.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\n/* This contract is a variation on ERC1155 with the additions of _setData, getData and _beforeTransfer and ownerOf. _setData and getData allows the use of the other 96 bits next to the address of the owner for extra data. We use this to store 'fuses' that control permissions that can be burnt. 32 bits are used for the fuses themselves and 64 bits are used for the expiry of the name. When a name has expired, its fuses will be be set back to 0 */\n\nabstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(\n address indexed owner,\n address indexed approved,\n uint256 indexed tokenId\n );\n mapping(uint256 => uint256) public _tokens;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n // Mapping from token ID to approved address\n mapping(uint256 => address) internal _tokenApprovals;\n\n /**************************************************************************\n * ERC721 methods\n *************************************************************************/\n\n function ownerOf(uint256 id) public view virtual returns (address) {\n (address owner, , ) = getData(id);\n return owner;\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n address owner = ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(\n uint256 tokenId\n ) public view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override returns (uint256) {\n require(\n account != address(0),\n \"ERC1155: balance query for the zero address\"\n );\n address owner = ownerOf(id);\n if (owner == account) {\n return 1;\n }\n return 0;\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] memory accounts,\n uint256[] memory ids\n ) public view virtual override returns (uint256[] memory) {\n require(\n accounts.length == ids.length,\n \"ERC1155: accounts and ids length mismatch\"\n );\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n require(\n msg.sender != operator,\n \"ERC1155: setting approval status for self\"\n );\n\n _operatorApprovals[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev Returns the Name's owner address and fuses\n */\n function getData(\n uint256 tokenId\n ) public view virtual returns (address owner, uint32 fuses, uint64 expiry) {\n uint256 t = _tokens[tokenId];\n owner = address(uint160(t));\n expiry = uint64(t >> 192);\n fuses = uint32(t >> 160);\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == msg.sender || isApprovedForAll(from, msg.sender),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _transfer(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n ids.length == amounts.length,\n \"ERC1155: ids and amounts length mismatch\"\n );\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == msg.sender || isApprovedForAll(from, msg.sender),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\n\n _beforeTransfer(id, fuses, expiry);\n\n require(\n amount == 1 && oldOwner == from,\n \"ERC1155: insufficient balance for transfer\"\n );\n _setData(id, to, fuses, expiry);\n }\n\n emit TransferBatch(msg.sender, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(\n msg.sender,\n from,\n to,\n ids,\n amounts,\n data\n );\n }\n\n /**************************************************************************\n * Internal/private methods\n *************************************************************************/\n\n /**\n * @dev Sets the Name's owner address and fuses\n */\n function _setData(\n uint256 tokenId,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual {\n _tokens[tokenId] =\n uint256(uint160(owner)) |\n (uint256(fuses) << 160) |\n (uint256(expiry) << 192);\n }\n\n function _beforeTransfer(\n uint256 id,\n uint32 fuses,\n uint64 expiry\n ) internal virtual;\n\n function _clearOwnerAndFuses(\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual returns (address, uint32);\n\n function _mint(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual {\n uint256 tokenId = uint256(node);\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n\n uint32 parentControlledFuses = (uint32(type(uint16).max) << 16) &\n oldFuses;\n\n if (oldExpiry > expiry) {\n expiry = oldExpiry;\n }\n\n if (oldExpiry >= block.timestamp) {\n fuses = fuses | parentControlledFuses;\n }\n\n require(oldOwner == address(0), \"ERC1155: mint of existing token\");\n require(owner != address(0), \"ERC1155: mint to the zero address\");\n require(\n owner != address(this),\n \"ERC1155: newOwner cannot be the NameWrapper contract\"\n );\n\n _setData(tokenId, owner, fuses, expiry);\n emit TransferSingle(msg.sender, address(0x0), owner, tokenId, 1);\n _doSafeTransferAcceptanceCheck(\n msg.sender,\n address(0),\n owner,\n tokenId,\n 1,\n \"\"\n );\n }\n\n function _burn(uint256 tokenId) internal virtual {\n (address oldOwner, uint32 fuses, uint64 expiry) = ERC1155Fuse.getData(\n tokenId\n );\n (, fuses) = _clearOwnerAndFuses(oldOwner, fuses, expiry);\n // Clear approvals\n delete _tokenApprovals[tokenId];\n // Fuses and expiry are kept on burn\n _setData(tokenId, address(0x0), fuses, expiry);\n emit TransferSingle(msg.sender, oldOwner, address(0x0), tokenId, 1);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal {\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\n\n _beforeTransfer(id, fuses, expiry);\n\n require(\n amount == 1 && oldOwner == from,\n \"ERC1155: insufficient balance for transfer\"\n );\n\n if (oldOwner == to) {\n return;\n }\n\n _setData(id, to, fuses, expiry);\n\n emit TransferSingle(msg.sender, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);\n }\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155Received(\n operator,\n from,\n id,\n amount,\n data\n )\n returns (bytes4 response) {\n if (\n response != IERC1155Receiver(to).onERC1155Received.selector\n ) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155BatchReceived(\n operator,\n from,\n ids,\n amounts,\n data\n )\n returns (bytes4 response) {\n if (\n response !=\n IERC1155Receiver(to).onERC1155BatchReceived.selector\n ) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n /* ERC721 internal functions */\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ownerOf(tokenId), to, tokenId);\n }\n}\n" + }, + "contracts/wrapper/IMetadataService.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface IMetadataService {\n function uri(uint256) external view returns (string memory);\n}\n" + }, + "contracts/wrapper/INameWrapper.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../registry/ENS.sol\";\nimport \"../ethregistrar/IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport \"./IMetadataService.sol\";\nimport \"./INameWrapperUpgrade.sol\";\n\nuint32 constant CANNOT_UNWRAP = 1;\nuint32 constant CANNOT_BURN_FUSES = 2;\nuint32 constant CANNOT_TRANSFER = 4;\nuint32 constant CANNOT_SET_RESOLVER = 8;\nuint32 constant CANNOT_SET_TTL = 16;\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\nuint32 constant CANNOT_APPROVE = 64;\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\nuint32 constant IS_DOT_ETH = 1 << 17;\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\nuint32 constant CAN_DO_EVERYTHING = 0;\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\n// all fuses apart from IS_DOT_ETH\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\n\ninterface INameWrapper is IERC1155 {\n event NameWrapped(\n bytes32 indexed node,\n bytes name,\n address owner,\n uint32 fuses,\n uint64 expiry\n );\n\n event NameUnwrapped(bytes32 indexed node, address owner);\n\n event FusesSet(bytes32 indexed node, uint32 fuses);\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\n\n function ens() external view returns (ENS);\n\n function registrar() external view returns (IBaseRegistrar);\n\n function metadataService() external view returns (IMetadataService);\n\n function names(bytes32) external view returns (bytes memory);\n\n function name() external view returns (string memory);\n\n function upgradeContract() external view returns (INameWrapperUpgrade);\n\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\n\n function wrap(\n bytes calldata name,\n address wrappedOwner,\n address resolver\n ) external;\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint16 ownerControlledFuses,\n address resolver\n ) external returns (uint64 expires);\n\n function registerAndWrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint256 duration,\n address resolver,\n uint16 ownerControlledFuses\n ) external returns (uint256 registrarExpiry);\n\n function renew(\n uint256 labelHash,\n uint256 duration\n ) external returns (uint256 expires);\n\n function unwrap(bytes32 node, bytes32 label, address owner) external;\n\n function unwrapETH2LD(\n bytes32 label,\n address newRegistrant,\n address newController\n ) external;\n\n function upgrade(bytes calldata name, bytes calldata extraData) external;\n\n function setFuses(\n bytes32 node,\n uint16 ownerControlledFuses\n ) external returns (uint32 newFuses);\n\n function setChildFuses(\n bytes32 parentNode,\n bytes32 labelhash,\n uint32 fuses,\n uint64 expiry\n ) external;\n\n function setSubnodeRecord(\n bytes32 node,\n string calldata label,\n address owner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) external returns (bytes32);\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeOwner(\n bytes32 node,\n string calldata label,\n address newOwner,\n uint32 fuses,\n uint64 expiry\n ) external returns (bytes32);\n\n function extendExpiry(\n bytes32 node,\n bytes32 labelhash,\n uint64 expiry\n ) external returns (uint64);\n\n function canModifyName(\n bytes32 node,\n address addr\n ) external view returns (bool);\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function ownerOf(uint256 id) external view returns (address owner);\n\n function approve(address to, uint256 tokenId) external;\n\n function getApproved(uint256 tokenId) external view returns (address);\n\n function getData(\n uint256 id\n ) external view returns (address, uint32, uint64);\n\n function setMetadataService(IMetadataService _metadataService) external;\n\n function uri(uint256 tokenId) external view returns (string memory);\n\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\n\n function allFusesBurned(\n bytes32 node,\n uint32 fuseMask\n ) external view returns (bool);\n\n function isWrapped(bytes32) external view returns (bool);\n\n function isWrapped(bytes32, bytes32) external view returns (bool);\n}\n" + }, + "contracts/wrapper/INameWrapperUpgrade.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface INameWrapperUpgrade {\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) external;\n}\n" + }, + "contracts/wrapper/mocks/ERC1155ReceiverMock.sol": { + "content": "// Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/test/token/ERC1155/ERC1155.behaviour.js\n// Copyright (c) 2016-2020 zOS Global Limited\n\n// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract ERC1155ReceiverMock is IERC1155Receiver, ERC165 {\n bytes4 private _recRetval;\n bool private _recReverts;\n bytes4 private _batRetval;\n bool private _batReverts;\n\n event Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes data\n );\n event BatchReceived(\n address operator,\n address from,\n uint256[] ids,\n uint256[] values,\n bytes data\n );\n\n constructor(\n bytes4 recRetval,\n bool recReverts,\n bytes4 batRetval,\n bool batReverts\n ) {\n _recRetval = recRetval;\n _recReverts = recReverts;\n _batRetval = batRetval;\n _batReverts = batReverts;\n }\n\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external override returns (bytes4) {\n require(!_recReverts, \"ERC1155ReceiverMock: reverting on receive\");\n emit Received(operator, from, id, value, data);\n return _recRetval;\n }\n\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external override returns (bytes4) {\n require(\n !_batReverts,\n \"ERC1155ReceiverMock: reverting on batch receive\"\n );\n emit BatchReceived(operator, from, ids, values, data);\n return _batRetval;\n }\n}\n" + }, + "contracts/wrapper/mocks/TestUnwrap.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\nimport \"../../registry/ENS.sol\";\nimport \"../../ethregistrar/IBaseRegistrar.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract TestUnwrap is Ownable {\n using BytesUtils for bytes;\n\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n mapping(address => bool) public approvedWrapper;\n\n constructor(ENS _ens, IBaseRegistrar _registrar) {\n ens = _ens;\n registrar = _registrar;\n }\n\n function setWrapperApproval(\n address wrapper,\n bool approved\n ) public onlyOwner {\n approvedWrapper[wrapper] = approved;\n }\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) public {\n _unwrapETH2LD(keccak256(bytes(label)), wrappedOwner, msg.sender);\n }\n\n function setSubnodeRecord(\n bytes32 parentNode,\n string memory label,\n address newOwner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) public {\n bytes32 node = _makeNode(parentNode, keccak256(bytes(label)));\n _unwrapSubnode(node, newOwner, msg.sender);\n }\n\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (parentNode == ETH_NODE) {\n _unwrapETH2LD(labelhash, wrappedOwner, msg.sender);\n } else {\n _unwrapSubnode(node, wrappedOwner, msg.sender);\n }\n }\n\n function _unwrapETH2LD(\n bytes32 labelhash,\n address wrappedOwner,\n address sender\n ) private {\n uint256 tokenId = uint256(labelhash);\n address registrant = registrar.ownerOf(tokenId);\n\n require(\n approvedWrapper[sender] &&\n sender == registrant &&\n registrar.isApprovedForAll(registrant, address(this)),\n \"Unauthorised\"\n );\n\n registrar.reclaim(tokenId, wrappedOwner);\n registrar.transferFrom(registrant, wrappedOwner, tokenId);\n }\n\n function _unwrapSubnode(\n bytes32 node,\n address newOwner,\n address sender\n ) private {\n address owner = ens.owner(node);\n\n require(\n approvedWrapper[sender] &&\n owner == sender &&\n ens.isApprovedForAll(owner, address(this)),\n \"Unauthorised\"\n );\n\n ens.setOwner(node, newOwner);\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n}\n" + }, + "contracts/wrapper/mocks/UpgradedNameWrapperMock.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\nimport {INameWrapperUpgrade} from \"../INameWrapperUpgrade.sol\";\nimport \"../../registry/ENS.sol\";\nimport \"../../ethregistrar/IBaseRegistrar.sol\";\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract UpgradedNameWrapperMock is INameWrapperUpgrade {\n using BytesUtils for bytes;\n\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n\n constructor(ENS _ens, IBaseRegistrar _registrar) {\n ens = _ens;\n registrar = _registrar;\n }\n\n event NameUpgraded(\n bytes name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes extraData\n );\n\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (parentNode == ETH_NODE) {\n address registrant = registrar.ownerOf(uint256(labelhash));\n require(\n msg.sender == registrant &&\n registrar.isApprovedForAll(registrant, address(this)),\n \"No approval for registrar\"\n );\n } else {\n address owner = ens.owner(node);\n require(\n msg.sender == owner &&\n ens.isApprovedForAll(owner, address(this)),\n \"No approval for registry\"\n );\n }\n emit NameUpgraded(\n name,\n wrappedOwner,\n fuses,\n expiry,\n approved,\n extraData\n );\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n}\n" + }, + "contracts/wrapper/NameWrapper.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {ERC1155Fuse, IERC165, IERC1155MetadataURI} from \"./ERC1155Fuse.sol\";\nimport {Controllable} from \"./Controllable.sol\";\nimport {INameWrapper, CANNOT_UNWRAP, CANNOT_BURN_FUSES, CANNOT_TRANSFER, CANNOT_SET_RESOLVER, CANNOT_SET_TTL, CANNOT_CREATE_SUBDOMAIN, CANNOT_APPROVE, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING, IS_DOT_ETH, CAN_EXTEND_EXPIRY, PARENT_CONTROLLED_FUSES, USER_SETTABLE_FUSES} from \"./INameWrapper.sol\";\nimport {INameWrapperUpgrade} from \"./INameWrapperUpgrade.sol\";\nimport {IMetadataService} from \"./IMetadataService.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IReverseRegistrar} from \"../reverseRegistrar/IReverseRegistrar.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {IBaseRegistrar} from \"../ethregistrar/IBaseRegistrar.sol\";\nimport {IERC721Receiver} from \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {BytesUtils} from \"./BytesUtils.sol\";\nimport {ERC20Recoverable} from \"../utils/ERC20Recoverable.sol\";\n\nerror Unauthorised(bytes32 node, address addr);\nerror IncompatibleParent();\nerror IncorrectTokenType();\nerror LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);\nerror LabelTooShort();\nerror LabelTooLong(string label);\nerror IncorrectTargetOwner(address owner);\nerror CannotUpgrade();\nerror OperationProhibited(bytes32 node);\nerror NameIsNotWrapped();\nerror NameIsStillExpired();\n\ncontract NameWrapper is\n Ownable,\n ERC1155Fuse,\n INameWrapper,\n Controllable,\n IERC721Receiver,\n ERC20Recoverable,\n ReverseClaimer\n{\n using BytesUtils for bytes;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n IMetadataService public metadataService;\n mapping(bytes32 => bytes) public names;\n string public constant name = \"NameWrapper\";\n\n uint64 private constant GRACE_PERIOD = 90 days;\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n bytes32 private constant ETH_LABELHASH =\n 0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0;\n bytes32 private constant ROOT_NODE =\n 0x0000000000000000000000000000000000000000000000000000000000000000;\n\n INameWrapperUpgrade public upgradeContract;\n uint64 private constant MAX_EXPIRY = type(uint64).max;\n\n constructor(\n ENS _ens,\n IBaseRegistrar _registrar,\n IMetadataService _metadataService\n ) ReverseClaimer(_ens, msg.sender) {\n ens = _ens;\n registrar = _registrar;\n metadataService = _metadataService;\n\n /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE and ETH_NODE and set expiry to max */\n\n _setData(\n uint256(ETH_NODE),\n address(0),\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\n MAX_EXPIRY\n );\n _setData(\n uint256(ROOT_NODE),\n address(0),\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\n MAX_EXPIRY\n );\n names[ROOT_NODE] = \"\\x00\";\n names[ETH_NODE] = \"\\x03eth\\x00\";\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC1155Fuse, INameWrapper) returns (bool) {\n return\n interfaceId == type(INameWrapper).interfaceId ||\n interfaceId == type(IERC721Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /* ERC1155 Fuse */\n\n /**\n * @notice Gets the owner of a name\n * @param id Label as a string of the .eth domain to wrap\n * @return owner The owner of the name\n */\n\n function ownerOf(\n uint256 id\n ) public view override(ERC1155Fuse, INameWrapper) returns (address owner) {\n return super.ownerOf(id);\n }\n\n /**\n * @notice Gets the owner of a name\n * @param id Namehash of the name\n * @return operator Approved operator of a name\n */\n\n function getApproved(\n uint256 id\n )\n public\n view\n override(ERC1155Fuse, INameWrapper)\n returns (address operator)\n {\n address owner = ownerOf(id);\n if (owner == address(0)) {\n return address(0);\n }\n return super.getApproved(id);\n }\n\n /**\n * @notice Approves an address for a name\n * @param to address to approve\n * @param tokenId name to approve\n */\n\n function approve(\n address to,\n uint256 tokenId\n ) public override(ERC1155Fuse, INameWrapper) {\n (, uint32 fuses, ) = getData(tokenId);\n if (fuses & CANNOT_APPROVE == CANNOT_APPROVE) {\n revert OperationProhibited(bytes32(tokenId));\n }\n super.approve(to, tokenId);\n }\n\n /**\n * @notice Gets the data for a name\n * @param id Namehash of the name\n * @return owner Owner of the name\n * @return fuses Fuses of the name\n * @return expiry Expiry of the name\n */\n\n function getData(\n uint256 id\n )\n public\n view\n override(ERC1155Fuse, INameWrapper)\n returns (address owner, uint32 fuses, uint64 expiry)\n {\n (owner, fuses, expiry) = super.getData(id);\n\n (owner, fuses) = _clearOwnerAndFuses(owner, fuses, expiry);\n }\n\n /* Metadata service */\n\n /**\n * @notice Set the metadata service. Only the owner can do this\n * @param _metadataService The new metadata service\n */\n\n function setMetadataService(\n IMetadataService _metadataService\n ) public onlyOwner {\n metadataService = _metadataService;\n }\n\n /**\n * @notice Get the metadata uri\n * @param tokenId The id of the token\n * @return string uri of the metadata service\n */\n\n function uri(\n uint256 tokenId\n )\n public\n view\n override(INameWrapper, IERC1155MetadataURI)\n returns (string memory)\n {\n return metadataService.uri(tokenId);\n }\n\n /**\n * @notice Set the address of the upgradeContract of the contract. only admin can do this\n * @dev The default value of upgradeContract is the 0 address. Use the 0 address at any time\n * to make the contract not upgradable.\n * @param _upgradeAddress address of an upgraded contract\n */\n\n function setUpgradeContract(\n INameWrapperUpgrade _upgradeAddress\n ) public onlyOwner {\n if (address(upgradeContract) != address(0)) {\n registrar.setApprovalForAll(address(upgradeContract), false);\n ens.setApprovalForAll(address(upgradeContract), false);\n }\n\n upgradeContract = _upgradeAddress;\n\n if (address(upgradeContract) != address(0)) {\n registrar.setApprovalForAll(address(upgradeContract), true);\n ens.setApprovalForAll(address(upgradeContract), true);\n }\n }\n\n /**\n * @notice Checks if msg.sender is the owner or operator of the owner of a name\n * @param node namehash of the name to check\n */\n\n modifier onlyTokenOwner(bytes32 node) {\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n _;\n }\n\n /**\n * @notice Checks if owner or operator of the owner\n * @param node namehash of the name to check\n * @param addr which address to check permissions for\n * @return whether or not is owner or operator\n */\n\n function canModifyName(\n bytes32 node,\n address addr\n ) public view returns (bool) {\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\n return\n (owner == addr || isApprovedForAll(owner, addr)) &&\n !_isETH2LDInGracePeriod(fuses, expiry);\n }\n\n /**\n * @notice Checks if owner/operator or approved by owner\n * @param node namehash of the name to check\n * @param addr which address to check permissions for\n * @return whether or not is owner/operator or approved\n */\n\n function canExtendSubnames(\n bytes32 node,\n address addr\n ) public view returns (bool) {\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\n return\n (owner == addr ||\n isApprovedForAll(owner, addr) ||\n getApproved(uint256(node)) == addr) &&\n !_isETH2LDInGracePeriod(fuses, expiry);\n }\n\n /**\n * @notice Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract\n * @dev Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar\n * @param label Label as a string of the .eth domain to wrap\n * @param wrappedOwner Owner of the name in this contract\n * @param ownerControlledFuses Initial owner-controlled fuses to set\n * @param resolver Resolver contract address\n */\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint16 ownerControlledFuses,\n address resolver\n ) public returns (uint64 expiry) {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n address registrant = registrar.ownerOf(tokenId);\n if (\n registrant != msg.sender &&\n !registrar.isApprovedForAll(registrant, msg.sender)\n ) {\n revert Unauthorised(\n _makeNode(ETH_NODE, bytes32(tokenId)),\n msg.sender\n );\n }\n\n // transfer the token from the user to this contract\n registrar.transferFrom(registrant, address(this), tokenId);\n\n // transfer the ens record back to the new owner (this contract)\n registrar.reclaim(tokenId, address(this));\n\n expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\n\n _wrapETH2LD(\n label,\n wrappedOwner,\n ownerControlledFuses,\n expiry,\n resolver\n );\n }\n\n /**\n * @dev Registers a new .eth second-level domain and wraps it.\n * Only callable by authorised controllers.\n * @param label The label to register (Eg, 'foo' for 'foo.eth').\n * @param wrappedOwner The owner of the wrapped name.\n * @param duration The duration, in seconds, to register the name for.\n * @param resolver The resolver address to set on the ENS registry (optional).\n * @param ownerControlledFuses Initial owner-controlled fuses to set\n * @return registrarExpiry The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch.\n */\n\n function registerAndWrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint256 duration,\n address resolver,\n uint16 ownerControlledFuses\n ) external onlyController returns (uint256 registrarExpiry) {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n registrarExpiry = registrar.register(tokenId, address(this), duration);\n _wrapETH2LD(\n label,\n wrappedOwner,\n ownerControlledFuses,\n uint64(registrarExpiry) + GRACE_PERIOD,\n resolver\n );\n }\n\n /**\n * @notice Renews a .eth second-level domain.\n * @dev Only callable by authorised controllers.\n * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth').\n * @param duration The number of seconds to renew the name for.\n * @return expires The expiry date of the name on the .eth registrar, in seconds since the Unix epoch.\n */\n\n function renew(\n uint256 tokenId,\n uint256 duration\n ) external onlyController returns (uint256 expires) {\n bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));\n\n uint256 registrarExpiry = registrar.renew(tokenId, duration);\n\n // Do not set anything in wrapper if name is not wrapped\n try registrar.ownerOf(tokenId) returns (address registrarOwner) {\n if (\n registrarOwner != address(this) ||\n ens.owner(node) != address(this)\n ) {\n return registrarExpiry;\n }\n } catch {\n return registrarExpiry;\n }\n\n // Set expiry in Wrapper\n uint64 expiry = uint64(registrarExpiry) + GRACE_PERIOD;\n\n // Use super to allow names expired on the wrapper, but not expired on the registrar to renew()\n (address owner, uint32 fuses, ) = super.getData(uint256(node));\n _setData(node, owner, fuses, expiry);\n\n return registrarExpiry;\n }\n\n /**\n * @notice Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\n * @dev Can be called by the owner in the registry or an authorised caller in the registry\n * @param name The name to wrap, in DNS format\n * @param wrappedOwner Owner of the name in this contract\n * @param resolver Resolver contract\n */\n\n function wrap(\n bytes calldata name,\n address wrappedOwner,\n address resolver\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n names[node] = name;\n\n if (parentNode == ETH_NODE) {\n revert IncompatibleParent();\n }\n\n address owner = ens.owner(node);\n\n if (owner != msg.sender && !ens.isApprovedForAll(owner, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n if (resolver != address(0)) {\n ens.setResolver(node, resolver);\n }\n\n ens.setOwner(node, address(this));\n\n _wrap(node, name, wrappedOwner, 0, 0);\n }\n\n /**\n * @notice Unwraps a .eth domain. e.g. vitalik.eth\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\n * @param labelhash Labelhash of the .eth domain\n * @param registrant Sets the owner in the .eth registrar to this address\n * @param controller Sets the owner in the registry to this address\n */\n\n function unwrapETH2LD(\n bytes32 labelhash,\n address registrant,\n address controller\n ) public onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {\n if (registrant == address(this)) {\n revert IncorrectTargetOwner(registrant);\n }\n _unwrap(_makeNode(ETH_NODE, labelhash), controller);\n registrar.safeTransferFrom(\n address(this),\n registrant,\n uint256(labelhash)\n );\n }\n\n /**\n * @notice Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param controller Sets the owner in the registry to this address\n */\n\n function unwrap(\n bytes32 parentNode,\n bytes32 labelhash,\n address controller\n ) public onlyTokenOwner(_makeNode(parentNode, labelhash)) {\n if (parentNode == ETH_NODE) {\n revert IncompatibleParent();\n }\n if (controller == address(0x0) || controller == address(this)) {\n revert IncorrectTargetOwner(controller);\n }\n _unwrap(_makeNode(parentNode, labelhash), controller);\n }\n\n /**\n * @notice Sets fuses of a name\n * @param node Namehash of the name\n * @param ownerControlledFuses Owner-controlled fuses to burn\n * @return Old fuses\n */\n\n function setFuses(\n bytes32 node,\n uint16 ownerControlledFuses\n )\n public\n onlyTokenOwner(node)\n operationAllowed(node, CANNOT_BURN_FUSES)\n returns (uint32)\n {\n // owner protected by onlyTokenOwner\n (address owner, uint32 oldFuses, uint64 expiry) = getData(\n uint256(node)\n );\n _setFuses(node, owner, ownerControlledFuses | oldFuses, expiry, expiry);\n return oldFuses;\n }\n\n /**\n * @notice Extends expiry for a name\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return New expiry\n */\n\n function extendExpiry(\n bytes32 parentNode,\n bytes32 labelhash,\n uint64 expiry\n ) public returns (uint64) {\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (!_isWrapped(node)) {\n revert NameIsNotWrapped();\n }\n\n // this flag is used later, when checking fuses\n bool canExtendSubname = canExtendSubnames(parentNode, msg.sender);\n // only allow the owner of the name or owner of the parent name\n if (!canExtendSubname && !canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n (address owner, uint32 fuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n\n // Either CAN_EXTEND_EXPIRY must be set, or the caller must have permission to modify the parent name\n if (!canExtendSubname && fuses & CAN_EXTEND_EXPIRY == 0) {\n revert OperationProhibited(node);\n }\n\n // Max expiry is set to the expiry of the parent\n (, , uint64 maxExpiry) = getData(uint256(parentNode));\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n\n _setData(node, owner, fuses, expiry);\n emit ExpiryExtended(node, expiry);\n return expiry;\n }\n\n /**\n * @notice Upgrades a domain of any kind. Could be a .eth name vitalik.eth, a DNSSEC name vitalik.xyz, or a subdomain\n * @dev Can be called by the owner or an authorised caller\n * @param name The name to upgrade, in DNS format\n * @param extraData Extra data to pass to the upgrade contract\n */\n\n function upgrade(bytes calldata name, bytes calldata extraData) public {\n bytes32 node = name.namehash(0);\n\n if (address(upgradeContract) == address(0)) {\n revert CannotUpgrade();\n }\n\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n (address currentOwner, uint32 fuses, uint64 expiry) = getData(\n uint256(node)\n );\n\n address approved = getApproved(uint256(node));\n\n _burn(uint256(node));\n\n upgradeContract.wrapFromUpgrade(\n name,\n currentOwner,\n fuses,\n expiry,\n approved,\n extraData\n );\n }\n\n /** \n /* @notice Sets fuses of a name that you own the parent of\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param fuses Fuses to burn\n * @param expiry When the name will expire in seconds since the Unix epoch\n */\n\n function setChildFuses(\n bytes32 parentNode,\n bytes32 labelhash,\n uint32 fuses,\n uint64 expiry\n ) public {\n bytes32 node = _makeNode(parentNode, labelhash);\n _checkFusesAreSettable(node, fuses);\n (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n if (owner == address(0) || ens.owner(node) != address(this)) {\n revert NameIsNotWrapped();\n }\n // max expiry is set to the expiry of the parent\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\n if (parentNode == ROOT_NODE) {\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n } else {\n if (!canModifyName(parentNode, msg.sender)) {\n revert Unauthorised(parentNode, msg.sender);\n }\n }\n\n _checkParentFuses(node, fuses, parentFuses);\n\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n\n // if PARENT_CANNOT_CONTROL has been burned and fuses have changed\n if (\n oldFuses & PARENT_CANNOT_CONTROL != 0 &&\n oldFuses | fuses != oldFuses\n ) {\n revert OperationProhibited(node);\n }\n fuses |= oldFuses;\n _setFuses(node, owner, fuses, oldExpiry, expiry);\n }\n\n /**\n * @notice Sets the subdomain owner in the registry and then wraps the subdomain\n * @param parentNode Parent namehash of the subdomain\n * @param label Label of the subdomain as a string\n * @param owner New owner in the wrapper\n * @param fuses Initial fuses for the wrapped subdomain\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return node Namehash of the subdomain\n */\n\n function setSubnodeOwner(\n bytes32 parentNode,\n string calldata label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\n _checkCanCallSetSubnodeOwner(parentNode, node);\n _checkFusesAreSettable(node, fuses);\n bytes memory name = _saveLabel(parentNode, node, label);\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\n\n if (!_isWrapped(node)) {\n ens.setSubnodeOwner(parentNode, labelhash, address(this));\n _wrap(node, name, owner, fuses, expiry);\n } else {\n _updateName(parentNode, node, label, owner, fuses, expiry);\n }\n }\n\n /**\n * @notice Sets the subdomain owner in the registry with records and then wraps the subdomain\n * @param parentNode parent namehash of the subdomain\n * @param label label of the subdomain as a string\n * @param owner new owner in the wrapper\n * @param resolver resolver contract in the registry\n * @param ttl ttl in the registry\n * @param fuses initial fuses for the wrapped subdomain\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return node Namehash of the subdomain\n */\n\n function setSubnodeRecord(\n bytes32 parentNode,\n string memory label,\n address owner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\n _checkCanCallSetSubnodeOwner(parentNode, node);\n _checkFusesAreSettable(node, fuses);\n _saveLabel(parentNode, node, label);\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\n if (!_isWrapped(node)) {\n ens.setSubnodeRecord(\n parentNode,\n labelhash,\n address(this),\n resolver,\n ttl\n );\n _storeNameAndWrap(parentNode, node, label, owner, fuses, expiry);\n } else {\n ens.setSubnodeRecord(\n parentNode,\n labelhash,\n address(this),\n resolver,\n ttl\n );\n _updateName(parentNode, node, label, owner, fuses, expiry);\n }\n }\n\n /**\n * @notice Sets records for the name in the ENS Registry\n * @param node Namehash of the name to set a record for\n * @param owner New owner in the registry\n * @param resolver Resolver contract\n * @param ttl Time to live in the registry\n */\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n )\n public\n onlyTokenOwner(node)\n operationAllowed(\n node,\n CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL\n )\n {\n ens.setRecord(node, address(this), resolver, ttl);\n if (owner == address(0)) {\n (, uint32 fuses, ) = getData(uint256(node));\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\n revert IncorrectTargetOwner(owner);\n }\n _unwrap(node, address(0));\n } else {\n address oldOwner = ownerOf(uint256(node));\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\n }\n }\n\n /**\n * @notice Sets resolver contract in the registry\n * @param node namehash of the name\n * @param resolver the resolver contract\n */\n\n function setResolver(\n bytes32 node,\n address resolver\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_RESOLVER) {\n ens.setResolver(node, resolver);\n }\n\n /**\n * @notice Sets TTL in the registry\n * @param node Namehash of the name\n * @param ttl TTL in the registry\n */\n\n function setTTL(\n bytes32 node,\n uint64 ttl\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_TTL) {\n ens.setTTL(node, ttl);\n }\n\n /**\n * @dev Allows an operation only if none of the specified fuses are burned.\n * @param node The namehash of the name to check fuses on.\n * @param fuseMask A bitmask of fuses that must not be burned.\n */\n\n modifier operationAllowed(bytes32 node, uint32 fuseMask) {\n (, uint32 fuses, ) = getData(uint256(node));\n if (fuses & fuseMask != 0) {\n revert OperationProhibited(node);\n }\n _;\n }\n\n /**\n * @notice Check whether a name can call setSubnodeOwner/setSubnodeRecord\n * @dev Checks both CANNOT_CREATE_SUBDOMAIN and PARENT_CANNOT_CONTROL and whether not they have been burnt\n * and checks whether the owner of the subdomain is 0x0 for creating or already exists for\n * replacing a subdomain. If either conditions are true, then it is possible to call\n * setSubnodeOwner\n * @param parentNode Namehash of the parent name to check\n * @param subnode Namehash of the subname to check\n */\n\n function _checkCanCallSetSubnodeOwner(\n bytes32 parentNode,\n bytes32 subnode\n ) internal view {\n (\n address subnodeOwner,\n uint32 subnodeFuses,\n uint64 subnodeExpiry\n ) = getData(uint256(subnode));\n\n // check if the registry owner is 0 and expired\n // check if the wrapper owner is 0 and expired\n // If either, then check parent fuses for CANNOT_CREATE_SUBDOMAIN\n bool expired = subnodeExpiry < block.timestamp;\n if (\n expired &&\n // protects a name that has been unwrapped with PCC and doesn't allow the parent to take control by recreating it if unexpired\n (subnodeOwner == address(0) ||\n // protects a name that has been burnt and doesn't allow the parent to take control by recreating it if unexpired\n ens.owner(subnode) == address(0))\n ) {\n (, uint32 parentFuses, ) = getData(uint256(parentNode));\n if (parentFuses & CANNOT_CREATE_SUBDOMAIN != 0) {\n revert OperationProhibited(subnode);\n }\n } else {\n if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {\n revert OperationProhibited(subnode);\n }\n }\n }\n\n /**\n * @notice Checks all Fuses in the mask are burned for the node\n * @param node Namehash of the name\n * @param fuseMask The fuses you want to check\n * @return Boolean of whether or not all the selected fuses are burned\n */\n\n function allFusesBurned(\n bytes32 node,\n uint32 fuseMask\n ) public view returns (bool) {\n (, uint32 fuses, ) = getData(uint256(node));\n return fuses & fuseMask == fuseMask;\n }\n\n /**\n * @notice Checks if a name is wrapped\n * @param node Namehash of the name\n * @return Boolean of whether or not the name is wrapped\n */\n\n function isWrapped(bytes32 node) public view returns (bool) {\n bytes memory name = names[node];\n if (name.length == 0) {\n return false;\n }\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n return isWrapped(parentNode, labelhash);\n }\n\n /**\n * @notice Checks if a name is wrapped in a more gas efficient way\n * @param parentNode Namehash of the name\n * @param labelhash Namehash of the name\n * @return Boolean of whether or not the name is wrapped\n */\n\n function isWrapped(\n bytes32 parentNode,\n bytes32 labelhash\n ) public view returns (bool) {\n bytes32 node = _makeNode(parentNode, labelhash);\n bool wrapped = _isWrapped(node);\n if (parentNode != ETH_NODE) {\n return wrapped;\n }\n try registrar.ownerOf(uint256(labelhash)) returns (address owner) {\n return owner == address(this);\n } catch {\n return false;\n }\n }\n\n function onERC721Received(\n address to,\n address,\n uint256 tokenId,\n bytes calldata data\n ) public returns (bytes4) {\n //check if it's the eth registrar ERC721\n if (msg.sender != address(registrar)) {\n revert IncorrectTokenType();\n }\n\n (\n string memory label,\n address owner,\n uint16 ownerControlledFuses,\n address resolver\n ) = abi.decode(data, (string, address, uint16, address));\n\n bytes32 labelhash = bytes32(tokenId);\n bytes32 labelhashFromData = keccak256(bytes(label));\n\n if (labelhashFromData != labelhash) {\n revert LabelMismatch(labelhashFromData, labelhash);\n }\n\n // transfer the ens record back to the new owner (this contract)\n registrar.reclaim(uint256(labelhash), address(this));\n\n uint64 expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\n\n _wrapETH2LD(label, owner, ownerControlledFuses, expiry, resolver);\n\n return IERC721Receiver(to).onERC721Received.selector;\n }\n\n /***** Internal functions */\n\n function _beforeTransfer(\n uint256 id,\n uint32 fuses,\n uint64 expiry\n ) internal override {\n // For this check, treat .eth 2LDs as expiring at the start of the grace period.\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\n expiry -= GRACE_PERIOD;\n }\n\n if (expiry < block.timestamp) {\n // Transferable if the name was not emancipated\n if (fuses & PARENT_CANNOT_CONTROL != 0) {\n revert(\"ERC1155: insufficient balance for transfer\");\n }\n } else {\n // Transferable if CANNOT_TRANSFER is unburned\n if (fuses & CANNOT_TRANSFER != 0) {\n revert OperationProhibited(bytes32(id));\n }\n }\n\n // delete token approval if CANNOT_APPROVE has not been burnt\n if (fuses & CANNOT_APPROVE == 0) {\n delete _tokenApprovals[id];\n }\n }\n\n function _clearOwnerAndFuses(\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal view override returns (address, uint32) {\n if (expiry < block.timestamp) {\n if (fuses & PARENT_CANNOT_CONTROL == PARENT_CANNOT_CONTROL) {\n owner = address(0);\n }\n fuses = 0;\n }\n\n return (owner, fuses);\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n\n function _addLabel(\n string memory label,\n bytes memory name\n ) internal pure returns (bytes memory ret) {\n if (bytes(label).length < 1) {\n revert LabelTooShort();\n }\n if (bytes(label).length > 255) {\n revert LabelTooLong(label);\n }\n return abi.encodePacked(uint8(bytes(label).length), label, name);\n }\n\n function _mint(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal override {\n _canFusesBeBurned(node, fuses);\n (address oldOwner, , ) = super.getData(uint256(node));\n if (oldOwner != address(0)) {\n // burn and unwrap old token of old owner\n _burn(uint256(node));\n emit NameUnwrapped(node, address(0));\n }\n super._mint(node, owner, fuses, expiry);\n }\n\n function _wrap(\n bytes32 node,\n bytes memory name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n _mint(node, wrappedOwner, fuses, expiry);\n emit NameWrapped(node, name, wrappedOwner, fuses, expiry);\n }\n\n function _storeNameAndWrap(\n bytes32 parentNode,\n bytes32 node,\n string memory label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n bytes memory name = _addLabel(label, names[parentNode]);\n _wrap(node, name, owner, fuses, expiry);\n }\n\n function _saveLabel(\n bytes32 parentNode,\n bytes32 node,\n string memory label\n ) internal returns (bytes memory) {\n bytes memory name = _addLabel(label, names[parentNode]);\n names[node] = name;\n return name;\n }\n\n function _updateName(\n bytes32 parentNode,\n bytes32 node,\n string memory label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n bytes memory name = _addLabel(label, names[parentNode]);\n if (names[node].length == 0) {\n names[node] = name;\n }\n _setFuses(node, oldOwner, oldFuses | fuses, oldExpiry, expiry);\n if (owner == address(0)) {\n _unwrap(node, address(0));\n } else {\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\n }\n }\n\n // wrapper function for stack limit\n function _checkParentFusesAndExpiry(\n bytes32 parentNode,\n bytes32 node,\n uint32 fuses,\n uint64 expiry\n ) internal view returns (uint64) {\n (, , uint64 oldExpiry) = getData(uint256(node));\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\n _checkParentFuses(node, fuses, parentFuses);\n return _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n }\n\n function _checkParentFuses(\n bytes32 node,\n uint32 fuses,\n uint32 parentFuses\n ) internal pure {\n bool isBurningParentControlledFuses = fuses & PARENT_CONTROLLED_FUSES !=\n 0;\n\n bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;\n\n if (isBurningParentControlledFuses && parentHasNotBurnedCU) {\n revert OperationProhibited(node);\n }\n }\n\n function _normaliseExpiry(\n uint64 expiry,\n uint64 oldExpiry,\n uint64 maxExpiry\n ) private pure returns (uint64) {\n // Expiry cannot be more than maximum allowed\n // .eth names will check registrar, non .eth check parent\n if (expiry > maxExpiry) {\n expiry = maxExpiry;\n }\n // Expiry cannot be less than old expiry\n if (expiry < oldExpiry) {\n expiry = oldExpiry;\n }\n\n return expiry;\n }\n\n function _wrapETH2LD(\n string memory label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) private {\n bytes32 labelhash = keccak256(bytes(label));\n bytes32 node = _makeNode(ETH_NODE, labelhash);\n // hardcode dns-encoded eth string for gas savings\n bytes memory name = _addLabel(label, \"\\x03eth\\x00\");\n names[node] = name;\n\n _wrap(\n node,\n name,\n wrappedOwner,\n fuses | PARENT_CANNOT_CONTROL | IS_DOT_ETH,\n expiry\n );\n\n if (resolver != address(0)) {\n ens.setResolver(node, resolver);\n }\n }\n\n function _unwrap(bytes32 node, address owner) private {\n if (allFusesBurned(node, CANNOT_UNWRAP)) {\n revert OperationProhibited(node);\n }\n\n // Burn token and fuse data\n _burn(uint256(node));\n ens.setOwner(node, owner);\n\n emit NameUnwrapped(node, owner);\n }\n\n function _setFuses(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 oldExpiry,\n uint64 expiry\n ) internal {\n _setData(node, owner, fuses, expiry);\n emit FusesSet(node, fuses);\n if (expiry > oldExpiry) {\n emit ExpiryExtended(node, expiry);\n }\n }\n\n function _setData(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n _canFusesBeBurned(node, fuses);\n super._setData(uint256(node), owner, fuses, expiry);\n }\n\n function _canFusesBeBurned(bytes32 node, uint32 fuses) internal pure {\n // If a non-parent controlled fuse is being burned, check PCC and CU are burnt\n if (\n fuses & ~PARENT_CONTROLLED_FUSES != 0 &&\n fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=\n (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)\n ) {\n revert OperationProhibited(node);\n }\n }\n\n function _checkFusesAreSettable(bytes32 node, uint32 fuses) internal pure {\n if (fuses | USER_SETTABLE_FUSES != USER_SETTABLE_FUSES) {\n // Cannot directly burn other non-user settable fuses\n revert OperationProhibited(node);\n }\n }\n\n function _isWrapped(bytes32 node) internal view returns (bool) {\n return\n ownerOf(uint256(node)) != address(0) &&\n ens.owner(node) == address(this);\n }\n\n function _isETH2LDInGracePeriod(\n uint32 fuses,\n uint64 expiry\n ) internal view returns (bool) {\n return\n fuses & IS_DOT_ETH == IS_DOT_ETH &&\n expiry - GRACE_PERIOD < block.timestamp;\n }\n}\n" + }, + "contracts/wrapper/StaticMetadataService.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ncontract StaticMetadataService {\n string private _uri;\n\n constructor(string memory _metaDataUri) {\n _uri = _metaDataUri;\n }\n\n function uri(uint256) public view returns (string memory) {\n return _uri;\n }\n}\n" + }, + "contracts/wrapper/test/NameGriefer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BytesUtils} from \"../BytesUtils.sol\";\nimport {INameWrapper} from \"../INameWrapper.sol\";\nimport {ENS} from \"../../registry/ENS.sol\";\nimport {IERC1155Receiver} from \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\n\ncontract NameGriefer is IERC1155Receiver {\n using BytesUtils for *;\n\n ENS public immutable ens;\n INameWrapper public immutable wrapper;\n\n constructor(INameWrapper _wrapper) {\n wrapper = _wrapper;\n ENS _ens = _wrapper.ens();\n ens = _ens;\n _ens.setApprovalForAll(address(_wrapper), true);\n }\n\n function destroy(bytes calldata name) public {\n wrapper.wrap(name, address(this), address(0));\n }\n\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256,\n bytes calldata\n ) external override returns (bytes4) {\n require(operator == address(this), \"Operator must be us\");\n require(from == address(0), \"Token must be new\");\n\n // Unwrap the name\n bytes memory name = wrapper.names(bytes32(id));\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n wrapper.unwrap(parentNode, labelhash, address(this));\n\n // Here we can do something with the name before it's permanently burned, like\n // set the resolver or create subdomains.\n\n return NameGriefer.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external override returns (bytes4) {\n return NameGriefer.onERC1155BatchReceived.selector;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external view override returns (bool) {\n return\n interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`).\n interfaceID == 0x4e2312e0; // ERC-1155 `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\")) ^ bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`).\n }\n}\n" + }, + "contracts/wrapper/test/TestBytesUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract TestBytesUtils {\n using BytesUtils for *;\n\n function readLabel(\n bytes calldata name,\n uint256 offset\n ) public pure returns (bytes32, uint256) {\n return name.readLabel(offset);\n }\n\n function namehash(\n bytes calldata name,\n uint256 offset\n ) public pure returns (bytes32) {\n return name.namehash(offset);\n }\n}\n" + }, + "contracts/wrapper/test/TestNameWrapperReentrancy.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../INameWrapper.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract TestNameWrapperReentrancy is ERC165, IERC1155Receiver {\n INameWrapper nameWrapper;\n address owner;\n bytes32 parentNode;\n bytes32 labelHash;\n uint256 tokenId;\n\n constructor(\n address _owner,\n INameWrapper _nameWrapper,\n bytes32 _parentNode,\n bytes32 _labelHash\n ) {\n owner = _owner;\n nameWrapper = _nameWrapper;\n parentNode = _parentNode;\n labelHash = _labelHash;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function onERC1155Received(\n address,\n address,\n uint256 _id,\n uint256,\n bytes calldata\n ) public override returns (bytes4) {\n tokenId = _id;\n nameWrapper.unwrap(parentNode, labelHash, owner);\n\n return this.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual override returns (bytes4) {\n return this.onERC1155BatchReceived.selector;\n }\n\n function claimToOwner() public {\n nameWrapper.safeTransferFrom(address(this), owner, tokenId, 1, \"\");\n }\n}\n" + }, + "test/dnssec-oracle/TestBytesUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../../contracts/dnssec-oracle/RRUtils.sol\";\nimport \"../../contracts/dnssec-oracle/BytesUtils.sol\";\n\ncontract TestBytesUtils {\n using BytesUtils for *;\n\n function testKeccak() public pure {\n require(\n \"\".keccak(0, 0) ==\n bytes32(\n 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\n ),\n \"Incorrect hash of empty string\"\n );\n require(\n \"foo\".keccak(0, 3) ==\n bytes32(\n 0x41b1a0649752af1b28b3dc29a1556eee781e4a4c3a1f7f53f90fa834de098c4d\n ),\n \"Incorrect hash of 'foo'\"\n );\n require(\n \"foo\".keccak(0, 0) ==\n bytes32(\n 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\n ),\n \"Incorrect hash of empty string\"\n );\n }\n\n function testEquals() public pure {\n require(\"hello\".equals(\"hello\") == true, \"String equality\");\n require(\"hello\".equals(\"goodbye\") == false, \"String inequality\");\n require(\n \"hello\".equals(1, \"ello\") == true,\n \"Substring to string equality\"\n );\n require(\n \"hello\".equals(1, \"jello\", 1, 4) == true,\n \"Substring to substring equality\"\n );\n require(\n \"zhello\".equals(1, \"abchello\", 3) == true,\n \"Compare different value with multiple length\"\n );\n require(\n \"0x0102030000\".equals(0, \"0x010203\") == false,\n \"Compare with offset and trailing bytes\"\n );\n }\n\n function testComparePartial() public pure {\n require(\n \"xax\".compare(1, 1, \"xxbxx\", 2, 1) < 0 == true,\n \"Compare same length\"\n );\n require(\n \"xax\".compare(1, 1, \"xxabxx\", 2, 2) < 0 == true,\n \"Compare different length\"\n );\n require(\n \"xax\".compare(1, 1, \"xxaxx\", 2, 1) == 0 == true,\n \"Compare same with different offset\"\n );\n require(\n \"01234567890123450123456789012345ab\".compare(\n 0,\n 33,\n \"01234567890123450123456789012345aa\",\n 0,\n 33\n ) ==\n 0 ==\n true,\n \"Compare different long strings same length smaller partial length which must be equal\"\n );\n require(\n \"01234567890123450123456789012345ab\".compare(\n 0,\n 33,\n \"01234567890123450123456789012345aa\",\n 0,\n 34\n ) <\n 0 ==\n true,\n \"Compare long strings same length different partial length\"\n );\n require(\n \"0123456789012345012345678901234a\".compare(\n 0,\n 32,\n \"0123456789012345012345678901234b\",\n 0,\n 32\n ) <\n 0 ==\n true,\n \"Compare strings exactly 32 characters long\"\n );\n }\n\n function testCompare() public pure {\n require(\"a\".compare(\"a\") == 0 == true, \"Compare equal\");\n require(\n \"a\".compare(\"b\") < 0 == true,\n \"Compare different value with same length\"\n );\n require(\n \"b\".compare(\"a\") > 0 == true,\n \"Compare different value with same length\"\n );\n require(\n \"aa\".compare(\"ab\") < 0 == true,\n \"Compare different value with multiple length\"\n );\n require(\n \"a\".compare(\"aa\") < 0 == true,\n \"Compare different value with different length\"\n );\n require(\n \"aa\".compare(\"a\") > 0 == true,\n \"Compare different value with different length\"\n );\n bytes memory longChar = \"1234567890123456789012345678901234\";\n require(\n longChar.compare(longChar) == 0 == true,\n \"Compares more than 32 bytes char\"\n );\n bytes memory otherLongChar = \"2234567890123456789012345678901234\";\n require(\n longChar.compare(otherLongChar) < 0 == true,\n \"Compare long char with difference at start\"\n );\n }\n\n function testSubstring() public pure {\n require(\n keccak256(bytes(\"hello\".substring(0, 0))) == keccak256(bytes(\"\")),\n \"Copy 0 bytes\"\n );\n require(\n keccak256(bytes(\"hello\".substring(0, 4))) ==\n keccak256(bytes(\"hell\")),\n \"Copy substring\"\n );\n require(\n keccak256(bytes(\"hello\".substring(1, 4))) ==\n keccak256(bytes(\"ello\")),\n \"Copy substring\"\n );\n require(\n keccak256(bytes(\"hello\".substring(0, 5))) ==\n keccak256(bytes(\"hello\")),\n \"Copy whole string\"\n );\n }\n\n function testReadUint8() public pure {\n require(uint(\"a\".readUint8(0)) == 0x61, \"a == 0x61\");\n require(uint(\"ba\".readUint8(1)) == 0x61, \"a == 0x61\");\n }\n\n function testReadUint16() public pure {\n require(uint(\"abc\".readUint16(1)) == 0x6263, \"Read uint 16\");\n }\n\n function testReadUint32() public pure {\n require(uint(\"abcde\".readUint32(1)) == 0x62636465, \"Read uint 32\");\n }\n\n function testReadBytes20() public pure {\n require(\n bytes32(\"abcdefghijklmnopqrstuv\".readBytes20(1)) ==\n bytes32(\n 0x62636465666768696a6b6c6d6e6f707172737475000000000000000000000000\n ),\n \"readBytes20\"\n );\n }\n\n function testReadBytes32() public pure {\n require(\n \"0123456789abcdef0123456789abcdef\".readBytes32(0) ==\n bytes32(\n 0x3031323334353637383961626364656630313233343536373839616263646566\n ),\n \"readBytes32\"\n );\n }\n\n function testBase32HexDecodeWord() public pure {\n require(\n \"C4\".base32HexDecodeWord(0, 2) == bytes32(bytes1(\"a\")),\n \"Decode 'a'\"\n );\n require(\n \"C5GG\".base32HexDecodeWord(0, 4) == bytes32(bytes2(\"aa\")),\n \"Decode 'aa'\"\n );\n require(\n \"C5GM2\".base32HexDecodeWord(0, 5) == bytes32(bytes3(\"aaa\")),\n \"Decode 'aaa'\"\n );\n require(\n \"C5GM2O8\".base32HexDecodeWord(0, 7) == bytes32(bytes4(\"aaaa\")),\n \"Decode 'aaaa'\"\n );\n require(\n \"C5GM2OB1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")),\n \"Decode 'aaaaa'\"\n );\n require(\n \"c5gm2Ob1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")),\n \"Decode 'aaaaa' lowercase\"\n );\n require(\n \"C5H66P35CPJMGQBADDM6QRJFE1ON4SRKELR7EU3PF8\".base32HexDecodeWord(\n 0,\n 42\n ) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")),\n \"Decode alphabet\"\n );\n require(\n \"c5h66p35cpjmgqbaddm6qrjfe1on4srkelr7eu3pf8\".base32HexDecodeWord(\n 0,\n 42\n ) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")),\n \"Decode alphabet lowercase\"\n );\n require(\n \"C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GG\"\n .base32HexDecodeWord(0, 52) ==\n bytes32(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"),\n \"Decode 32*'a'\"\n );\n require(\n \" bst4hlje7r0o8c8p4o8q582lm0ejmiqt\\x07matoken\\x03xyz\\x00\"\n .base32HexDecodeWord(1, 32) ==\n bytes32(hex\"5f3a48d66e3ec18431192611a2a055b01d3b4b5d\"),\n \"Decode real bytes32hex\"\n );\n }\n}\n" + }, + "test/dnssec-oracle/TestRRUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../../contracts/dnssec-oracle/RRUtils.sol\";\nimport \"../../contracts/dnssec-oracle/BytesUtils.sol\";\n\ncontract TestRRUtils {\n using BytesUtils for *;\n using RRUtils for *;\n\n uint16 constant DNSTYPE_A = 1;\n uint16 constant DNSTYPE_CNAME = 5;\n uint16 constant DNSTYPE_MX = 15;\n uint16 constant DNSTYPE_TEXT = 16;\n uint16 constant DNSTYPE_RRSIG = 46;\n uint16 constant DNSTYPE_TYPE1234 = 1234;\n\n function testNameLength() public pure {\n require(hex\"00\".nameLength(0) == 1, \"nameLength('.') == 1\");\n require(hex\"0361626300\".nameLength(4) == 1, \"nameLength('.') == 1\");\n require(hex\"0361626300\".nameLength(0) == 5, \"nameLength('abc.') == 5\");\n }\n\n function testLabelCount() public pure {\n require(hex\"00\".labelCount(0) == 0, \"labelCount('.') == 0\");\n require(hex\"016100\".labelCount(0) == 1, \"labelCount('a.') == 1\");\n require(\n hex\"016201610000\".labelCount(0) == 2,\n \"labelCount('b.a.') == 2\"\n );\n require(\n hex\"066574686c61620378797a00\".labelCount(6 + 1) == 1,\n \"nameLength('(bthlab).xyz.') == 6\"\n );\n }\n\n function testIterateRRs() public pure {\n // a. IN A 3600 127.0.0.1\n // b.a. IN A 3600 192.168.1.1\n bytes\n memory rrs = hex\"0161000001000100000e1000047400000101620161000001000100000e100004c0a80101\";\n bytes[2] memory names = [bytes(hex\"016100\"), bytes(hex\"0162016100\")];\n bytes[2] memory rdatas = [bytes(hex\"74000001\"), bytes(hex\"c0a80101\")];\n uint i = 0;\n for (\n RRUtils.RRIterator memory iter = rrs.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n require(uint(iter.dnstype) == 1, \"Type matches\");\n require(uint(iter.class) == 1, \"Class matches\");\n require(uint(iter.ttl) == 3600, \"TTL matches\");\n require(\n keccak256(iter.name()) == keccak256(names[i]),\n \"Name matches\"\n );\n require(\n keccak256(iter.rdata()) == keccak256(rdatas[i]),\n \"Rdata matches\"\n );\n i++;\n }\n require(i == 2, \"Expected 2 records\");\n }\n\n // Canonical ordering https://tools.ietf.org/html/rfc4034#section-6.1\n function testCompareNames() public pure {\n bytes memory bthLabXyz = hex\"066274686c61620378797a00\";\n bytes memory ethLabXyz = hex\"066574686c61620378797a00\";\n bytes memory xyz = hex\"0378797a00\";\n bytes memory a_b_c = hex\"01610162016300\";\n bytes memory b_b_c = hex\"01620162016300\";\n bytes memory c = hex\"016300\";\n bytes memory d = hex\"016400\";\n bytes memory a_d_c = hex\"01610164016300\";\n bytes memory b_a_c = hex\"01620161016300\";\n bytes memory ab_c_d = hex\"0261620163016400\";\n bytes memory a_c_d = hex\"01610163016400\";\n bytes\n memory verylong1_eth = hex\"223031323334353637383930313233343536373839303132333435363738393031613031303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637380365746800\";\n bytes\n memory verylong2_eth = hex\"2130313233343536373839303132333435363738393031323334353637383930316131303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637380365746800\";\n\n require(\n hex\"0301616100\".compareNames(hex\"0302616200\") < 0,\n \"label lengths are correctly checked\"\n );\n require(\n a_b_c.compareNames(c) > 0,\n \"one name has a difference of >1 label to with the same root name\"\n );\n require(\n a_b_c.compareNames(d) < 0,\n \"one name has a difference of >1 label to with different root name\"\n );\n require(\n a_b_c.compareNames(a_d_c) < 0,\n \"two names start the same but have differences in later labels\"\n );\n require(\n a_b_c.compareNames(b_a_c) > 0,\n \"the first label sorts later, but the first label sorts earlier\"\n );\n require(\n ab_c_d.compareNames(a_c_d) > 0,\n \"two names where the first label on one is a prefix of the first label on the other\"\n );\n require(\n a_b_c.compareNames(b_b_c) < 0,\n \"two names where the first label on one is a prefix of the first label on the other\"\n );\n require(xyz.compareNames(ethLabXyz) < 0, \"xyz comes before ethLab.xyz\");\n require(\n bthLabXyz.compareNames(ethLabXyz) < 0,\n \"bthLab.xyz comes before ethLab.xyz\"\n );\n require(\n bthLabXyz.compareNames(bthLabXyz) == 0,\n \"bthLab.xyz and bthLab.xyz are the same\"\n );\n require(\n ethLabXyz.compareNames(bthLabXyz) > 0,\n \"ethLab.xyz comes after bethLab.xyz\"\n );\n require(bthLabXyz.compareNames(xyz) > 0, \"bthLab.xyz comes after xyz\");\n\n require(\n verylong1_eth.compareNames(verylong2_eth) > 0,\n \"longa.vlong.eth comes after long.vlong.eth\"\n );\n }\n\n function testSerialNumberGt() public pure {\n require(RRUtils.serialNumberGte(1, 0), \"1 >= 0\");\n require(!RRUtils.serialNumberGte(0, 1), \"!(0 <= 1)\");\n require(RRUtils.serialNumberGte(0, 0xFFFFFFFF), \"0 >= 0xFFFFFFFF\");\n require(!RRUtils.serialNumberGte(0xFFFFFFFF, 0), \"!(0 <= 0xFFFFFFFF)\");\n require(\n RRUtils.serialNumberGte(0x11111111, 0xAAAAAAAA),\n \"0x11111111 >= 0xAAAAAAAA\"\n );\n require(RRUtils.serialNumberGte(1, 1), \"1 >= 1\");\n }\n\n function testKeyTag() public view {\n require(\n hex\"0101030803010001a80020a95566ba42e886bb804cda84e47ef56dbd7aec612615552cec906d2116d0ef207028c51554144dfeafe7c7cb8f005dd18234133ac0710a81182ce1fd14ad2283bc83435f9df2f6313251931a176df0da51e54f42e604860dfb359580250f559cc543c4ffd51cbe3de8cfd06719237f9fc47ee729da06835fa452e825e9a18ebc2ecbcf563474652c33cf56a9033bcdf5d973121797ec8089041b6e03a1b72d0a735b984e03687309332324f27c2dba85e9db15e83a0143382e974b0621c18e625ecec907577d9e7bade95241a81ebbe8a901d4d3276e40b114c0a2e6fc38d19c2e6aab02644b2813f575fc21601e0dee49cd9ee96a43103e524d62873d\"\n .computeKeytag() == 19036,\n \"Invalid keytag\"\n );\n require(\n hex\"010003050440000003ba2fa05a75e173bede89eb71831ab14035f2408ad09df4d8dc8f8f72e8f13506feaddf7b04cb14958b82966e3420562302c4002bc4fd088432e160519bb14dae82443850c1423e06085710b5caf070d46b7ba7e481414f6a5fe225fdca984c959091645d0cf1c9a1a313d7e7fb7ba60b967b71a65f8cef2c3768e11b081c8fcf\"\n .computeKeytag() == 21693,\n \"Invalid keytag (2)\"\n );\n require(\n hex\"0100030503010001bfa54c38d909fabb0f937d70d775ba0df4c0badb09707d995249406950407a621c794c68b186b15dbf8f9f9ea231e9f96414ccda4eceb50b17a9ac6c4bd4b95da04849e96ee791578b703bc9ae184fb1794bac792a0787f693a40f19f523ee6dbd3599dbaaa9a50437926ecf6438845d1d49448962524f2a1a7a36b3a0a1eca3\"\n .computeKeytag() == 33630\n );\n require(\n hex\"0101030803010001acffb409bcc939f831f7a1e5ec88f7a59255ec53040be432027390a4ce896d6f9086f3c5e177fbfe118163aaec7af1462c47945944c4e2c026be5e98bbcded25978272e1e3e079c5094d573f0e83c92f02b32d3513b1550b826929c80dd0f92cac966d17769fd5867b647c3f38029abdc48152eb8f207159ecc5d232c7c1537c79f4b7ac28ff11682f21681bf6d6aba555032bf6f9f036beb2aaa5b3778d6eebfba6bf9ea191be4ab0caea759e2f773a1f9029c73ecb8d5735b9321db085f1b8e2d8038fe2941992548cee0d67dd4547e11dd63af9c9fc1c5466fb684cf009d7197c2cf79e792ab501e6a8a1ca519af2cb9b5f6367e94c0d47502451357be1b5\"\n .computeKeytag() == 20326,\n \"Invalid keytag (3)\"\n );\n }\n}\n" + }, + "test/registry/mocks/DummyResolver.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyResolver {\n mapping(bytes32 => string) public name;\n\n function setName(bytes32 node, string memory _name) public {\n name[node] = _name;\n }\n}\n" + }, + "test/reverseRegistrar/mocks/MockReverseClaimerImplementer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ENS} from \"../../../contracts/registry/ENS.sol\";\nimport {ReverseClaimer} from \"../../../contracts/reverseRegistrar/ReverseClaimer.sol\";\n\ncontract MockReverseClaimerImplementer is ReverseClaimer {\n constructor(ENS ens, address claimant) ReverseClaimer(ens, claimant) {}\n}\n" + }, + "test/utils/mocks/DummyOffchainResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"../../../contracts/resolvers/profiles/IExtendedResolver.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\ncontract DummyOffchainResolver is IExtendedResolver, ERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == type(IExtendedResolver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function resolve(\n bytes calldata /* name */,\n bytes calldata data\n ) external view returns (bytes memory) {\n string[] memory urls = new string[](1);\n urls[0] = \"https://example.com/\";\n revert OffchainLookup(\n address(this),\n urls,\n data,\n DummyOffchainResolver.resolveCallback.selector,\n data\n );\n }\n\n function addr(bytes32) external pure returns (bytes memory) {\n return abi.encode(\"onchain\");\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory) {\n require(\n keccak256(response) == keccak256(extraData),\n \"Response data error\"\n );\n if (bytes4(extraData) == bytes4(keccak256(\"name(bytes32)\"))) {\n return abi.encode(\"offchain.test.eth\");\n }\n return abi.encode(address(this));\n }\n}\n" + }, + "test/utils/mocks/LegacyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.13;\n\ncontract LegacyResolver {\n function addr(bytes32 /* node */) public view returns (address) {\n return address(this);\n }\n}\n" + }, + "test/utils/mocks/MockERC20.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockERC20 is ERC20 {\n constructor(\n string memory name,\n string memory symbol,\n address[] memory addresses\n ) ERC20(name, symbol) {\n _mint(msg.sender, 100 * 10 ** uint256(decimals()));\n\n for (uint256 i = 0; i < addresses.length; i++) {\n _mint(addresses[i], 100 * 10 ** uint256(decimals()));\n }\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 1300 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/e04502f562d98d0455f6c1c453418cdd.json b/deployments/sepolia/solcInputs/e04502f562d98d0455f6c1c453418cdd.json new file mode 100644 index 00000000..c0e28780 --- /dev/null +++ b/deployments/sepolia/solcInputs/e04502f562d98d0455f6c1c453418cdd.json @@ -0,0 +1,431 @@ +{ + "language": "Solidity", + "sources": { + "@ensdomains/buffer/contracts/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}\n" + }, + "@ensdomains/solsha1/contracts/SHA1.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary SHA1 {\n event Debug(bytes32 x);\n\n function sha1(bytes memory data) internal pure returns(bytes20 ret) {\n assembly {\n // Get a safe scratch location\n let scratch := mload(0x40)\n\n // Get the data length, and point data at the first byte\n let len := mload(data)\n data := add(data, 32)\n\n // Find the length after padding\n let totallen := add(and(add(len, 1), 0xFFFFFFFFFFFFFFC0), 64)\n switch lt(sub(totallen, len), 9)\n case 1 { totallen := add(totallen, 64) }\n\n let h := 0x6745230100EFCDAB890098BADCFE001032547600C3D2E1F0\n\n function readword(ptr, off, count) -> result {\n result := 0\n if lt(off, count) {\n result := mload(add(ptr, off))\n count := sub(count, off)\n if lt(count, 32) {\n let mask := not(sub(exp(256, sub(32, count)), 1))\n result := and(result, mask)\n }\n }\n }\n\n for { let i := 0 } lt(i, totallen) { i := add(i, 64) } {\n mstore(scratch, readword(data, i, len))\n mstore(add(scratch, 32), readword(data, add(i, 32), len))\n\n // If we loaded the last byte, store the terminator byte\n switch lt(sub(len, i), 64)\n case 1 { mstore8(add(scratch, sub(len, i)), 0x80) }\n\n // If this is the last block, store the length\n switch eq(i, sub(totallen, 64))\n case 1 { mstore(add(scratch, 32), or(mload(add(scratch, 32)), mul(len, 8))) }\n\n // Expand the 16 32-bit words into 80\n for { let j := 64 } lt(j, 128) { j := add(j, 12) } {\n let temp := xor(xor(mload(add(scratch, sub(j, 12))), mload(add(scratch, sub(j, 32)))), xor(mload(add(scratch, sub(j, 56))), mload(add(scratch, sub(j, 64)))))\n temp := or(and(mul(temp, 2), 0xFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFE), and(div(temp, 0x80000000), 0x0000000100000001000000010000000100000001000000010000000100000001))\n mstore(add(scratch, j), temp)\n }\n for { let j := 128 } lt(j, 320) { j := add(j, 24) } {\n let temp := xor(xor(mload(add(scratch, sub(j, 24))), mload(add(scratch, sub(j, 64)))), xor(mload(add(scratch, sub(j, 112))), mload(add(scratch, sub(j, 128)))))\n temp := or(and(mul(temp, 4), 0xFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFC), and(div(temp, 0x40000000), 0x0000000300000003000000030000000300000003000000030000000300000003))\n mstore(add(scratch, j), temp)\n }\n\n let x := h\n let f := 0\n let k := 0\n for { let j := 0 } lt(j, 80) { j := add(j, 1) } {\n switch div(j, 20)\n case 0 {\n // f = d xor (b and (c xor d))\n f := xor(div(x, 0x100000000000000000000), div(x, 0x10000000000))\n f := and(div(x, 0x1000000000000000000000000000000), f)\n f := xor(div(x, 0x10000000000), f)\n k := 0x5A827999\n }\n case 1{\n // f = b xor c xor d\n f := xor(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := xor(div(x, 0x10000000000), f)\n k := 0x6ED9EBA1\n }\n case 2 {\n // f = (b and c) or (d and (b or c))\n f := or(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := and(div(x, 0x10000000000), f)\n f := or(and(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000)), f)\n k := 0x8F1BBCDC\n }\n case 3 {\n // f = b xor c xor d\n f := xor(div(x, 0x1000000000000000000000000000000), div(x, 0x100000000000000000000))\n f := xor(div(x, 0x10000000000), f)\n k := 0xCA62C1D6\n }\n // temp = (a leftrotate 5) + f + e + k + w[i]\n let temp := and(div(x, 0x80000000000000000000000000000000000000000000000), 0x1F)\n temp := or(and(div(x, 0x800000000000000000000000000000000000000), 0xFFFFFFE0), temp)\n temp := add(f, temp)\n temp := add(and(x, 0xFFFFFFFF), temp)\n temp := add(k, temp)\n temp := add(div(mload(add(scratch, mul(j, 4))), 0x100000000000000000000000000000000000000000000000000000000), temp)\n x := or(div(x, 0x10000000000), mul(temp, 0x10000000000000000000000000000000000000000))\n x := or(and(x, 0xFFFFFFFF00FFFFFFFF000000000000FFFFFFFF00FFFFFFFF), mul(or(and(div(x, 0x4000000000000), 0xC0000000), and(div(x, 0x400000000000000000000), 0x3FFFFFFF)), 0x100000000000000000000))\n }\n\n h := and(add(h, x), 0xFFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF)\n }\n ret := mul(or(or(or(or(and(div(h, 0x100000000), 0xFFFFFFFF00000000000000000000000000000000), and(div(h, 0x1000000), 0xFFFFFFFF000000000000000000000000)), and(div(h, 0x10000), 0xFFFFFFFF0000000000000000)), and(div(h, 0x100), 0xFFFFFFFF00000000)), and(h, 0xFFFFFFFF)), 0x1000000000000000000000000)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "contracts/dnsregistrar/DNSClaimChecker.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../utils/HexUtils.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\nlibrary DNSClaimChecker {\n using BytesUtils for bytes;\n using HexUtils for bytes;\n using RRUtils for *;\n using Buffer for Buffer.buffer;\n\n uint16 constant CLASS_INET = 1;\n uint16 constant TYPE_TXT = 16;\n\n function getOwnerAddress(\n bytes memory name,\n bytes memory data\n ) internal pure returns (address, bool) {\n // Add \"_ens.\" to the front of the name.\n Buffer.buffer memory buf;\n buf.init(name.length + 5);\n buf.append(\"\\x04_ens\");\n buf.append(name);\n\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n if (iter.name().compareNames(buf.buf) != 0) continue;\n bool found;\n address addr;\n (addr, found) = parseRR(data, iter.rdataOffset, iter.nextOffset);\n if (found) {\n return (addr, true);\n }\n }\n\n return (address(0x0), false);\n }\n\n function parseRR(\n bytes memory rdata,\n uint256 idx,\n uint256 endIdx\n ) internal pure returns (address, bool) {\n while (idx < endIdx) {\n uint256 len = rdata.readUint8(idx);\n idx += 1;\n\n bool found;\n address addr;\n (addr, found) = parseString(rdata, idx, len);\n\n if (found) return (addr, true);\n idx += len;\n }\n\n return (address(0x0), false);\n }\n\n function parseString(\n bytes memory str,\n uint256 idx,\n uint256 len\n ) internal pure returns (address, bool) {\n // TODO: More robust parsing that handles whitespace and multiple key/value pairs\n if (str.readUint32(idx) != 0x613d3078) return (address(0x0), false); // 0x613d3078 == 'a=0x'\n return str.hexToAddress(idx + 4, idx + len);\n }\n}\n" + }, + "contracts/dnsregistrar/DNSRegistrar.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../registry/ENSRegistry.sol\";\nimport \"../root/Root.sol\";\nimport \"../resolvers/profiles/AddrResolver.sol\";\nimport \"./DNSClaimChecker.sol\";\nimport \"./PublicSuffixList.sol\";\nimport \"./IDNSRegistrar.sol\";\n\n/**\n * @dev An ENS registrar that allows the owner of a DNS name to claim the\n * corresponding name in ENS.\n */\ncontract DNSRegistrar is IDNSRegistrar, IERC165 {\n using BytesUtils for bytes;\n using Buffer for Buffer.buffer;\n using RRUtils for *;\n\n ENS public immutable ens;\n DNSSEC public immutable oracle;\n PublicSuffixList public suffixes;\n address public immutable previousRegistrar;\n address public immutable resolver;\n // A mapping of the most recent signatures seen for each claimed domain.\n mapping(bytes32 => uint32) public inceptions;\n\n error NoOwnerRecordFound();\n error PermissionDenied(address caller, address owner);\n error PreconditionNotMet();\n error StaleProof();\n error InvalidPublicSuffix(bytes name);\n\n struct OwnerRecord {\n bytes name;\n address owner;\n address resolver;\n uint64 ttl;\n }\n\n event Claim(\n bytes32 indexed node,\n address indexed owner,\n bytes dnsname,\n uint32 inception\n );\n event NewPublicSuffixList(address suffixes);\n\n constructor(\n address _previousRegistrar,\n address _resolver,\n DNSSEC _dnssec,\n PublicSuffixList _suffixes,\n ENS _ens\n ) {\n previousRegistrar = _previousRegistrar;\n resolver = _resolver;\n oracle = _dnssec;\n suffixes = _suffixes;\n emit NewPublicSuffixList(address(suffixes));\n ens = _ens;\n }\n\n /**\n * @dev This contract's owner-only functions can be invoked by the owner of the ENS root.\n */\n modifier onlyOwner() {\n Root root = Root(ens.owner(bytes32(0)));\n address owner = root.owner();\n require(msg.sender == owner);\n _;\n }\n\n function setPublicSuffixList(PublicSuffixList _suffixes) public onlyOwner {\n suffixes = _suffixes;\n emit NewPublicSuffixList(address(suffixes));\n }\n\n /**\n * @dev Submits proofs to the DNSSEC oracle, then claims a name using those proofs.\n * @param name The name to claim, in DNS wire format.\n * @param input A chain of signed DNS RRSETs ending with a text record.\n */\n function proveAndClaim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) public override {\n (bytes32 rootNode, bytes32 labelHash, address addr) = _claim(\n name,\n input\n );\n ens.setSubnodeOwner(rootNode, labelHash, addr);\n }\n\n function proveAndClaimWithResolver(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input,\n address resolver,\n address addr\n ) public override {\n (bytes32 rootNode, bytes32 labelHash, address owner) = _claim(\n name,\n input\n );\n if (msg.sender != owner) {\n revert PermissionDenied(msg.sender, owner);\n }\n ens.setSubnodeRecord(rootNode, labelHash, owner, resolver, 0);\n if (addr != address(0)) {\n if (resolver == address(0)) {\n revert PreconditionNotMet();\n }\n bytes32 node = keccak256(abi.encodePacked(rootNode, labelHash));\n // Set the resolver record\n AddrResolver(resolver).setAddr(node, addr);\n }\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure override returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IDNSRegistrar).interfaceId;\n }\n\n function _claim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) internal returns (bytes32 parentNode, bytes32 labelHash, address addr) {\n (bytes memory data, uint32 inception) = oracle.verifyRRSet(input);\n\n // Get the first label\n uint256 labelLen = name.readUint8(0);\n labelHash = name.keccak(1, labelLen);\n\n bytes memory parentName = name.substring(\n labelLen + 1,\n name.length - labelLen - 1\n );\n\n // Make sure the parent name is enabled\n parentNode = enableNode(parentName);\n\n bytes32 node = keccak256(abi.encodePacked(parentNode, labelHash));\n if (!RRUtils.serialNumberGte(inception, inceptions[node])) {\n revert StaleProof();\n }\n inceptions[node] = inception;\n\n bool found;\n (addr, found) = DNSClaimChecker.getOwnerAddress(name, data);\n if (!found) {\n revert NoOwnerRecordFound();\n }\n\n emit Claim(node, addr, name, inception);\n }\n\n function enableNode(bytes memory domain) public returns (bytes32 node) {\n // Name must be in the public suffix list.\n if (!suffixes.isPublicSuffix(domain)) {\n revert InvalidPublicSuffix(domain);\n }\n return _enableNode(domain, 0);\n }\n\n function _enableNode(\n bytes memory domain,\n uint256 offset\n ) internal returns (bytes32 node) {\n uint256 len = domain.readUint8(offset);\n if (len == 0) {\n return bytes32(0);\n }\n\n bytes32 parentNode = _enableNode(domain, offset + len + 1);\n bytes32 label = domain.keccak(offset + 1, len);\n node = keccak256(abi.encodePacked(parentNode, label));\n address owner = ens.owner(node);\n if (owner == address(0) || owner == previousRegistrar) {\n if (parentNode == bytes32(0)) {\n Root root = Root(ens.owner(bytes32(0)));\n root.setSubnodeOwner(label, address(this));\n ens.setResolver(node, resolver);\n } else {\n ens.setSubnodeRecord(\n parentNode,\n label,\n address(this),\n resolver,\n 0\n );\n }\n } else if (owner != address(this)) {\n revert PreconditionNotMet();\n }\n return node;\n }\n}\n" + }, + "contracts/dnsregistrar/IDNSRegistrar.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/DNSSEC.sol\";\n\ninterface IDNSRegistrar {\n function proveAndClaim(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input\n ) external;\n\n function proveAndClaimWithResolver(\n bytes memory name,\n DNSSEC.RRSetWithSignature[] memory input,\n address resolver,\n address addr\n ) external;\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyDnsRegistrarDNSSEC.sol": { + "content": "pragma solidity ^0.8.4;\n\ncontract DummyDNSSEC {\n uint16 expectedType;\n bytes expectedName;\n uint32 inception;\n uint64 inserted;\n bytes20 hash;\n\n function setData(\n uint16 _expectedType,\n bytes memory _expectedName,\n uint32 _inception,\n uint64 _inserted,\n bytes memory _proof\n ) public {\n expectedType = _expectedType;\n expectedName = _expectedName;\n inception = _inception;\n inserted = _inserted;\n if (_proof.length != 0) {\n hash = bytes20(keccak256(_proof));\n }\n }\n\n function rrdata(\n uint16 dnstype,\n bytes memory name\n ) public view returns (uint32, uint64, bytes20) {\n require(dnstype == expectedType);\n require(keccak256(name) == keccak256(expectedName));\n return (inception, inserted, hash);\n }\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyExtendedDNSSECResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../resolvers/profiles/IExtendedDNSResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract DummyExtendedDNSSECResolver is IExtendedDNSResolver, IERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) external pure override returns (bool) {\n return interfaceId == type(IExtendedDNSResolver).interfaceId;\n }\n\n function resolve(\n bytes memory /* name */,\n bytes memory /* data */,\n bytes memory context\n ) external view override returns (bytes memory) {\n return abi.encode(context);\n }\n}\n" + }, + "contracts/dnsregistrar/mocks/DummyLegacyTextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../resolvers/profiles/ITextResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract DummyLegacyTextResolver is ITextResolver, IERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) external pure override returns (bool) {\n return interfaceId == type(ITextResolver).interfaceId;\n }\n\n function text(\n bytes32 /* node */,\n string calldata key\n ) external view override returns (string memory) {\n return key;\n }\n}\n" + }, + "contracts/dnsregistrar/OffchainDNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../contracts/resolvers/profiles/IAddrResolver.sol\";\nimport \"../../contracts/resolvers/profiles/IExtendedResolver.sol\";\nimport \"../../contracts/resolvers/profiles/IExtendedDNSResolver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"../dnssec-oracle/DNSSEC.sol\";\nimport \"../dnssec-oracle/RRUtils.sol\";\nimport \"../registry/ENSRegistry.sol\";\nimport \"../utils/HexUtils.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\ninterface IDNSGateway {\n function resolve(\n bytes memory name,\n uint16 qtype\n ) external returns (DNSSEC.RRSetWithSignature[] memory);\n}\n\nuint16 constant CLASS_INET = 1;\nuint16 constant TYPE_TXT = 16;\n\ncontract OffchainDNSResolver is IExtendedResolver {\n using RRUtils for *;\n using BytesUtils for bytes;\n using HexUtils for bytes;\n\n ENS public immutable ens;\n DNSSEC public immutable oracle;\n string public gatewayURL;\n\n error CouldNotResolve(bytes name);\n\n constructor(ENS _ens, DNSSEC _oracle, string memory _gatewayURL) {\n ens = _ens;\n oracle = _oracle;\n gatewayURL = _gatewayURL;\n }\n\n function resolve(\n bytes calldata name,\n bytes calldata data\n ) external view returns (bytes memory) {\n string[] memory urls = new string[](1);\n urls[0] = gatewayURL;\n\n revert OffchainLookup(\n address(this),\n urls,\n abi.encodeCall(IDNSGateway.resolve, (name, TYPE_TXT)),\n OffchainDNSResolver.resolveCallback.selector,\n abi.encode(name, data)\n );\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory) {\n (bytes memory name, bytes memory query) = abi.decode(\n extraData,\n (bytes, bytes)\n );\n DNSSEC.RRSetWithSignature[] memory rrsets = abi.decode(\n response,\n (DNSSEC.RRSetWithSignature[])\n );\n\n (bytes memory data, ) = oracle.verifyRRSet(rrsets);\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n // Ignore records with wrong name, type, or class\n bytes memory rrname = RRUtils.readName(iter.data, iter.offset);\n if (\n !rrname.equals(name) ||\n iter.class != CLASS_INET ||\n iter.dnstype != TYPE_TXT\n ) {\n continue;\n }\n\n // Look for a valid ENS-DNS TXT record\n (address dnsresolver, bytes memory context) = parseRR(\n iter.data,\n iter.rdataOffset,\n iter.nextOffset\n );\n\n // If we found a valid record, try to resolve it\n if (dnsresolver != address(0)) {\n if (\n IERC165(dnsresolver).supportsInterface(\n IExtendedDNSResolver.resolve.selector\n )\n ) {\n return\n IExtendedDNSResolver(dnsresolver).resolve(\n name,\n query,\n context\n );\n } else if (\n IERC165(dnsresolver).supportsInterface(\n IExtendedResolver.resolve.selector\n )\n ) {\n return IExtendedResolver(dnsresolver).resolve(name, query);\n } else {\n (bool ok, bytes memory ret) = address(dnsresolver)\n .staticcall(query);\n if (ok) {\n return ret;\n } else {\n revert CouldNotResolve(name);\n }\n }\n }\n }\n\n // No valid records; revert.\n revert CouldNotResolve(name);\n }\n\n function parseRR(\n bytes memory data,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address, bytes memory) {\n bytes memory txt = readTXT(data, idx, lastIdx);\n\n // Must start with the magic word\n if (txt.length < 5 || !txt.equals(0, \"ENS1 \", 0, 5)) {\n return (address(0), \"\");\n }\n\n // Parse the name or address\n uint256 lastTxtIdx = txt.find(5, txt.length - 5, \" \");\n if (lastTxtIdx > txt.length) {\n address dnsResolver = parseAndResolve(txt, 5, txt.length);\n return (dnsResolver, \"\");\n } else {\n address dnsResolver = parseAndResolve(txt, 5, lastTxtIdx);\n return (\n dnsResolver,\n txt.substring(lastTxtIdx + 1, txt.length - lastTxtIdx - 1)\n );\n }\n }\n\n function readTXT(\n bytes memory data,\n uint256 startIdx,\n uint256 lastIdx\n ) internal pure returns (bytes memory) {\n // TODO: Concatenate multiple text fields\n uint256 fieldLength = data.readUint8(startIdx);\n assert(startIdx + fieldLength < lastIdx);\n return data.substring(startIdx + 1, fieldLength);\n }\n\n function parseAndResolve(\n bytes memory nameOrAddress,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address) {\n if (nameOrAddress[idx] == \"0\" && nameOrAddress[idx + 1] == \"x\") {\n (address ret, bool valid) = nameOrAddress.hexToAddress(\n idx + 2,\n lastIdx\n );\n if (valid) {\n return ret;\n }\n }\n return resolveName(nameOrAddress, idx, lastIdx);\n }\n\n function resolveName(\n bytes memory name,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (address) {\n bytes32 node = textNamehash(name, idx, lastIdx);\n address resolver = ens.resolver(node);\n if (resolver == address(0)) {\n return address(0);\n }\n return IAddrResolver(resolver).addr(node);\n }\n\n /**\n * @dev Namehash function that operates on dot-separated names (not dns-encoded names)\n * @param name Name to hash\n * @param idx Index to start at\n * @param lastIdx Index to end at\n */\n function textNamehash(\n bytes memory name,\n uint256 idx,\n uint256 lastIdx\n ) internal view returns (bytes32) {\n uint256 separator = name.find(idx, name.length - idx, bytes1(\".\"));\n bytes32 parentNode = bytes32(0);\n if (separator < lastIdx) {\n parentNode = textNamehash(name, separator + 1, lastIdx);\n } else {\n separator = lastIdx;\n }\n return\n keccak256(\n abi.encodePacked(parentNode, name.keccak(idx, separator - idx))\n );\n }\n}\n" + }, + "contracts/dnsregistrar/PublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\n\ninterface PublicSuffixList {\n function isPublicSuffix(bytes calldata name) external view returns (bool);\n}\n" + }, + "contracts/dnsregistrar/RecordParser.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.11;\n\nimport \"../dnssec-oracle/BytesUtils.sol\";\n\nlibrary RecordParser {\n using BytesUtils for bytes;\n\n /**\n * @dev Parses a key-value record into a key and value.\n * @param input The input string\n * @param offset The offset to start reading at\n */\n function readKeyValue(\n bytes memory input,\n uint256 offset,\n uint256 len\n )\n internal\n pure\n returns (bytes memory key, bytes memory value, uint256 nextOffset)\n {\n uint256 separator = input.find(offset, len, \"=\");\n if (separator == type(uint256).max) {\n return (\"\", \"\", type(uint256).max);\n }\n\n uint256 terminator = input.find(\n separator,\n len + offset - separator,\n \" \"\n );\n if (terminator == type(uint256).max) {\n terminator = input.length;\n }\n\n key = input.substring(offset, separator - offset);\n value = input.substring(separator + 1, terminator - separator - 1);\n nextOffset = terminator + 1;\n }\n}\n" + }, + "contracts/dnsregistrar/SimplePublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nimport \"../root/Ownable.sol\";\nimport \"./PublicSuffixList.sol\";\n\ncontract SimplePublicSuffixList is PublicSuffixList, Ownable {\n mapping(bytes => bool) suffixes;\n\n function addPublicSuffixes(bytes[] memory names) public onlyOwner {\n for (uint256 i = 0; i < names.length; i++) {\n suffixes[names[i]] = true;\n }\n }\n\n function isPublicSuffix(\n bytes calldata name\n ) external view override returns (bool) {\n return suffixes[name];\n }\n}\n" + }, + "contracts/dnsregistrar/TLDPublicSuffixList.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../dnssec-oracle/BytesUtils.sol\";\nimport \"./PublicSuffixList.sol\";\n\n/**\n * @dev A public suffix list that treats all TLDs as public suffixes.\n */\ncontract TLDPublicSuffixList is PublicSuffixList {\n using BytesUtils for bytes;\n\n function isPublicSuffix(\n bytes calldata name\n ) external view override returns (bool) {\n uint256 labellen = name.readUint8(0);\n return labellen > 0 && name.readUint8(labellen + 1) == 0;\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev An interface for contracts implementing a DNSSEC (signing) algorithm.\n */\ninterface Algorithm {\n /**\n * @dev Verifies a signature.\n * @param key The public key to verify with.\n * @param data The signed data to verify.\n * @param signature The signature to verify.\n * @return True iff the signature is valid.\n */\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata signature\n ) external view virtual returns (bool);\n}\n" + }, + "contracts/dnssec-oracle/algorithms/DummyAlgorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\n\n/**\n * @dev Implements a dummy DNSSEC (signing) algorithm that approves all\n * signatures, for testing.\n */\ncontract DummyAlgorithm is Algorithm {\n function verify(\n bytes calldata,\n bytes calldata,\n bytes calldata\n ) external view override returns (bool) {\n return true;\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/EllipticCurve.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @title EllipticCurve\n *\n * @author Tilman Drerup;\n *\n * @notice Implements elliptic curve math; Parametrized for SECP256R1.\n *\n * Includes components of code by Andreas Olofsson, Alexander Vlasov\n * (https://github.com/BANKEX/CurveArithmetics), and Avi Asayag\n * (https://github.com/orbs-network/elliptic-curve-solidity)\n *\n * Source: https://github.com/tdrerup/elliptic-curve-solidity\n *\n * @dev NOTE: To disambiguate public keys when verifying signatures, activate\n * condition 'rs[1] > lowSmax' in validateSignature().\n */\ncontract EllipticCurve {\n // Set parameters for curve.\n uint256 constant a =\n 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC;\n uint256 constant b =\n 0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B;\n uint256 constant gx =\n 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296;\n uint256 constant gy =\n 0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5;\n uint256 constant p =\n 0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF;\n uint256 constant n =\n 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;\n\n uint256 constant lowSmax =\n 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0;\n\n /**\n * @dev Inverse of u in the field of modulo m.\n */\n function inverseMod(uint256 u, uint256 m) internal pure returns (uint256) {\n unchecked {\n if (u == 0 || u == m || m == 0) return 0;\n if (u > m) u = u % m;\n\n int256 t1;\n int256 t2 = 1;\n uint256 r1 = m;\n uint256 r2 = u;\n uint256 q;\n\n while (r2 != 0) {\n q = r1 / r2;\n (t1, t2, r1, r2) = (t2, t1 - int256(q) * t2, r2, r1 - q * r2);\n }\n\n if (t1 < 0) return (m - uint256(-t1));\n\n return uint256(t1);\n }\n }\n\n /**\n * @dev Transform affine coordinates into projective coordinates.\n */\n function toProjectivePoint(\n uint256 x0,\n uint256 y0\n ) internal pure returns (uint256[3] memory P) {\n P[2] = addmod(0, 1, p);\n P[0] = mulmod(x0, P[2], p);\n P[1] = mulmod(y0, P[2], p);\n }\n\n /**\n * @dev Add two points in affine coordinates and return projective point.\n */\n function addAndReturnProjectivePoint(\n uint256 x1,\n uint256 y1,\n uint256 x2,\n uint256 y2\n ) internal pure returns (uint256[3] memory P) {\n uint256 x;\n uint256 y;\n (x, y) = add(x1, y1, x2, y2);\n P = toProjectivePoint(x, y);\n }\n\n /**\n * @dev Transform from projective to affine coordinates.\n */\n function toAffinePoint(\n uint256 x0,\n uint256 y0,\n uint256 z0\n ) internal pure returns (uint256 x1, uint256 y1) {\n uint256 z0Inv;\n z0Inv = inverseMod(z0, p);\n x1 = mulmod(x0, z0Inv, p);\n y1 = mulmod(y0, z0Inv, p);\n }\n\n /**\n * @dev Return the zero curve in projective coordinates.\n */\n function zeroProj()\n internal\n pure\n returns (uint256 x, uint256 y, uint256 z)\n {\n return (0, 1, 0);\n }\n\n /**\n * @dev Return the zero curve in affine coordinates.\n */\n function zeroAffine() internal pure returns (uint256 x, uint256 y) {\n return (0, 0);\n }\n\n /**\n * @dev Check if the curve is the zero curve.\n */\n function isZeroCurve(\n uint256 x0,\n uint256 y0\n ) internal pure returns (bool isZero) {\n if (x0 == 0 && y0 == 0) {\n return true;\n }\n return false;\n }\n\n /**\n * @dev Check if a point in affine coordinates is on the curve.\n */\n function isOnCurve(uint256 x, uint256 y) internal pure returns (bool) {\n if (0 == x || x == p || 0 == y || y == p) {\n return false;\n }\n\n uint256 LHS = mulmod(y, y, p); // y^2\n uint256 RHS = mulmod(mulmod(x, x, p), x, p); // x^3\n\n if (a != 0) {\n RHS = addmod(RHS, mulmod(x, a, p), p); // x^3 + a*x\n }\n if (b != 0) {\n RHS = addmod(RHS, b, p); // x^3 + a*x + b\n }\n\n return LHS == RHS;\n }\n\n /**\n * @dev Double an elliptic curve point in projective coordinates. See\n * https://www.nayuki.io/page/elliptic-curve-point-addition-in-projective-coordinates\n */\n function twiceProj(\n uint256 x0,\n uint256 y0,\n uint256 z0\n ) internal pure returns (uint256 x1, uint256 y1, uint256 z1) {\n uint256 t;\n uint256 u;\n uint256 v;\n uint256 w;\n\n if (isZeroCurve(x0, y0)) {\n return zeroProj();\n }\n\n u = mulmod(y0, z0, p);\n u = mulmod(u, 2, p);\n\n v = mulmod(u, x0, p);\n v = mulmod(v, y0, p);\n v = mulmod(v, 2, p);\n\n x0 = mulmod(x0, x0, p);\n t = mulmod(x0, 3, p);\n\n z0 = mulmod(z0, z0, p);\n z0 = mulmod(z0, a, p);\n t = addmod(t, z0, p);\n\n w = mulmod(t, t, p);\n x0 = mulmod(2, v, p);\n w = addmod(w, p - x0, p);\n\n x0 = addmod(v, p - w, p);\n x0 = mulmod(t, x0, p);\n y0 = mulmod(y0, u, p);\n y0 = mulmod(y0, y0, p);\n y0 = mulmod(2, y0, p);\n y1 = addmod(x0, p - y0, p);\n\n x1 = mulmod(u, w, p);\n\n z1 = mulmod(u, u, p);\n z1 = mulmod(z1, u, p);\n }\n\n /**\n * @dev Add two elliptic curve points in projective coordinates. See\n * https://www.nayuki.io/page/elliptic-curve-point-addition-in-projective-coordinates\n */\n function addProj(\n uint256 x0,\n uint256 y0,\n uint256 z0,\n uint256 x1,\n uint256 y1,\n uint256 z1\n ) internal pure returns (uint256 x2, uint256 y2, uint256 z2) {\n uint256 t0;\n uint256 t1;\n uint256 u0;\n uint256 u1;\n\n if (isZeroCurve(x0, y0)) {\n return (x1, y1, z1);\n } else if (isZeroCurve(x1, y1)) {\n return (x0, y0, z0);\n }\n\n t0 = mulmod(y0, z1, p);\n t1 = mulmod(y1, z0, p);\n\n u0 = mulmod(x0, z1, p);\n u1 = mulmod(x1, z0, p);\n\n if (u0 == u1) {\n if (t0 == t1) {\n return twiceProj(x0, y0, z0);\n } else {\n return zeroProj();\n }\n }\n\n (x2, y2, z2) = addProj2(mulmod(z0, z1, p), u0, u1, t1, t0);\n }\n\n /**\n * @dev Helper function that splits addProj to avoid too many local variables.\n */\n function addProj2(\n uint256 v,\n uint256 u0,\n uint256 u1,\n uint256 t1,\n uint256 t0\n ) private pure returns (uint256 x2, uint256 y2, uint256 z2) {\n uint256 u;\n uint256 u2;\n uint256 u3;\n uint256 w;\n uint256 t;\n\n t = addmod(t0, p - t1, p);\n u = addmod(u0, p - u1, p);\n u2 = mulmod(u, u, p);\n\n w = mulmod(t, t, p);\n w = mulmod(w, v, p);\n u1 = addmod(u1, u0, p);\n u1 = mulmod(u1, u2, p);\n w = addmod(w, p - u1, p);\n\n x2 = mulmod(u, w, p);\n\n u3 = mulmod(u2, u, p);\n u0 = mulmod(u0, u2, p);\n u0 = addmod(u0, p - w, p);\n t = mulmod(t, u0, p);\n t0 = mulmod(t0, u3, p);\n\n y2 = addmod(t, p - t0, p);\n\n z2 = mulmod(u3, v, p);\n }\n\n /**\n * @dev Add two elliptic curve points in affine coordinates.\n */\n function add(\n uint256 x0,\n uint256 y0,\n uint256 x1,\n uint256 y1\n ) internal pure returns (uint256, uint256) {\n uint256 z0;\n\n (x0, y0, z0) = addProj(x0, y0, 1, x1, y1, 1);\n\n return toAffinePoint(x0, y0, z0);\n }\n\n /**\n * @dev Double an elliptic curve point in affine coordinates.\n */\n function twice(\n uint256 x0,\n uint256 y0\n ) internal pure returns (uint256, uint256) {\n uint256 z0;\n\n (x0, y0, z0) = twiceProj(x0, y0, 1);\n\n return toAffinePoint(x0, y0, z0);\n }\n\n /**\n * @dev Multiply an elliptic curve point by a 2 power base (i.e., (2^exp)*P)).\n */\n function multiplyPowerBase2(\n uint256 x0,\n uint256 y0,\n uint256 exp\n ) internal pure returns (uint256, uint256) {\n uint256 base2X = x0;\n uint256 base2Y = y0;\n uint256 base2Z = 1;\n\n for (uint256 i = 0; i < exp; i++) {\n (base2X, base2Y, base2Z) = twiceProj(base2X, base2Y, base2Z);\n }\n\n return toAffinePoint(base2X, base2Y, base2Z);\n }\n\n /**\n * @dev Multiply an elliptic curve point by a scalar.\n */\n function multiplyScalar(\n uint256 x0,\n uint256 y0,\n uint256 scalar\n ) internal pure returns (uint256 x1, uint256 y1) {\n if (scalar == 0) {\n return zeroAffine();\n } else if (scalar == 1) {\n return (x0, y0);\n } else if (scalar == 2) {\n return twice(x0, y0);\n }\n\n uint256 base2X = x0;\n uint256 base2Y = y0;\n uint256 base2Z = 1;\n uint256 z1 = 1;\n x1 = x0;\n y1 = y0;\n\n if (scalar % 2 == 0) {\n x1 = y1 = 0;\n }\n\n scalar = scalar >> 1;\n\n while (scalar > 0) {\n (base2X, base2Y, base2Z) = twiceProj(base2X, base2Y, base2Z);\n\n if (scalar % 2 == 1) {\n (x1, y1, z1) = addProj(base2X, base2Y, base2Z, x1, y1, z1);\n }\n\n scalar = scalar >> 1;\n }\n\n return toAffinePoint(x1, y1, z1);\n }\n\n /**\n * @dev Multiply the curve's generator point by a scalar.\n */\n function multipleGeneratorByScalar(\n uint256 scalar\n ) internal pure returns (uint256, uint256) {\n return multiplyScalar(gx, gy, scalar);\n }\n\n /**\n * @dev Validate combination of message, signature, and public key.\n */\n function validateSignature(\n bytes32 message,\n uint256[2] memory rs,\n uint256[2] memory Q\n ) internal pure returns (bool) {\n // To disambiguate between public key solutions, include comment below.\n if (rs[0] == 0 || rs[0] >= n || rs[1] == 0) {\n // || rs[1] > lowSmax)\n return false;\n }\n if (!isOnCurve(Q[0], Q[1])) {\n return false;\n }\n\n uint256 x1;\n uint256 x2;\n uint256 y1;\n uint256 y2;\n\n uint256 sInv = inverseMod(rs[1], n);\n (x1, y1) = multiplyScalar(gx, gy, mulmod(uint256(message), sInv, n));\n (x2, y2) = multiplyScalar(Q[0], Q[1], mulmod(rs[0], sInv, n));\n uint256[3] memory P = addAndReturnProjectivePoint(x1, y1, x2, y2);\n\n if (P[2] == 0) {\n return false;\n }\n\n uint256 Px = inverseMod(P[2], p);\n Px = mulmod(P[0], mulmod(Px, Px, p), p);\n\n return Px % n == rs[0];\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/ModexpPrecompile.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary ModexpPrecompile {\n /**\n * @dev Computes (base ^ exponent) % modulus over big numbers.\n */\n function modexp(\n bytes memory base,\n bytes memory exponent,\n bytes memory modulus\n ) internal view returns (bool success, bytes memory output) {\n bytes memory input = abi.encodePacked(\n uint256(base.length),\n uint256(exponent.length),\n uint256(modulus.length),\n base,\n exponent,\n modulus\n );\n\n output = new bytes(modulus.length);\n\n assembly {\n success := staticcall(\n gas(),\n 5,\n add(input, 32),\n mload(input),\n add(output, 32),\n mload(modulus)\n )\n }\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/P256SHA256Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"./EllipticCurve.sol\";\nimport \"../BytesUtils.sol\";\n\ncontract P256SHA256Algorithm is Algorithm, EllipticCurve {\n using BytesUtils for *;\n\n /**\n * @dev Verifies a signature.\n * @param key The public key to verify with.\n * @param data The signed data to verify.\n * @param signature The signature to verify.\n * @return True iff the signature is valid.\n */\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata signature\n ) external view override returns (bool) {\n return\n validateSignature(\n sha256(data),\n parseSignature(signature),\n parseKey(key)\n );\n }\n\n function parseSignature(\n bytes memory data\n ) internal pure returns (uint256[2] memory) {\n require(data.length == 64, \"Invalid p256 signature length\");\n return [uint256(data.readBytes32(0)), uint256(data.readBytes32(32))];\n }\n\n function parseKey(\n bytes memory data\n ) internal pure returns (uint256[2] memory) {\n require(data.length == 68, \"Invalid p256 key length\");\n return [uint256(data.readBytes32(4)), uint256(data.readBytes32(36))];\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSASHA1Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"../BytesUtils.sol\";\nimport \"./RSAVerify.sol\";\nimport \"@ensdomains/solsha1/contracts/SHA1.sol\";\n\n/**\n * @dev Implements the DNSSEC RSASHA1 algorithm.\n */\ncontract RSASHA1Algorithm is Algorithm {\n using BytesUtils for *;\n\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata sig\n ) external view override returns (bool) {\n bytes memory exponent;\n bytes memory modulus;\n\n uint16 exponentLen = uint16(key.readUint8(4));\n if (exponentLen != 0) {\n exponent = key.substring(5, exponentLen);\n modulus = key.substring(\n exponentLen + 5,\n key.length - exponentLen - 5\n );\n } else {\n exponentLen = key.readUint16(5);\n exponent = key.substring(7, exponentLen);\n modulus = key.substring(\n exponentLen + 7,\n key.length - exponentLen - 7\n );\n }\n\n // Recover the message from the signature\n bool ok;\n bytes memory result;\n (ok, result) = RSAVerify.rsarecover(modulus, exponent, sig);\n\n // Verify it ends with the hash of our data\n return ok && SHA1.sha1(data) == result.readBytes20(result.length - 20);\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSASHA256Algorithm.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Algorithm.sol\";\nimport \"../BytesUtils.sol\";\nimport \"./RSAVerify.sol\";\n\n/**\n * @dev Implements the DNSSEC RSASHA256 algorithm.\n */\ncontract RSASHA256Algorithm is Algorithm {\n using BytesUtils for *;\n\n function verify(\n bytes calldata key,\n bytes calldata data,\n bytes calldata sig\n ) external view override returns (bool) {\n bytes memory exponent;\n bytes memory modulus;\n\n uint16 exponentLen = uint16(key.readUint8(4));\n if (exponentLen != 0) {\n exponent = key.substring(5, exponentLen);\n modulus = key.substring(\n exponentLen + 5,\n key.length - exponentLen - 5\n );\n } else {\n exponentLen = key.readUint16(5);\n exponent = key.substring(7, exponentLen);\n modulus = key.substring(\n exponentLen + 7,\n key.length - exponentLen - 7\n );\n }\n\n // Recover the message from the signature\n bool ok;\n bytes memory result;\n (ok, result) = RSAVerify.rsarecover(modulus, exponent, sig);\n\n // Verify it ends with the hash of our data\n return ok && sha256(data) == result.readBytes32(result.length - 32);\n }\n}\n" + }, + "contracts/dnssec-oracle/algorithms/RSAVerify.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../BytesUtils.sol\";\nimport \"./ModexpPrecompile.sol\";\n\nlibrary RSAVerify {\n /**\n * @dev Recovers the input data from an RSA signature, returning the result in S.\n * @param N The RSA public modulus.\n * @param E The RSA public exponent.\n * @param S The signature to recover.\n * @return True if the recovery succeeded.\n */\n function rsarecover(\n bytes memory N,\n bytes memory E,\n bytes memory S\n ) internal view returns (bool, bytes memory) {\n return ModexpPrecompile.modexp(S, E, N);\n }\n}\n" + }, + "contracts/dnssec-oracle/BytesUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nlibrary BytesUtils {\n error OffsetOutOfBoundsError(uint256 offset, uint256 length);\n\n /*\n * @dev Returns the keccak-256 hash of a byte range.\n * @param self The byte string to hash.\n * @param offset The position to start hashing at.\n * @param len The number of bytes to hash.\n * @return The hash of the byte range.\n */\n function keccak(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(offset + len <= self.length);\n assembly {\n ret := keccak256(add(add(self, 32), offset), len)\n }\n }\n\n /*\n * @dev Returns a positive number if `other` comes lexicographically after\n * `self`, a negative number if it comes before, or zero if the\n * contents of the two bytes are equal.\n * @param self The first bytes to compare.\n * @param other The second bytes to compare.\n * @return The result of the comparison.\n */\n function compare(\n bytes memory self,\n bytes memory other\n ) internal pure returns (int256) {\n return compare(self, 0, self.length, other, 0, other.length);\n }\n\n /*\n * @dev Returns a positive number if `other` comes lexicographically after\n * `self`, a negative number if it comes before, or zero if the\n * contents of the two bytes are equal. Comparison is done per-rune,\n * on unicode codepoints.\n * @param self The first bytes to compare.\n * @param offset The offset of self.\n * @param len The length of self.\n * @param other The second bytes to compare.\n * @param otheroffset The offset of the other string.\n * @param otherlen The length of the other string.\n * @return The result of the comparison.\n */\n function compare(\n bytes memory self,\n uint256 offset,\n uint256 len,\n bytes memory other,\n uint256 otheroffset,\n uint256 otherlen\n ) internal pure returns (int256) {\n if (offset + len > self.length) {\n revert OffsetOutOfBoundsError(offset + len, self.length);\n }\n if (otheroffset + otherlen > other.length) {\n revert OffsetOutOfBoundsError(otheroffset + otherlen, other.length);\n }\n\n uint256 shortest = len;\n if (otherlen < len) shortest = otherlen;\n\n uint256 selfptr;\n uint256 otherptr;\n\n assembly {\n selfptr := add(self, add(offset, 32))\n otherptr := add(other, add(otheroffset, 32))\n }\n for (uint256 idx = 0; idx < shortest; idx += 32) {\n uint256 a;\n uint256 b;\n assembly {\n a := mload(selfptr)\n b := mload(otherptr)\n }\n if (a != b) {\n // Mask out irrelevant bytes and check again\n uint256 mask;\n if (shortest - idx >= 32) {\n mask = type(uint256).max;\n } else {\n mask = ~(2 ** (8 * (idx + 32 - shortest)) - 1);\n }\n int256 diff = int256(a & mask) - int256(b & mask);\n if (diff != 0) return diff;\n }\n selfptr += 32;\n otherptr += 32;\n }\n\n return int256(len) - int256(otherlen);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @param otherOffset The offset into the second byte range.\n * @param len The number of bytes to compare\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other,\n uint256 otherOffset,\n uint256 len\n ) internal pure returns (bool) {\n return keccak(self, offset, len) == keccak(other, otherOffset, len);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal with offsets.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @param otherOffset The offset into the second byte range.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other,\n uint256 otherOffset\n ) internal pure returns (bool) {\n return\n keccak(self, offset, self.length - offset) ==\n keccak(other, otherOffset, other.length - otherOffset);\n }\n\n /*\n * @dev Compares a range of 'self' to all of 'other' and returns True iff\n * they are equal.\n * @param self The first byte range to compare.\n * @param offset The offset into the first byte range.\n * @param other The second byte range to compare.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n uint256 offset,\n bytes memory other\n ) internal pure returns (bool) {\n return\n self.length == offset + other.length &&\n equals(self, offset, other, 0, other.length);\n }\n\n /*\n * @dev Returns true if the two byte ranges are equal.\n * @param self The first byte range to compare.\n * @param other The second byte range to compare.\n * @return True if the byte ranges are equal, false otherwise.\n */\n function equals(\n bytes memory self,\n bytes memory other\n ) internal pure returns (bool) {\n return\n self.length == other.length &&\n equals(self, 0, other, 0, self.length);\n }\n\n /*\n * @dev Returns the 8-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 8 bits of the string, interpreted as an integer.\n */\n function readUint8(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint8 ret) {\n return uint8(self[idx]);\n }\n\n /*\n * @dev Returns the 16-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 16 bits of the string, interpreted as an integer.\n */\n function readUint16(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint16 ret) {\n require(idx + 2 <= self.length);\n assembly {\n ret := and(mload(add(add(self, 2), idx)), 0xFFFF)\n }\n }\n\n /*\n * @dev Returns the 32-bit number at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bits of the string, interpreted as an integer.\n */\n function readUint32(\n bytes memory self,\n uint256 idx\n ) internal pure returns (uint32 ret) {\n require(idx + 4 <= self.length);\n assembly {\n ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF)\n }\n }\n\n /*\n * @dev Returns the 32 byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bytes of the string.\n */\n function readBytes32(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes32 ret) {\n require(idx + 32 <= self.length);\n assembly {\n ret := mload(add(add(self, 32), idx))\n }\n }\n\n /*\n * @dev Returns the 32 byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes\n * @return The specified 32 bytes of the string.\n */\n function readBytes20(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes20 ret) {\n require(idx + 20 <= self.length);\n assembly {\n ret := and(\n mload(add(add(self, 32), idx)),\n 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000\n )\n }\n }\n\n /*\n * @dev Returns the n byte value at the specified index of self.\n * @param self The byte string.\n * @param idx The index into the bytes.\n * @param len The number of bytes.\n * @return The specified 32 bytes of the string.\n */\n function readBytesN(\n bytes memory self,\n uint256 idx,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(len <= 32);\n require(idx + len <= self.length);\n assembly {\n let mask := not(sub(exp(256, sub(32, len)), 1))\n ret := and(mload(add(add(self, 32), idx)), mask)\n }\n }\n\n function memcpy(uint256 dest, uint256 src, uint256 len) private pure {\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint256 mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n }\n\n /*\n * @dev Copies a substring into a new byte string.\n * @param self The byte string to copy from.\n * @param offset The offset to start copying at.\n * @param len The number of bytes to copy.\n */\n function substring(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes memory) {\n require(offset + len <= self.length);\n\n bytes memory ret = new bytes(len);\n uint256 dest;\n uint256 src;\n\n assembly {\n dest := add(ret, 32)\n src := add(add(self, 32), offset)\n }\n memcpy(dest, src, len);\n\n return ret;\n }\n\n // Maps characters from 0x30 to 0x7A to their base32 values.\n // 0xFF represents invalid characters in that range.\n bytes constant base32HexTable =\n hex\"00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F\";\n\n /**\n * @dev Decodes unpadded base32 data of up to one word in length.\n * @param self The data to decode.\n * @param off Offset into the string to start at.\n * @param len Number of characters to decode.\n * @return The decoded data, left aligned.\n */\n function base32HexDecodeWord(\n bytes memory self,\n uint256 off,\n uint256 len\n ) internal pure returns (bytes32) {\n require(len <= 52);\n\n uint256 ret = 0;\n uint8 decoded;\n for (uint256 i = 0; i < len; i++) {\n bytes1 char = self[off + i];\n require(char >= 0x30 && char <= 0x7A);\n decoded = uint8(base32HexTable[uint256(uint8(char)) - 0x30]);\n require(decoded <= 0x20);\n if (i == len - 1) {\n break;\n }\n ret = (ret << 5) | decoded;\n }\n\n uint256 bitlen = len * 5;\n if (len % 8 == 0) {\n // Multiple of 8 characters, no padding\n ret = (ret << 5) | decoded;\n } else if (len % 8 == 2) {\n // Two extra characters - 1 byte\n ret = (ret << 3) | (decoded >> 2);\n bitlen -= 2;\n } else if (len % 8 == 4) {\n // Four extra characters - 2 bytes\n ret = (ret << 1) | (decoded >> 4);\n bitlen -= 4;\n } else if (len % 8 == 5) {\n // Five extra characters - 3 bytes\n ret = (ret << 4) | (decoded >> 1);\n bitlen -= 1;\n } else if (len % 8 == 7) {\n // Seven extra characters - 4 bytes\n ret = (ret << 2) | (decoded >> 3);\n bitlen -= 3;\n } else {\n revert();\n }\n\n return bytes32(ret << (256 - bitlen));\n }\n\n /**\n * @dev Finds the first occurrence of the byte `needle` in `self`.\n * @param self The string to search\n * @param off The offset to start searching at\n * @param len The number of bytes to search\n * @param needle The byte to search for\n * @return The offset of `needle` in `self`, or 2**256-1 if it was not found.\n */\n function find(\n bytes memory self,\n uint256 off,\n uint256 len,\n bytes1 needle\n ) internal pure returns (uint256) {\n for (uint256 idx = off; idx < off + len; idx++) {\n if (self[idx] == needle) {\n return idx;\n }\n }\n return type(uint256).max;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev An interface for contracts implementing a DNSSEC digest.\n */\ninterface Digest {\n /**\n * @dev Verifies a cryptographic hash.\n * @param data The data to hash.\n * @param hash The hash to compare to.\n * @return True iff the hashed data matches the provided hash value.\n */\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure virtual returns (bool);\n}\n" + }, + "contracts/dnssec-oracle/digests/DummyDigest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\n\n/**\n * @dev Implements a dummy DNSSEC digest that approves all hashes, for testing.\n */\ncontract DummyDigest is Digest {\n function verify(\n bytes calldata,\n bytes calldata\n ) external pure override returns (bool) {\n return true;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/SHA1Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\nimport \"../BytesUtils.sol\";\nimport \"@ensdomains/solsha1/contracts/SHA1.sol\";\n\n/**\n * @dev Implements the DNSSEC SHA1 digest.\n */\ncontract SHA1Digest is Digest {\n using BytesUtils for *;\n\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure override returns (bool) {\n require(hash.length == 20, \"Invalid sha1 hash length\");\n bytes32 expected = hash.readBytes20(0);\n bytes20 computed = SHA1.sha1(data);\n return expected == computed;\n }\n}\n" + }, + "contracts/dnssec-oracle/digests/SHA256Digest.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./Digest.sol\";\nimport \"../BytesUtils.sol\";\n\n/**\n * @dev Implements the DNSSEC SHA256 digest.\n */\ncontract SHA256Digest is Digest {\n using BytesUtils for *;\n\n function verify(\n bytes calldata data,\n bytes calldata hash\n ) external pure override returns (bool) {\n require(hash.length == 32, \"Invalid sha256 hash length\");\n return sha256(data) == hash.readBytes32(0);\n }\n}\n" + }, + "contracts/dnssec-oracle/DNSSEC.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nabstract contract DNSSEC {\n bytes public anchors;\n\n struct RRSetWithSignature {\n bytes rrset;\n bytes sig;\n }\n\n event AlgorithmUpdated(uint8 id, address addr);\n event DigestUpdated(uint8 id, address addr);\n\n function verifyRRSet(\n RRSetWithSignature[] memory input\n ) external view virtual returns (bytes memory rrs, uint32 inception);\n\n function verifyRRSet(\n RRSetWithSignature[] memory input,\n uint256 now\n ) public view virtual returns (bytes memory rrs, uint32 inception);\n}\n" + }, + "contracts/dnssec-oracle/DNSSECImpl.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\npragma experimental ABIEncoderV2;\n\nimport \"./Owned.sol\";\nimport \"./BytesUtils.sol\";\nimport \"./RRUtils.sol\";\nimport \"./DNSSEC.sol\";\nimport \"./algorithms/Algorithm.sol\";\nimport \"./digests/Digest.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\n/*\n * @dev An oracle contract that verifies and stores DNSSEC-validated DNS records.\n * @note This differs from the DNSSEC spec defined in RFC4034 and RFC4035 in some key regards:\n * - NSEC & NSEC3 are not supported; only positive proofs are allowed.\n * - Proofs involving wildcard names will not validate.\n * - TTLs on records are ignored, as data is not stored persistently.\n * - Canonical form of names is not checked; in ENS this is done on the frontend, so submitting\n * proofs with non-canonical names will only result in registering unresolvable ENS names.\n */\ncontract DNSSECImpl is DNSSEC, Owned {\n using Buffer for Buffer.buffer;\n using BytesUtils for bytes;\n using RRUtils for *;\n\n uint16 constant DNSCLASS_IN = 1;\n\n uint16 constant DNSTYPE_DS = 43;\n uint16 constant DNSTYPE_DNSKEY = 48;\n\n uint256 constant DNSKEY_FLAG_ZONEKEY = 0x100;\n\n error InvalidLabelCount(bytes name, uint256 labelsExpected);\n error SignatureNotValidYet(uint32 inception, uint32 now);\n error SignatureExpired(uint32 expiration, uint32 now);\n error InvalidClass(uint16 class);\n error InvalidRRSet();\n error SignatureTypeMismatch(uint16 rrsetType, uint16 sigType);\n error InvalidSignerName(bytes rrsetName, bytes signerName);\n error InvalidProofType(uint16 proofType);\n error ProofNameMismatch(bytes signerName, bytes proofName);\n error NoMatchingProof(bytes signerName);\n\n mapping(uint8 => Algorithm) public algorithms;\n mapping(uint8 => Digest) public digests;\n\n /**\n * @dev Constructor.\n * @param _anchors The binary format RR entries for the root DS records.\n */\n constructor(bytes memory _anchors) {\n // Insert the 'trust anchors' - the key hashes that start the chain\n // of trust for all other records.\n anchors = _anchors;\n }\n\n /**\n * @dev Sets the contract address for a signature verification algorithm.\n * Callable only by the owner.\n * @param id The algorithm ID\n * @param algo The address of the algorithm contract.\n */\n function setAlgorithm(uint8 id, Algorithm algo) public owner_only {\n algorithms[id] = algo;\n emit AlgorithmUpdated(id, address(algo));\n }\n\n /**\n * @dev Sets the contract address for a digest verification algorithm.\n * Callable only by the owner.\n * @param id The digest ID\n * @param digest The address of the digest contract.\n */\n function setDigest(uint8 id, Digest digest) public owner_only {\n digests[id] = digest;\n emit DigestUpdated(id, address(digest));\n }\n\n /**\n * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.\n * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.\n * @param input A list of signed RRSets.\n * @return rrs The RRData from the last RRSet in the chain.\n * @return inception The inception time of the signed record set.\n */\n function verifyRRSet(\n RRSetWithSignature[] memory input\n )\n external\n view\n virtual\n override\n returns (bytes memory rrs, uint32 inception)\n {\n return verifyRRSet(input, block.timestamp);\n }\n\n /**\n * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.\n * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.\n * @param input A list of signed RRSets.\n * @param now The Unix timestamp to validate the records at.\n * @return rrs The RRData from the last RRSet in the chain.\n * @return inception The inception time of the signed record set.\n */\n function verifyRRSet(\n RRSetWithSignature[] memory input,\n uint256 now\n )\n public\n view\n virtual\n override\n returns (bytes memory rrs, uint32 inception)\n {\n bytes memory proof = anchors;\n for (uint256 i = 0; i < input.length; i++) {\n RRUtils.SignedSet memory rrset = validateSignedSet(\n input[i],\n proof,\n now\n );\n proof = rrset.data;\n inception = rrset.inception;\n }\n return (proof, inception);\n }\n\n /**\n * @dev Validates an RRSet against the already trusted RR provided in `proof`.\n *\n * @param input The signed RR set. This is in the format described in section\n * 5.3.2 of RFC4035: The RRDATA section from the RRSIG without the signature\n * data, followed by a series of canonicalised RR records that the signature\n * applies to.\n * @param proof The DNSKEY or DS to validate the signature against.\n * @param now The current timestamp.\n */\n function validateSignedSet(\n RRSetWithSignature memory input,\n bytes memory proof,\n uint256 now\n ) internal view returns (RRUtils.SignedSet memory rrset) {\n rrset = input.rrset.readSignedSet();\n\n // Do some basic checks on the RRs and extract the name\n bytes memory name = validateRRs(rrset, rrset.typeCovered);\n if (name.labelCount(0) != rrset.labels) {\n revert InvalidLabelCount(name, rrset.labels);\n }\n rrset.name = name;\n\n // All comparisons involving the Signature Expiration and\n // Inception fields MUST use \"serial number arithmetic\", as\n // defined in RFC 1982\n\n // o The validator's notion of the current time MUST be less than or\n // equal to the time listed in the RRSIG RR's Expiration field.\n if (!RRUtils.serialNumberGte(rrset.expiration, uint32(now))) {\n revert SignatureExpired(rrset.expiration, uint32(now));\n }\n\n // o The validator's notion of the current time MUST be greater than or\n // equal to the time listed in the RRSIG RR's Inception field.\n if (!RRUtils.serialNumberGte(uint32(now), rrset.inception)) {\n revert SignatureNotValidYet(rrset.inception, uint32(now));\n }\n\n // Validate the signature\n verifySignature(name, rrset, input, proof);\n\n return rrset;\n }\n\n /**\n * @dev Validates a set of RRs.\n * @param rrset The RR set.\n * @param typecovered The type covered by the RRSIG record.\n */\n function validateRRs(\n RRUtils.SignedSet memory rrset,\n uint16 typecovered\n ) internal pure returns (bytes memory name) {\n // Iterate over all the RRs\n for (\n RRUtils.RRIterator memory iter = rrset.rrs();\n !iter.done();\n iter.next()\n ) {\n // We only support class IN (Internet)\n if (iter.class != DNSCLASS_IN) {\n revert InvalidClass(iter.class);\n }\n\n if (name.length == 0) {\n name = iter.name();\n } else {\n // Name must be the same on all RRs. We do things this way to avoid copying the name\n // repeatedly.\n if (\n name.length != iter.data.nameLength(iter.offset) ||\n !name.equals(0, iter.data, iter.offset, name.length)\n ) {\n revert InvalidRRSet();\n }\n }\n\n // o The RRSIG RR's Type Covered field MUST equal the RRset's type.\n if (iter.dnstype != typecovered) {\n revert SignatureTypeMismatch(iter.dnstype, typecovered);\n }\n }\n }\n\n /**\n * @dev Performs signature verification.\n *\n * Throws or reverts if unable to verify the record.\n *\n * @param name The name of the RRSIG record, in DNS label-sequence format.\n * @param data The original data to verify.\n * @param proof A DS or DNSKEY record that's already verified by the oracle.\n */\n function verifySignature(\n bytes memory name,\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n bytes memory proof\n ) internal view {\n // o The RRSIG RR's Signer's Name field MUST be the name of the zone\n // that contains the RRset.\n if (!name.isSubdomainOf(rrset.signerName)) {\n revert InvalidSignerName(name, rrset.signerName);\n }\n\n RRUtils.RRIterator memory proofRR = proof.iterateRRs(0);\n // Check the proof\n if (proofRR.dnstype == DNSTYPE_DS) {\n verifyWithDS(rrset, data, proofRR);\n } else if (proofRR.dnstype == DNSTYPE_DNSKEY) {\n verifyWithKnownKey(rrset, data, proofRR);\n } else {\n revert InvalidProofType(proofRR.dnstype);\n }\n }\n\n /**\n * @dev Attempts to verify a signed RRSET against an already known public key.\n * @param rrset The signed set to verify.\n * @param data The original data the signed set was read from.\n * @param proof The serialized DS or DNSKEY record to use as proof.\n */\n function verifyWithKnownKey(\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n RRUtils.RRIterator memory proof\n ) internal view {\n // Check the DNSKEY's owner name matches the signer name on the RRSIG\n for (; !proof.done(); proof.next()) {\n bytes memory proofName = proof.name();\n if (!proofName.equals(rrset.signerName)) {\n revert ProofNameMismatch(rrset.signerName, proofName);\n }\n\n bytes memory keyrdata = proof.rdata();\n RRUtils.DNSKEY memory dnskey = keyrdata.readDNSKEY(\n 0,\n keyrdata.length\n );\n if (verifySignatureWithKey(dnskey, keyrdata, rrset, data)) {\n return;\n }\n }\n revert NoMatchingProof(rrset.signerName);\n }\n\n /**\n * @dev Attempts to verify some data using a provided key and a signature.\n * @param dnskey The dns key record to verify the signature with.\n * @param rrset The signed RRSET being verified.\n * @param data The original data `rrset` was decoded from.\n * @return True iff the key verifies the signature.\n */\n function verifySignatureWithKey(\n RRUtils.DNSKEY memory dnskey,\n bytes memory keyrdata,\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data\n ) internal view returns (bool) {\n // TODO: Check key isn't expired, unless updating key itself\n\n // The Protocol Field MUST have value 3 (RFC4034 2.1.2)\n if (dnskey.protocol != 3) {\n return false;\n }\n\n // o The RRSIG RR's Signer's Name, Algorithm, and Key Tag fields MUST\n // match the owner name, algorithm, and key tag for some DNSKEY RR in\n // the zone's apex DNSKEY RRset.\n if (dnskey.algorithm != rrset.algorithm) {\n return false;\n }\n uint16 computedkeytag = keyrdata.computeKeytag();\n if (computedkeytag != rrset.keytag) {\n return false;\n }\n\n // o The matching DNSKEY RR MUST be present in the zone's apex DNSKEY\n // RRset, and MUST have the Zone Flag bit (DNSKEY RDATA Flag bit 7)\n // set.\n if (dnskey.flags & DNSKEY_FLAG_ZONEKEY == 0) {\n return false;\n }\n\n Algorithm algorithm = algorithms[dnskey.algorithm];\n if (address(algorithm) == address(0)) {\n return false;\n }\n return algorithm.verify(keyrdata, data.rrset, data.sig);\n }\n\n /**\n * @dev Attempts to verify a signed RRSET against an already known hash. This function assumes\n * that the record\n * @param rrset The signed set to verify.\n * @param data The original data the signed set was read from.\n * @param proof The serialized DS or DNSKEY record to use as proof.\n */\n function verifyWithDS(\n RRUtils.SignedSet memory rrset,\n RRSetWithSignature memory data,\n RRUtils.RRIterator memory proof\n ) internal view {\n uint256 proofOffset = proof.offset;\n for (\n RRUtils.RRIterator memory iter = rrset.rrs();\n !iter.done();\n iter.next()\n ) {\n if (iter.dnstype != DNSTYPE_DNSKEY) {\n revert InvalidProofType(iter.dnstype);\n }\n\n bytes memory keyrdata = iter.rdata();\n RRUtils.DNSKEY memory dnskey = keyrdata.readDNSKEY(\n 0,\n keyrdata.length\n );\n if (verifySignatureWithKey(dnskey, keyrdata, rrset, data)) {\n // It's self-signed - look for a DS record to verify it.\n if (\n verifyKeyWithDS(rrset.signerName, proof, dnskey, keyrdata)\n ) {\n return;\n }\n // Rewind proof iterator to the start for the next loop iteration.\n proof.nextOffset = proofOffset;\n proof.next();\n }\n }\n revert NoMatchingProof(rrset.signerName);\n }\n\n /**\n * @dev Attempts to verify a key using DS records.\n * @param keyname The DNS name of the key, in DNS label-sequence format.\n * @param dsrrs The DS records to use in verification.\n * @param dnskey The dnskey to verify.\n * @param keyrdata The RDATA section of the key.\n * @return True if a DS record verifies this key.\n */\n function verifyKeyWithDS(\n bytes memory keyname,\n RRUtils.RRIterator memory dsrrs,\n RRUtils.DNSKEY memory dnskey,\n bytes memory keyrdata\n ) internal view returns (bool) {\n uint16 keytag = keyrdata.computeKeytag();\n for (; !dsrrs.done(); dsrrs.next()) {\n bytes memory proofName = dsrrs.name();\n if (!proofName.equals(keyname)) {\n revert ProofNameMismatch(keyname, proofName);\n }\n\n RRUtils.DS memory ds = dsrrs.data.readDS(\n dsrrs.rdataOffset,\n dsrrs.nextOffset - dsrrs.rdataOffset\n );\n if (ds.keytag != keytag) {\n continue;\n }\n if (ds.algorithm != dnskey.algorithm) {\n continue;\n }\n\n Buffer.buffer memory buf;\n buf.init(keyname.length + keyrdata.length);\n buf.append(keyname);\n buf.append(keyrdata);\n if (verifyDSHash(ds.digestType, buf.buf, ds.digest)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @dev Attempts to verify a DS record's hash value against some data.\n * @param digesttype The digest ID from the DS record.\n * @param data The data to digest.\n * @param digest The digest data to check against.\n * @return True iff the digest matches.\n */\n function verifyDSHash(\n uint8 digesttype,\n bytes memory data,\n bytes memory digest\n ) internal view returns (bool) {\n if (address(digests[digesttype]) == address(0)) {\n return false;\n }\n return digests[digesttype].verify(data, digest);\n }\n}\n" + }, + "contracts/dnssec-oracle/Owned.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev Contract mixin for 'owned' contracts.\n */\ncontract Owned {\n address public owner;\n\n modifier owner_only() {\n require(msg.sender == owner);\n _;\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function setOwner(address newOwner) public owner_only {\n owner = newOwner;\n }\n}\n" + }, + "contracts/dnssec-oracle/RRUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"./BytesUtils.sol\";\nimport \"@ensdomains/buffer/contracts/Buffer.sol\";\n\n/**\n * @dev RRUtils is a library that provides utilities for parsing DNS resource records.\n */\nlibrary RRUtils {\n using BytesUtils for *;\n using Buffer for *;\n\n /**\n * @dev Returns the number of bytes in the DNS name at 'offset' in 'self'.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return The length of the DNS name at 'offset', in bytes.\n */\n function nameLength(\n bytes memory self,\n uint256 offset\n ) internal pure returns (uint256) {\n uint256 idx = offset;\n while (true) {\n assert(idx < self.length);\n uint256 labelLen = self.readUint8(idx);\n idx += labelLen + 1;\n if (labelLen == 0) {\n break;\n }\n }\n return idx - offset;\n }\n\n /**\n * @dev Returns a DNS format name at the specified offset of self.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return ret The name.\n */\n function readName(\n bytes memory self,\n uint256 offset\n ) internal pure returns (bytes memory ret) {\n uint256 len = nameLength(self, offset);\n return self.substring(offset, len);\n }\n\n /**\n * @dev Returns the number of labels in the DNS name at 'offset' in 'self'.\n * @param self The byte array to read a name from.\n * @param offset The offset to start reading at.\n * @return The number of labels in the DNS name at 'offset', in bytes.\n */\n function labelCount(\n bytes memory self,\n uint256 offset\n ) internal pure returns (uint256) {\n uint256 count = 0;\n while (true) {\n assert(offset < self.length);\n uint256 labelLen = self.readUint8(offset);\n offset += labelLen + 1;\n if (labelLen == 0) {\n break;\n }\n count += 1;\n }\n return count;\n }\n\n uint256 constant RRSIG_TYPE = 0;\n uint256 constant RRSIG_ALGORITHM = 2;\n uint256 constant RRSIG_LABELS = 3;\n uint256 constant RRSIG_TTL = 4;\n uint256 constant RRSIG_EXPIRATION = 8;\n uint256 constant RRSIG_INCEPTION = 12;\n uint256 constant RRSIG_KEY_TAG = 16;\n uint256 constant RRSIG_SIGNER_NAME = 18;\n\n struct SignedSet {\n uint16 typeCovered;\n uint8 algorithm;\n uint8 labels;\n uint32 ttl;\n uint32 expiration;\n uint32 inception;\n uint16 keytag;\n bytes signerName;\n bytes data;\n bytes name;\n }\n\n function readSignedSet(\n bytes memory data\n ) internal pure returns (SignedSet memory self) {\n self.typeCovered = data.readUint16(RRSIG_TYPE);\n self.algorithm = data.readUint8(RRSIG_ALGORITHM);\n self.labels = data.readUint8(RRSIG_LABELS);\n self.ttl = data.readUint32(RRSIG_TTL);\n self.expiration = data.readUint32(RRSIG_EXPIRATION);\n self.inception = data.readUint32(RRSIG_INCEPTION);\n self.keytag = data.readUint16(RRSIG_KEY_TAG);\n self.signerName = readName(data, RRSIG_SIGNER_NAME);\n self.data = data.substring(\n RRSIG_SIGNER_NAME + self.signerName.length,\n data.length - RRSIG_SIGNER_NAME - self.signerName.length\n );\n }\n\n function rrs(\n SignedSet memory rrset\n ) internal pure returns (RRIterator memory) {\n return iterateRRs(rrset.data, 0);\n }\n\n /**\n * @dev An iterator over resource records.\n */\n struct RRIterator {\n bytes data;\n uint256 offset;\n uint16 dnstype;\n uint16 class;\n uint32 ttl;\n uint256 rdataOffset;\n uint256 nextOffset;\n }\n\n /**\n * @dev Begins iterating over resource records.\n * @param self The byte string to read from.\n * @param offset The offset to start reading at.\n * @return ret An iterator object.\n */\n function iterateRRs(\n bytes memory self,\n uint256 offset\n ) internal pure returns (RRIterator memory ret) {\n ret.data = self;\n ret.nextOffset = offset;\n next(ret);\n }\n\n /**\n * @dev Returns true iff there are more RRs to iterate.\n * @param iter The iterator to check.\n * @return True iff the iterator has finished.\n */\n function done(RRIterator memory iter) internal pure returns (bool) {\n return iter.offset >= iter.data.length;\n }\n\n /**\n * @dev Moves the iterator to the next resource record.\n * @param iter The iterator to advance.\n */\n function next(RRIterator memory iter) internal pure {\n iter.offset = iter.nextOffset;\n if (iter.offset >= iter.data.length) {\n return;\n }\n\n // Skip the name\n uint256 off = iter.offset + nameLength(iter.data, iter.offset);\n\n // Read type, class, and ttl\n iter.dnstype = iter.data.readUint16(off);\n off += 2;\n iter.class = iter.data.readUint16(off);\n off += 2;\n iter.ttl = iter.data.readUint32(off);\n off += 4;\n\n // Read the rdata\n uint256 rdataLength = iter.data.readUint16(off);\n off += 2;\n iter.rdataOffset = off;\n iter.nextOffset = off + rdataLength;\n }\n\n /**\n * @dev Returns the name of the current record.\n * @param iter The iterator.\n * @return A new bytes object containing the owner name from the RR.\n */\n function name(RRIterator memory iter) internal pure returns (bytes memory) {\n return\n iter.data.substring(\n iter.offset,\n nameLength(iter.data, iter.offset)\n );\n }\n\n /**\n * @dev Returns the rdata portion of the current record.\n * @param iter The iterator.\n * @return A new bytes object containing the RR's RDATA.\n */\n function rdata(\n RRIterator memory iter\n ) internal pure returns (bytes memory) {\n return\n iter.data.substring(\n iter.rdataOffset,\n iter.nextOffset - iter.rdataOffset\n );\n }\n\n uint256 constant DNSKEY_FLAGS = 0;\n uint256 constant DNSKEY_PROTOCOL = 2;\n uint256 constant DNSKEY_ALGORITHM = 3;\n uint256 constant DNSKEY_PUBKEY = 4;\n\n struct DNSKEY {\n uint16 flags;\n uint8 protocol;\n uint8 algorithm;\n bytes publicKey;\n }\n\n function readDNSKEY(\n bytes memory data,\n uint256 offset,\n uint256 length\n ) internal pure returns (DNSKEY memory self) {\n self.flags = data.readUint16(offset + DNSKEY_FLAGS);\n self.protocol = data.readUint8(offset + DNSKEY_PROTOCOL);\n self.algorithm = data.readUint8(offset + DNSKEY_ALGORITHM);\n self.publicKey = data.substring(\n offset + DNSKEY_PUBKEY,\n length - DNSKEY_PUBKEY\n );\n }\n\n uint256 constant DS_KEY_TAG = 0;\n uint256 constant DS_ALGORITHM = 2;\n uint256 constant DS_DIGEST_TYPE = 3;\n uint256 constant DS_DIGEST = 4;\n\n struct DS {\n uint16 keytag;\n uint8 algorithm;\n uint8 digestType;\n bytes digest;\n }\n\n function readDS(\n bytes memory data,\n uint256 offset,\n uint256 length\n ) internal pure returns (DS memory self) {\n self.keytag = data.readUint16(offset + DS_KEY_TAG);\n self.algorithm = data.readUint8(offset + DS_ALGORITHM);\n self.digestType = data.readUint8(offset + DS_DIGEST_TYPE);\n self.digest = data.substring(offset + DS_DIGEST, length - DS_DIGEST);\n }\n\n function isSubdomainOf(\n bytes memory self,\n bytes memory other\n ) internal pure returns (bool) {\n uint256 off = 0;\n uint256 counts = labelCount(self, 0);\n uint256 othercounts = labelCount(other, 0);\n\n while (counts > othercounts) {\n off = progress(self, off);\n counts--;\n }\n\n return self.equals(off, other, 0);\n }\n\n function compareNames(\n bytes memory self,\n bytes memory other\n ) internal pure returns (int256) {\n if (self.equals(other)) {\n return 0;\n }\n\n uint256 off;\n uint256 otheroff;\n uint256 prevoff;\n uint256 otherprevoff;\n uint256 counts = labelCount(self, 0);\n uint256 othercounts = labelCount(other, 0);\n\n // Keep removing labels from the front of the name until both names are equal length\n while (counts > othercounts) {\n prevoff = off;\n off = progress(self, off);\n counts--;\n }\n\n while (othercounts > counts) {\n otherprevoff = otheroff;\n otheroff = progress(other, otheroff);\n othercounts--;\n }\n\n // Compare the last nonequal labels to each other\n while (counts > 0 && !self.equals(off, other, otheroff)) {\n prevoff = off;\n off = progress(self, off);\n otherprevoff = otheroff;\n otheroff = progress(other, otheroff);\n counts -= 1;\n }\n\n if (off == 0) {\n return -1;\n }\n if (otheroff == 0) {\n return 1;\n }\n\n return\n self.compare(\n prevoff + 1,\n self.readUint8(prevoff),\n other,\n otherprevoff + 1,\n other.readUint8(otherprevoff)\n );\n }\n\n /**\n * @dev Compares two serial numbers using RFC1982 serial number math.\n */\n function serialNumberGte(\n uint32 i1,\n uint32 i2\n ) internal pure returns (bool) {\n unchecked {\n return int32(i1) - int32(i2) >= 0;\n }\n }\n\n function progress(\n bytes memory body,\n uint256 off\n ) internal pure returns (uint256) {\n return off + 1 + body.readUint8(off);\n }\n\n /**\n * @dev Computes the keytag for a chunk of data.\n * @param data The data to compute a keytag for.\n * @return The computed key tag.\n */\n function computeKeytag(bytes memory data) internal pure returns (uint16) {\n /* This function probably deserves some explanation.\n * The DNSSEC keytag function is a checksum that relies on summing up individual bytes\n * from the input string, with some mild bitshifting. Here's a Naive solidity implementation:\n *\n * function computeKeytag(bytes memory data) internal pure returns (uint16) {\n * uint ac;\n * for (uint i = 0; i < data.length; i++) {\n * ac += i & 1 == 0 ? uint16(data.readUint8(i)) << 8 : data.readUint8(i);\n * }\n * return uint16(ac + (ac >> 16));\n * }\n *\n * The EVM, with its 256 bit words, is exceedingly inefficient at doing byte-by-byte operations;\n * the code above, on reasonable length inputs, consumes over 100k gas. But we can make the EVM's\n * large words work in our favour.\n *\n * The code below works by treating the input as a series of 256 bit words. It first masks out\n * even and odd bytes from each input word, adding them to two separate accumulators `ac1` and `ac2`.\n * The bytes are separated by empty bytes, so as long as no individual sum exceeds 2^16-1, we're\n * effectively summing 16 different numbers with each EVM ADD opcode.\n *\n * Once it's added up all the inputs, it has to add all the 16 bit values in `ac1` and `ac2` together.\n * It does this using the same trick - mask out every other value, shift to align them, add them together.\n * After the first addition on both accumulators, there's enough room to add the two accumulators together,\n * and the remaining sums can be done just on ac1.\n */\n unchecked {\n require(data.length <= 8192, \"Long keys not permitted\");\n uint256 ac1;\n uint256 ac2;\n for (uint256 i = 0; i < data.length + 31; i += 32) {\n uint256 word;\n assembly {\n word := mload(add(add(data, 32), i))\n }\n if (i + 32 > data.length) {\n uint256 unused = 256 - (data.length - i) * 8;\n word = (word >> unused) << unused;\n }\n ac1 +=\n (word &\n 0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00) >>\n 8;\n ac2 += (word &\n 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF);\n }\n ac1 =\n (ac1 &\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\n ((ac1 &\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\n 16);\n ac2 =\n (ac2 &\n 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) +\n ((ac2 &\n 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000) >>\n 16);\n ac1 = (ac1 << 8) + ac2;\n ac1 =\n (ac1 &\n 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) +\n ((ac1 &\n 0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000) >>\n 32);\n ac1 =\n (ac1 &\n 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) +\n ((ac1 &\n 0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000) >>\n 64);\n ac1 =\n (ac1 &\n 0x00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) +\n (ac1 >> 128);\n ac1 += (ac1 >> 16) & 0xFFFF;\n return uint16(ac1);\n }\n }\n}\n" + }, + "contracts/dnssec-oracle/SHA1.sol": { + "content": "pragma solidity >=0.8.4;\n\nlibrary SHA1 {\n event Debug(bytes32 x);\n\n function sha1(bytes memory data) internal pure returns (bytes20 ret) {\n assembly {\n // Get a safe scratch location\n let scratch := mload(0x40)\n\n // Get the data length, and point data at the first byte\n let len := mload(data)\n data := add(data, 32)\n\n // Find the length after padding\n let totallen := add(and(add(len, 1), 0xFFFFFFFFFFFFFFC0), 64)\n switch lt(sub(totallen, len), 9)\n case 1 {\n totallen := add(totallen, 64)\n }\n\n let h := 0x6745230100EFCDAB890098BADCFE001032547600C3D2E1F0\n\n function readword(ptr, off, count) -> result {\n result := 0\n if lt(off, count) {\n result := mload(add(ptr, off))\n count := sub(count, off)\n if lt(count, 32) {\n let mask := not(sub(exp(256, sub(32, count)), 1))\n result := and(result, mask)\n }\n }\n }\n\n for {\n let i := 0\n } lt(i, totallen) {\n i := add(i, 64)\n } {\n mstore(scratch, readword(data, i, len))\n mstore(add(scratch, 32), readword(data, add(i, 32), len))\n\n // If we loaded the last byte, store the terminator byte\n switch lt(sub(len, i), 64)\n case 1 {\n mstore8(add(scratch, sub(len, i)), 0x80)\n }\n\n // If this is the last block, store the length\n switch eq(i, sub(totallen, 64))\n case 1 {\n mstore(\n add(scratch, 32),\n or(mload(add(scratch, 32)), mul(len, 8))\n )\n }\n\n // Expand the 16 32-bit words into 80\n for {\n let j := 64\n } lt(j, 128) {\n j := add(j, 12)\n } {\n let temp := xor(\n xor(\n mload(add(scratch, sub(j, 12))),\n mload(add(scratch, sub(j, 32)))\n ),\n xor(\n mload(add(scratch, sub(j, 56))),\n mload(add(scratch, sub(j, 64)))\n )\n )\n temp := or(\n and(\n mul(temp, 2),\n 0xFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFE\n ),\n and(\n div(temp, 0x80000000),\n 0x0000000100000001000000010000000100000001000000010000000100000001\n )\n )\n mstore(add(scratch, j), temp)\n }\n for {\n let j := 128\n } lt(j, 320) {\n j := add(j, 24)\n } {\n let temp := xor(\n xor(\n mload(add(scratch, sub(j, 24))),\n mload(add(scratch, sub(j, 64)))\n ),\n xor(\n mload(add(scratch, sub(j, 112))),\n mload(add(scratch, sub(j, 128)))\n )\n )\n temp := or(\n and(\n mul(temp, 4),\n 0xFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFCFFFFFFFC\n ),\n and(\n div(temp, 0x40000000),\n 0x0000000300000003000000030000000300000003000000030000000300000003\n )\n )\n mstore(add(scratch, j), temp)\n }\n\n let x := h\n let f := 0\n let k := 0\n for {\n let j := 0\n } lt(j, 80) {\n j := add(j, 1)\n } {\n switch div(j, 20)\n case 0 {\n // f = d xor (b and (c xor d))\n f := xor(\n div(x, 0x100000000000000000000),\n div(x, 0x10000000000)\n )\n f := and(div(x, 0x1000000000000000000000000000000), f)\n f := xor(div(x, 0x10000000000), f)\n k := 0x5A827999\n }\n case 1 {\n // f = b xor c xor d\n f := xor(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := xor(div(x, 0x10000000000), f)\n k := 0x6ED9EBA1\n }\n case 2 {\n // f = (b and c) or (d and (b or c))\n f := or(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := and(div(x, 0x10000000000), f)\n f := or(\n and(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n ),\n f\n )\n k := 0x8F1BBCDC\n }\n case 3 {\n // f = b xor c xor d\n f := xor(\n div(x, 0x1000000000000000000000000000000),\n div(x, 0x100000000000000000000)\n )\n f := xor(div(x, 0x10000000000), f)\n k := 0xCA62C1D6\n }\n // temp = (a leftrotate 5) + f + e + k + w[i]\n let temp := and(\n div(\n x,\n 0x80000000000000000000000000000000000000000000000\n ),\n 0x1F\n )\n temp := or(\n and(\n div(x, 0x800000000000000000000000000000000000000),\n 0xFFFFFFE0\n ),\n temp\n )\n temp := add(f, temp)\n temp := add(and(x, 0xFFFFFFFF), temp)\n temp := add(k, temp)\n temp := add(\n div(\n mload(add(scratch, mul(j, 4))),\n 0x100000000000000000000000000000000000000000000000000000000\n ),\n temp\n )\n x := or(\n div(x, 0x10000000000),\n mul(temp, 0x10000000000000000000000000000000000000000)\n )\n x := or(\n and(\n x,\n 0xFFFFFFFF00FFFFFFFF000000000000FFFFFFFF00FFFFFFFF\n ),\n mul(\n or(\n and(div(x, 0x4000000000000), 0xC0000000),\n and(div(x, 0x400000000000000000000), 0x3FFFFFFF)\n ),\n 0x100000000000000000000\n )\n )\n }\n\n h := and(\n add(h, x),\n 0xFFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF00FFFFFFFF\n )\n }\n ret := mul(\n or(\n or(\n or(\n or(\n and(\n div(h, 0x100000000),\n 0xFFFFFFFF00000000000000000000000000000000\n ),\n and(\n div(h, 0x1000000),\n 0xFFFFFFFF000000000000000000000000\n )\n ),\n and(div(h, 0x10000), 0xFFFFFFFF0000000000000000)\n ),\n and(div(h, 0x100), 0xFFFFFFFF00000000)\n ),\n and(h, 0xFFFFFFFF)\n ),\n 0x1000000000000000000000000\n )\n }\n }\n}\n" + }, + "contracts/ethregistrar/BaseRegistrarImplementation.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"./IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable {\n // A map of expiry times\n mapping(uint256 => uint256) expiries;\n // The ENS registry\n ENS public ens;\n // The namehash of the TLD this registrar owns (eg, .eth)\n bytes32 public baseNode;\n // A map of addresses that are authorised to register and renew names.\n mapping(address => bool) public controllers;\n uint256 public constant GRACE_PERIOD = 90 days;\n bytes4 private constant INTERFACE_META_ID =\n bytes4(keccak256(\"supportsInterface(bytes4)\"));\n bytes4 private constant ERC721_ID =\n bytes4(\n keccak256(\"balanceOf(address)\") ^\n keccak256(\"ownerOf(uint256)\") ^\n keccak256(\"approve(address,uint256)\") ^\n keccak256(\"getApproved(uint256)\") ^\n keccak256(\"setApprovalForAll(address,bool)\") ^\n keccak256(\"isApprovedForAll(address,address)\") ^\n keccak256(\"transferFrom(address,address,uint256)\") ^\n keccak256(\"safeTransferFrom(address,address,uint256)\") ^\n keccak256(\"safeTransferFrom(address,address,uint256,bytes)\")\n );\n bytes4 private constant RECLAIM_ID =\n bytes4(keccak256(\"reclaim(uint256,address)\"));\n\n /**\n * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);\n * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187\n * @dev Returns whether the given spender can transfer a given token ID\n * @param spender address of the spender to query\n * @param tokenId uint256 ID of the token to be transferred\n * @return bool whether the msg.sender is approved for the given token ID,\n * is an operator of the owner, or is the owner of the token\n */\n function _isApprovedOrOwner(\n address spender,\n uint256 tokenId\n ) internal view override returns (bool) {\n address owner = ownerOf(tokenId);\n return (spender == owner ||\n getApproved(tokenId) == spender ||\n isApprovedForAll(owner, spender));\n }\n\n constructor(ENS _ens, bytes32 _baseNode) ERC721(\"\", \"\") {\n ens = _ens;\n baseNode = _baseNode;\n }\n\n modifier live() {\n require(ens.owner(baseNode) == address(this));\n _;\n }\n\n modifier onlyController() {\n require(controllers[msg.sender]);\n _;\n }\n\n /**\n * @dev Gets the owner of the specified token ID. Names become unowned\n * when their registration expires.\n * @param tokenId uint256 ID of the token to query the owner of\n * @return address currently marked as the owner of the given token ID\n */\n function ownerOf(\n uint256 tokenId\n ) public view override(IERC721, ERC721) returns (address) {\n require(expiries[tokenId] > block.timestamp);\n return super.ownerOf(tokenId);\n }\n\n // Authorises a controller, who can register and renew domains.\n function addController(address controller) external override onlyOwner {\n controllers[controller] = true;\n emit ControllerAdded(controller);\n }\n\n // Revoke controller permission for an address.\n function removeController(address controller) external override onlyOwner {\n controllers[controller] = false;\n emit ControllerRemoved(controller);\n }\n\n // Set the resolver for the TLD this registrar manages.\n function setResolver(address resolver) external override onlyOwner {\n ens.setResolver(baseNode, resolver);\n }\n\n // Returns the expiration timestamp of the specified id.\n function nameExpires(uint256 id) external view override returns (uint256) {\n return expiries[id];\n }\n\n // Returns true iff the specified name is available for registration.\n function available(uint256 id) public view override returns (bool) {\n // Not available if it's registered here or in its grace period.\n return expiries[id] + GRACE_PERIOD < block.timestamp;\n }\n\n /**\n * @dev Register a name.\n * @param id The token ID (keccak256 of the label).\n * @param owner The address that should own the registration.\n * @param duration Duration in seconds for the registration.\n */\n function register(\n uint256 id,\n address owner,\n uint256 duration\n ) external override returns (uint256) {\n return _register(id, owner, duration, true);\n }\n\n /**\n * @dev Register a name, without modifying the registry.\n * @param id The token ID (keccak256 of the label).\n * @param owner The address that should own the registration.\n * @param duration Duration in seconds for the registration.\n */\n function registerOnly(\n uint256 id,\n address owner,\n uint256 duration\n ) external returns (uint256) {\n return _register(id, owner, duration, false);\n }\n\n function _register(\n uint256 id,\n address owner,\n uint256 duration,\n bool updateRegistry\n ) internal live onlyController returns (uint256) {\n require(available(id));\n require(\n block.timestamp + duration + GRACE_PERIOD >\n block.timestamp + GRACE_PERIOD\n ); // Prevent future overflow\n\n expiries[id] = block.timestamp + duration;\n if (_exists(id)) {\n // Name was previously owned, and expired\n _burn(id);\n }\n _mint(owner, id);\n if (updateRegistry) {\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\n }\n\n emit NameRegistered(id, owner, block.timestamp + duration);\n\n return block.timestamp + duration;\n }\n\n function renew(\n uint256 id,\n uint256 duration\n ) external override live onlyController returns (uint256) {\n require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period\n require(\n expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\n ); // Prevent future overflow\n\n expiries[id] += duration;\n emit NameRenewed(id, expiries[id]);\n return expiries[id];\n }\n\n /**\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\n */\n function reclaim(uint256 id, address owner) external override live {\n require(_isApprovedOrOwner(msg.sender, id));\n ens.setSubnodeOwner(baseNode, bytes32(id), owner);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view override(ERC721, IERC165) returns (bool) {\n return\n interfaceID == INTERFACE_META_ID ||\n interfaceID == ERC721_ID ||\n interfaceID == RECLAIM_ID;\n }\n}\n" + }, + "contracts/ethregistrar/BulkRenewal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../registry/ENS.sol\";\nimport \"./ETHRegistrarController.sol\";\nimport \"./IETHRegistrarController.sol\";\nimport \"../resolvers/Resolver.sol\";\nimport \"./IBulkRenewal.sol\";\nimport \"./IPriceOracle.sol\";\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract BulkRenewal is IBulkRenewal {\n bytes32 private constant ETH_NAMEHASH =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n\n constructor(ENS _ens) {\n ens = _ens;\n }\n\n function getController() internal view returns (ETHRegistrarController) {\n Resolver r = Resolver(ens.resolver(ETH_NAMEHASH));\n return\n ETHRegistrarController(\n r.interfaceImplementer(\n ETH_NAMEHASH,\n type(IETHRegistrarController).interfaceId\n )\n );\n }\n\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view override returns (uint256 total) {\n ETHRegistrarController controller = getController();\n uint256 length = names.length;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n unchecked {\n ++i;\n total += (price.base + price.premium);\n }\n }\n }\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable override {\n ETHRegistrarController controller = getController();\n uint256 length = names.length;\n uint256 total;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n uint256 totalPrice = price.base + price.premium;\n controller.renew{value: totalPrice}(names[i], duration);\n unchecked {\n ++i;\n total += totalPrice;\n }\n }\n // Send any excess funds back\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IBulkRenewal).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/DummyOracle.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyOracle {\n int256 value;\n\n constructor(int256 _value) public {\n set(_value);\n }\n\n function set(int256 _value) public {\n value = _value;\n }\n\n function latestAnswer() public view returns (int256) {\n return value;\n }\n}\n" + }, + "contracts/ethregistrar/ETHRegistrarController.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BaseRegistrarImplementation} from \"./BaseRegistrarImplementation.sol\";\nimport {StringUtils} from \"./StringUtils.sol\";\nimport {Resolver} from \"../resolvers/Resolver.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {ReverseRegistrar} from \"../reverseRegistrar/ReverseRegistrar.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {IETHRegistrarController, IPriceOracle} from \"./IETHRegistrarController.sol\";\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {INameWrapper} from \"../wrapper/INameWrapper.sol\";\nimport {ERC20Recoverable} from \"../utils/ERC20Recoverable.sol\";\n\nerror CommitmentTooNew(bytes32 commitment);\nerror CommitmentTooOld(bytes32 commitment);\nerror NameNotAvailable(string name);\nerror DurationTooShort(uint256 duration);\nerror ResolverRequiredWhenDataSupplied();\nerror UnexpiredCommitmentExists(bytes32 commitment);\nerror InsufficientValue();\nerror Unauthorised(bytes32 node);\nerror MaxCommitmentAgeTooLow();\nerror MaxCommitmentAgeTooHigh();\n\n/**\n * @dev A registrar controller for registering and renewing names at fixed cost.\n */\ncontract ETHRegistrarController is\n Ownable,\n IETHRegistrarController,\n IERC165,\n ERC20Recoverable,\n ReverseClaimer\n{\n using StringUtils for *;\n using Address for address;\n\n uint256 public constant MIN_REGISTRATION_DURATION = 28 days;\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n uint64 private constant MAX_EXPIRY = type(uint64).max;\n BaseRegistrarImplementation immutable base;\n IPriceOracle public immutable prices;\n uint256 public immutable minCommitmentAge;\n uint256 public immutable maxCommitmentAge;\n ReverseRegistrar public immutable reverseRegistrar;\n INameWrapper public immutable nameWrapper;\n\n mapping(bytes32 => uint256) public commitments;\n\n event NameRegistered(\n string name,\n bytes32 indexed label,\n address indexed owner,\n uint256 baseCost,\n uint256 premium,\n uint256 expires\n );\n event NameRenewed(\n string name,\n bytes32 indexed label,\n uint256 cost,\n uint256 expires\n );\n\n constructor(\n BaseRegistrarImplementation _base,\n IPriceOracle _prices,\n uint256 _minCommitmentAge,\n uint256 _maxCommitmentAge,\n ReverseRegistrar _reverseRegistrar,\n INameWrapper _nameWrapper,\n ENS _ens\n ) ReverseClaimer(_ens, msg.sender) {\n if (_maxCommitmentAge <= _minCommitmentAge) {\n revert MaxCommitmentAgeTooLow();\n }\n\n if (_maxCommitmentAge > block.timestamp) {\n revert MaxCommitmentAgeTooHigh();\n }\n\n base = _base;\n prices = _prices;\n minCommitmentAge = _minCommitmentAge;\n maxCommitmentAge = _maxCommitmentAge;\n reverseRegistrar = _reverseRegistrar;\n nameWrapper = _nameWrapper;\n }\n\n function rentPrice(\n string memory name,\n uint256 duration\n ) public view override returns (IPriceOracle.Price memory price) {\n bytes32 label = keccak256(bytes(name));\n price = prices.price(name, base.nameExpires(uint256(label)), duration);\n }\n\n function valid(string memory name) public pure returns (bool) {\n return name.strlen() >= 3;\n }\n\n function available(string memory name) public view override returns (bool) {\n bytes32 label = keccak256(bytes(name));\n return valid(name) && base.available(uint256(label));\n }\n\n function makeCommitment(\n string memory name,\n address owner,\n uint256 duration,\n bytes32 secret,\n address resolver,\n bytes[] calldata data,\n bool reverseRecord,\n uint16 ownerControlledFuses\n ) public pure override returns (bytes32) {\n bytes32 label = keccak256(bytes(name));\n if (data.length > 0 && resolver == address(0)) {\n revert ResolverRequiredWhenDataSupplied();\n }\n return\n keccak256(\n abi.encode(\n label,\n owner,\n duration,\n secret,\n resolver,\n data,\n reverseRecord,\n ownerControlledFuses\n )\n );\n }\n\n function commit(bytes32 commitment) public override {\n if (commitments[commitment] + maxCommitmentAge >= block.timestamp) {\n revert UnexpiredCommitmentExists(commitment);\n }\n commitments[commitment] = block.timestamp;\n }\n\n function register(\n string calldata name,\n address owner,\n uint256 duration,\n bytes32 secret,\n address resolver,\n bytes[] calldata data,\n bool reverseRecord,\n uint16 ownerControlledFuses\n ) public payable override {\n IPriceOracle.Price memory price = rentPrice(name, duration);\n if (msg.value < price.base + price.premium) {\n revert InsufficientValue();\n }\n\n _consumeCommitment(\n name,\n duration,\n makeCommitment(\n name,\n owner,\n duration,\n secret,\n resolver,\n data,\n reverseRecord,\n ownerControlledFuses\n )\n );\n\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\n name,\n owner,\n duration,\n resolver,\n ownerControlledFuses\n );\n\n if (data.length > 0) {\n _setRecords(resolver, keccak256(bytes(name)), data);\n }\n\n if (reverseRecord) {\n _setReverseRecord(name, resolver, msg.sender);\n }\n\n emit NameRegistered(\n name,\n keccak256(bytes(name)),\n owner,\n price.base,\n price.premium,\n expires\n );\n\n if (msg.value > (price.base + price.premium)) {\n payable(msg.sender).transfer(\n msg.value - (price.base + price.premium)\n );\n }\n }\n\n function renew(\n string calldata name,\n uint256 duration\n ) external payable override {\n bytes32 labelhash = keccak256(bytes(name));\n uint256 tokenId = uint256(labelhash);\n IPriceOracle.Price memory price = rentPrice(name, duration);\n if (msg.value < price.base) {\n revert InsufficientValue();\n }\n uint256 expires = nameWrapper.renew(tokenId, duration);\n\n if (msg.value > price.base) {\n payable(msg.sender).transfer(msg.value - price.base);\n }\n\n emit NameRenewed(name, labelhash, msg.value, expires);\n }\n\n function withdraw() public {\n payable(owner()).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IETHRegistrarController).interfaceId;\n }\n\n /* Internal functions */\n\n function _consumeCommitment(\n string memory name,\n uint256 duration,\n bytes32 commitment\n ) internal {\n // Require an old enough commitment.\n if (commitments[commitment] + minCommitmentAge > block.timestamp) {\n revert CommitmentTooNew(commitment);\n }\n\n // If the commitment is too old, or the name is registered, stop\n if (commitments[commitment] + maxCommitmentAge <= block.timestamp) {\n revert CommitmentTooOld(commitment);\n }\n if (!available(name)) {\n revert NameNotAvailable(name);\n }\n\n delete (commitments[commitment]);\n\n if (duration < MIN_REGISTRATION_DURATION) {\n revert DurationTooShort(duration);\n }\n }\n\n function _setRecords(\n address resolverAddress,\n bytes32 label,\n bytes[] calldata data\n ) internal {\n // use hardcoded .eth namehash\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, label));\n Resolver resolver = Resolver(resolverAddress);\n resolver.multicallWithNodeCheck(nodehash, data);\n }\n\n function _setReverseRecord(\n string memory name,\n address resolver,\n address owner\n ) internal {\n reverseRegistrar.setNameForAddr(\n msg.sender,\n owner,\n resolver,\n string.concat(name, \".eth\")\n );\n }\n}\n" + }, + "contracts/ethregistrar/ExponentialPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./StablePriceOracle.sol\";\n\ncontract ExponentialPremiumPriceOracle is StablePriceOracle {\n uint256 constant GRACE_PERIOD = 90 days;\n uint256 immutable startPremium;\n uint256 immutable endValue;\n\n constructor(\n AggregatorInterface _usdOracle,\n uint256[] memory _rentPrices,\n uint256 _startPremium,\n uint256 totalDays\n ) StablePriceOracle(_usdOracle, _rentPrices) {\n startPremium = _startPremium;\n endValue = _startPremium >> totalDays;\n }\n\n uint256 constant PRECISION = 1e18;\n uint256 constant bit1 = 999989423469314432; // 0.5 ^ 1/65536 * (10 ** 18)\n uint256 constant bit2 = 999978847050491904; // 0.5 ^ 2/65536 * (10 ** 18)\n uint256 constant bit3 = 999957694548431104;\n uint256 constant bit4 = 999915390886613504;\n uint256 constant bit5 = 999830788931929088;\n uint256 constant bit6 = 999661606496243712;\n uint256 constant bit7 = 999323327502650752;\n uint256 constant bit8 = 998647112890970240;\n uint256 constant bit9 = 997296056085470080;\n uint256 constant bit10 = 994599423483633152;\n uint256 constant bit11 = 989228013193975424;\n uint256 constant bit12 = 978572062087700096;\n uint256 constant bit13 = 957603280698573696;\n uint256 constant bit14 = 917004043204671232;\n uint256 constant bit15 = 840896415253714560;\n uint256 constant bit16 = 707106781186547584;\n\n /**\n * @dev Returns the pricing premium in internal base units.\n */\n function _premium(\n string memory,\n uint256 expires,\n uint256\n ) internal view override returns (uint256) {\n expires = expires + GRACE_PERIOD;\n if (expires > block.timestamp) {\n return 0;\n }\n\n uint256 elapsed = block.timestamp - expires;\n uint256 premium = decayedPremium(startPremium, elapsed);\n if (premium >= endValue) {\n return premium - endValue;\n }\n return 0;\n }\n\n /**\n * @dev Returns the premium price at current time elapsed\n * @param startPremium starting price\n * @param elapsed time past since expiry\n */\n function decayedPremium(\n uint256 startPremium,\n uint256 elapsed\n ) public pure returns (uint256) {\n uint256 daysPast = (elapsed * PRECISION) / 1 days;\n uint256 intDays = daysPast / PRECISION;\n uint256 premium = startPremium >> intDays;\n uint256 partDay = (daysPast - intDays * PRECISION);\n uint256 fraction = (partDay * (2 ** 16)) / PRECISION;\n uint256 totalPremium = addFractionalPremium(fraction, premium);\n return totalPremium;\n }\n\n function addFractionalPremium(\n uint256 fraction,\n uint256 premium\n ) internal pure returns (uint256) {\n if (fraction & (1 << 0) != 0) {\n premium = (premium * bit1) / PRECISION;\n }\n if (fraction & (1 << 1) != 0) {\n premium = (premium * bit2) / PRECISION;\n }\n if (fraction & (1 << 2) != 0) {\n premium = (premium * bit3) / PRECISION;\n }\n if (fraction & (1 << 3) != 0) {\n premium = (premium * bit4) / PRECISION;\n }\n if (fraction & (1 << 4) != 0) {\n premium = (premium * bit5) / PRECISION;\n }\n if (fraction & (1 << 5) != 0) {\n premium = (premium * bit6) / PRECISION;\n }\n if (fraction & (1 << 6) != 0) {\n premium = (premium * bit7) / PRECISION;\n }\n if (fraction & (1 << 7) != 0) {\n premium = (premium * bit8) / PRECISION;\n }\n if (fraction & (1 << 8) != 0) {\n premium = (premium * bit9) / PRECISION;\n }\n if (fraction & (1 << 9) != 0) {\n premium = (premium * bit10) / PRECISION;\n }\n if (fraction & (1 << 10) != 0) {\n premium = (premium * bit11) / PRECISION;\n }\n if (fraction & (1 << 11) != 0) {\n premium = (premium * bit12) / PRECISION;\n }\n if (fraction & (1 << 12) != 0) {\n premium = (premium * bit13) / PRECISION;\n }\n if (fraction & (1 << 13) != 0) {\n premium = (premium * bit14) / PRECISION;\n }\n if (fraction & (1 << 14) != 0) {\n premium = (premium * bit15) / PRECISION;\n }\n if (fraction & (1 << 15) != 0) {\n premium = (premium * bit16) / PRECISION;\n }\n return premium;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/ethregistrar/IBaseRegistrar.sol": { + "content": "import \"../registry/ENS.sol\";\nimport \"./IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\ninterface IBaseRegistrar is IERC721 {\n event ControllerAdded(address indexed controller);\n event ControllerRemoved(address indexed controller);\n event NameMigrated(\n uint256 indexed id,\n address indexed owner,\n uint256 expires\n );\n event NameRegistered(\n uint256 indexed id,\n address indexed owner,\n uint256 expires\n );\n event NameRenewed(uint256 indexed id, uint256 expires);\n\n // Authorises a controller, who can register and renew domains.\n function addController(address controller) external;\n\n // Revoke controller permission for an address.\n function removeController(address controller) external;\n\n // Set the resolver for the TLD this registrar manages.\n function setResolver(address resolver) external;\n\n // Returns the expiration timestamp of the specified label hash.\n function nameExpires(uint256 id) external view returns (uint256);\n\n // Returns true if the specified name is available for registration.\n function available(uint256 id) external view returns (bool);\n\n /**\n * @dev Register a name.\n */\n function register(\n uint256 id,\n address owner,\n uint256 duration\n ) external returns (uint256);\n\n function renew(uint256 id, uint256 duration) external returns (uint256);\n\n /**\n * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.\n */\n function reclaim(uint256 id, address owner) external;\n}\n" + }, + "contracts/ethregistrar/IBulkRenewal.sol": { + "content": "interface IBulkRenewal {\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view returns (uint256 total);\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable;\n}\n" + }, + "contracts/ethregistrar/IETHRegistrarController.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\n\ninterface IETHRegistrarController {\n function rentPrice(\n string memory,\n uint256\n ) external view returns (IPriceOracle.Price memory);\n\n function available(string memory) external returns (bool);\n\n function makeCommitment(\n string memory,\n address,\n uint256,\n bytes32,\n address,\n bytes[] calldata,\n bool,\n uint16\n ) external pure returns (bytes32);\n\n function commit(bytes32) external;\n\n function register(\n string calldata,\n address,\n uint256,\n bytes32,\n address,\n bytes[] calldata,\n bool,\n uint16\n ) external payable;\n\n function renew(string calldata, uint256) external payable;\n}\n" + }, + "contracts/ethregistrar/ILinearPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface ILinearPremiumPriceOracle {\n function timeUntilPremium(\n uint256 expires,\n uint256 amount\n ) external view returns (uint256);\n}\n" + }, + "contracts/ethregistrar/IPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\ninterface IPriceOracle {\n struct Price {\n uint256 base;\n uint256 premium;\n }\n\n /**\n * @dev Returns the price to register or renew a name.\n * @param name The name being registered or renewed.\n * @param expires When the name presently expires (0 if this is a new registration).\n * @param duration How long the name is being registered or extended for, in seconds.\n * @return base premium tuple of base price + premium price\n */\n function price(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view returns (Price calldata);\n}\n" + }, + "contracts/ethregistrar/LinearPremiumPriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./SafeMath.sol\";\nimport \"./StablePriceOracle.sol\";\n\ncontract LinearPremiumPriceOracle is StablePriceOracle {\n using SafeMath for *;\n\n uint256 immutable GRACE_PERIOD = 90 days;\n\n uint256 public immutable initialPremium;\n uint256 public immutable premiumDecreaseRate;\n\n bytes4 private constant TIME_UNTIL_PREMIUM_ID =\n bytes4(keccak256(\"timeUntilPremium(uint,uint\"));\n\n constructor(\n AggregatorInterface _usdOracle,\n uint256[] memory _rentPrices,\n uint256 _initialPremium,\n uint256 _premiumDecreaseRate\n ) public StablePriceOracle(_usdOracle, _rentPrices) {\n initialPremium = _initialPremium;\n premiumDecreaseRate = _premiumDecreaseRate;\n }\n\n function _premium(\n string memory name,\n uint256 expires,\n uint256 /*duration*/\n ) internal view override returns (uint256) {\n expires = expires.add(GRACE_PERIOD);\n if (expires > block.timestamp) {\n // No premium for renewals\n return 0;\n }\n\n // Calculate the discount off the maximum premium\n uint256 discount = premiumDecreaseRate.mul(\n block.timestamp.sub(expires)\n );\n\n // If we've run out the premium period, return 0.\n if (discount > initialPremium) {\n return 0;\n }\n\n return initialPremium - discount;\n }\n\n /**\n * @dev Returns the timestamp at which a name with the specified expiry date will have\n * the specified re-registration price premium.\n * @param expires The timestamp at which the name expires.\n * @param amount The amount, in wei, the caller is willing to pay\n * @return The timestamp at which the premium for this domain will be `amount`.\n */\n function timeUntilPremium(\n uint256 expires,\n uint256 amount\n ) external view returns (uint256) {\n amount = weiToAttoUSD(amount);\n require(amount <= initialPremium);\n\n expires = expires.add(GRACE_PERIOD);\n\n uint256 discount = initialPremium.sub(amount);\n uint256 duration = discount.div(premiumDecreaseRate);\n return expires.add(duration);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n (interfaceID == TIME_UNTIL_PREMIUM_ID) ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/ethregistrar/mocks/DummyProxyRegistry.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyProxyRegistry {\n address target;\n\n constructor(address _target) public {\n target = _target;\n }\n\n function proxies(address a) external view returns (address) {\n return target;\n }\n}\n" + }, + "contracts/ethregistrar/SafeMath.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\n/**\n * @title SafeMath\n * @dev Unsigned math operations with safety checks that revert on error\n */\nlibrary SafeMath {\n /**\n * @dev Multiplies two unsigned integers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two unsigned integers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),\n * reverts when dividing by zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0);\n return a % b;\n }\n}\n" + }, + "contracts/ethregistrar/StablePriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\nimport \"./StringUtils.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface AggregatorInterface {\n function latestAnswer() external view returns (int256);\n}\n\n// StablePriceOracle sets a price in USD, based on an oracle.\ncontract StablePriceOracle is IPriceOracle {\n using StringUtils for *;\n\n // Rent in base price units by length\n uint256 public immutable price1Letter;\n uint256 public immutable price2Letter;\n uint256 public immutable price3Letter;\n uint256 public immutable price4Letter;\n uint256 public immutable price5Letter;\n\n // Oracle address\n AggregatorInterface public immutable usdOracle;\n\n event RentPriceChanged(uint256[] prices);\n\n constructor(AggregatorInterface _usdOracle, uint256[] memory _rentPrices) {\n usdOracle = _usdOracle;\n price1Letter = _rentPrices[0];\n price2Letter = _rentPrices[1];\n price3Letter = _rentPrices[2];\n price4Letter = _rentPrices[3];\n price5Letter = _rentPrices[4];\n }\n\n function price(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view override returns (IPriceOracle.Price memory) {\n uint256 len = name.strlen();\n uint256 basePrice;\n\n if (len >= 5) {\n basePrice = price5Letter * duration;\n } else if (len == 4) {\n basePrice = price4Letter * duration;\n } else if (len == 3) {\n basePrice = price3Letter * duration;\n } else if (len == 2) {\n basePrice = price2Letter * duration;\n } else {\n basePrice = price1Letter * duration;\n }\n\n return\n IPriceOracle.Price({\n base: attoUSDToWei(basePrice),\n premium: attoUSDToWei(_premium(name, expires, duration))\n });\n }\n\n /**\n * @dev Returns the pricing premium in wei.\n */\n function premium(\n string calldata name,\n uint256 expires,\n uint256 duration\n ) external view returns (uint256) {\n return attoUSDToWei(_premium(name, expires, duration));\n }\n\n /**\n * @dev Returns the pricing premium in internal base units.\n */\n function _premium(\n string memory name,\n uint256 expires,\n uint256 duration\n ) internal view virtual returns (uint256) {\n return 0;\n }\n\n function attoUSDToWei(uint256 amount) internal view returns (uint256) {\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\n return (amount * 1e8) / ethPrice;\n }\n\n function weiToAttoUSD(uint256 amount) internal view returns (uint256) {\n uint256 ethPrice = uint256(usdOracle.latestAnswer());\n return (amount * ethPrice) / 1e8;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IPriceOracle).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/StaticBulkRenewal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./ETHRegistrarController.sol\";\nimport \"./IBulkRenewal.sol\";\nimport \"./IPriceOracle.sol\";\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ncontract StaticBulkRenewal is IBulkRenewal {\n ETHRegistrarController controller;\n\n constructor(ETHRegistrarController _controller) {\n controller = _controller;\n }\n\n function rentPrice(\n string[] calldata names,\n uint256 duration\n ) external view override returns (uint256 total) {\n uint256 length = names.length;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n unchecked {\n ++i;\n total += (price.base + price.premium);\n }\n }\n }\n\n function renewAll(\n string[] calldata names,\n uint256 duration\n ) external payable override {\n uint256 length = names.length;\n uint256 total;\n for (uint256 i = 0; i < length; ) {\n IPriceOracle.Price memory price = controller.rentPrice(\n names[i],\n duration\n );\n uint256 totalPrice = price.base + price.premium;\n controller.renew{value: totalPrice}(names[i], duration);\n unchecked {\n ++i;\n total += totalPrice;\n }\n }\n // Send any excess funds back\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IBulkRenewal).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/StringUtils.sol": { + "content": "pragma solidity >=0.8.4;\n\nlibrary StringUtils {\n /**\n * @dev Returns the length of a given string\n *\n * @param s The string to measure the length of\n * @return The length of the input string\n */\n function strlen(string memory s) internal pure returns (uint256) {\n uint256 len;\n uint256 i = 0;\n uint256 bytelength = bytes(s).length;\n for (len = 0; i < bytelength; len++) {\n bytes1 b = bytes(s)[i];\n if (b < 0x80) {\n i += 1;\n } else if (b < 0xE0) {\n i += 2;\n } else if (b < 0xF0) {\n i += 3;\n } else if (b < 0xF8) {\n i += 4;\n } else if (b < 0xFC) {\n i += 5;\n } else {\n i += 6;\n }\n }\n return len;\n }\n}\n" + }, + "contracts/ethregistrar/TestResolver.sol": { + "content": "pragma solidity >=0.8.4;\n\n/**\n * @dev A test resolver implementation\n */\ncontract TestResolver {\n mapping(bytes32 => address) addresses;\n\n constructor() public {}\n\n function supportsInterface(bytes4 interfaceID) public pure returns (bool) {\n return interfaceID == 0x01ffc9a7 || interfaceID == 0x3b3b57de;\n }\n\n function addr(bytes32 node) public view returns (address) {\n return addresses[node];\n }\n\n function setAddr(bytes32 node, address addr) public {\n addresses[node] = addr;\n }\n}\n" + }, + "contracts/registry/ENS.sol": { + "content": "pragma solidity >=0.8.4;\n\ninterface ENS {\n // Logged when the owner of a node assigns a new owner to a subnode.\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\n\n // Logged when the owner of a node transfers ownership to a new account.\n event Transfer(bytes32 indexed node, address owner);\n\n // Logged when the resolver for a node changes.\n event NewResolver(bytes32 indexed node, address resolver);\n\n // Logged when the TTL of a node changes\n event NewTTL(bytes32 indexed node, uint64 ttl);\n\n // Logged when an operator is added or removed.\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeRecord(\n bytes32 node,\n bytes32 label,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) external returns (bytes32);\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setOwner(bytes32 node, address owner) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function setApprovalForAll(address operator, bool approved) external;\n\n function owner(bytes32 node) external view returns (address);\n\n function resolver(bytes32 node) external view returns (address);\n\n function ttl(bytes32 node) external view returns (uint64);\n\n function recordExists(bytes32 node) external view returns (bool);\n\n function isApprovedForAll(\n address owner,\n address operator\n ) external view returns (bool);\n}\n" + }, + "contracts/registry/ENSRegistry.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * The ENS registry contract.\n */\ncontract ENSRegistry is ENS {\n struct Record {\n address owner;\n address resolver;\n uint64 ttl;\n }\n\n mapping(bytes32 => Record) records;\n mapping(address => mapping(address => bool)) operators;\n\n // Permits modifications only by the owner of the specified node.\n modifier authorised(bytes32 node) {\n address owner = records[node].owner;\n require(owner == msg.sender || operators[owner][msg.sender]);\n _;\n }\n\n /**\n * @dev Constructs a new ENS registry.\n */\n constructor() public {\n records[0x0].owner = msg.sender;\n }\n\n /**\n * @dev Sets the record for a node.\n * @param node The node to update.\n * @param owner The address of the new owner.\n * @param resolver The address of the resolver.\n * @param ttl The TTL in seconds.\n */\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external virtual override {\n setOwner(node, owner);\n _setResolverAndTTL(node, resolver, ttl);\n }\n\n /**\n * @dev Sets the record for a subnode.\n * @param node The parent node.\n * @param label The hash of the label specifying the subnode.\n * @param owner The address of the new owner.\n * @param resolver The address of the resolver.\n * @param ttl The TTL in seconds.\n */\n function setSubnodeRecord(\n bytes32 node,\n bytes32 label,\n address owner,\n address resolver,\n uint64 ttl\n ) external virtual override {\n bytes32 subnode = setSubnodeOwner(node, label, owner);\n _setResolverAndTTL(subnode, resolver, ttl);\n }\n\n /**\n * @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node.\n * @param node The node to transfer ownership of.\n * @param owner The address of the new owner.\n */\n function setOwner(\n bytes32 node,\n address owner\n ) public virtual override authorised(node) {\n _setOwner(node, owner);\n emit Transfer(node, owner);\n }\n\n /**\n * @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node.\n * @param node The parent node.\n * @param label The hash of the label specifying the subnode.\n * @param owner The address of the new owner.\n */\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) public virtual override authorised(node) returns (bytes32) {\n bytes32 subnode = keccak256(abi.encodePacked(node, label));\n _setOwner(subnode, owner);\n emit NewOwner(node, label, owner);\n return subnode;\n }\n\n /**\n * @dev Sets the resolver address for the specified node.\n * @param node The node to update.\n * @param resolver The address of the resolver.\n */\n function setResolver(\n bytes32 node,\n address resolver\n ) public virtual override authorised(node) {\n emit NewResolver(node, resolver);\n records[node].resolver = resolver;\n }\n\n /**\n * @dev Sets the TTL for the specified node.\n * @param node The node to update.\n * @param ttl The TTL in seconds.\n */\n function setTTL(\n bytes32 node,\n uint64 ttl\n ) public virtual override authorised(node) {\n emit NewTTL(node, ttl);\n records[node].ttl = ttl;\n }\n\n /**\n * @dev Enable or disable approval for a third party (\"operator\") to manage\n * all of `msg.sender`'s ENS records. Emits the ApprovalForAll event.\n * @param operator Address to add to the set of authorized operators.\n * @param approved True if the operator is approved, false to revoke approval.\n */\n function setApprovalForAll(\n address operator,\n bool approved\n ) external virtual override {\n operators[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev Returns the address that owns the specified node.\n * @param node The specified node.\n * @return address of the owner.\n */\n function owner(\n bytes32 node\n ) public view virtual override returns (address) {\n address addr = records[node].owner;\n if (addr == address(this)) {\n return address(0x0);\n }\n\n return addr;\n }\n\n /**\n * @dev Returns the address of the resolver for the specified node.\n * @param node The specified node.\n * @return address of the resolver.\n */\n function resolver(\n bytes32 node\n ) public view virtual override returns (address) {\n return records[node].resolver;\n }\n\n /**\n * @dev Returns the TTL of a node, and any records associated with it.\n * @param node The specified node.\n * @return ttl of the node.\n */\n function ttl(bytes32 node) public view virtual override returns (uint64) {\n return records[node].ttl;\n }\n\n /**\n * @dev Returns whether a record has been imported to the registry.\n * @param node The specified node.\n * @return Bool if record exists\n */\n function recordExists(\n bytes32 node\n ) public view virtual override returns (bool) {\n return records[node].owner != address(0x0);\n }\n\n /**\n * @dev Query if an address is an authorized operator for another address.\n * @param owner The address that owns the records.\n * @param operator The address that acts on behalf of the owner.\n * @return True if `operator` is an approved operator for `owner`, false otherwise.\n */\n function isApprovedForAll(\n address owner,\n address operator\n ) external view virtual override returns (bool) {\n return operators[owner][operator];\n }\n\n function _setOwner(bytes32 node, address owner) internal virtual {\n records[node].owner = owner;\n }\n\n function _setResolverAndTTL(\n bytes32 node,\n address resolver,\n uint64 ttl\n ) internal {\n if (resolver != records[node].resolver) {\n records[node].resolver = resolver;\n emit NewResolver(node, resolver);\n }\n\n if (ttl != records[node].ttl) {\n records[node].ttl = ttl;\n emit NewTTL(node, ttl);\n }\n }\n}\n" + }, + "contracts/registry/ENSRegistryWithFallback.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\nimport \"./ENSRegistry.sol\";\n\n/**\n * The ENS registry contract.\n */\ncontract ENSRegistryWithFallback is ENSRegistry {\n ENS public old;\n\n /**\n * @dev Constructs a new ENS registrar.\n */\n constructor(ENS _old) public ENSRegistry() {\n old = _old;\n }\n\n /**\n * @dev Returns the address of the resolver for the specified node.\n * @param node The specified node.\n * @return address of the resolver.\n */\n function resolver(bytes32 node) public view override returns (address) {\n if (!recordExists(node)) {\n return old.resolver(node);\n }\n\n return super.resolver(node);\n }\n\n /**\n * @dev Returns the address that owns the specified node.\n * @param node The specified node.\n * @return address of the owner.\n */\n function owner(bytes32 node) public view override returns (address) {\n if (!recordExists(node)) {\n return old.owner(node);\n }\n\n return super.owner(node);\n }\n\n /**\n * @dev Returns the TTL of a node, and any records associated with it.\n * @param node The specified node.\n * @return ttl of the node.\n */\n function ttl(bytes32 node) public view override returns (uint64) {\n if (!recordExists(node)) {\n return old.ttl(node);\n }\n\n return super.ttl(node);\n }\n\n function _setOwner(bytes32 node, address owner) internal override {\n address addr = owner;\n if (addr == address(0x0)) {\n addr = address(this);\n }\n\n super._setOwner(node, addr);\n }\n}\n" + }, + "contracts/registry/FIFSRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * A registrar that allocates subdomains to the first person to claim them.\n */\ncontract FIFSRegistrar {\n ENS ens;\n bytes32 rootNode;\n\n modifier only_owner(bytes32 label) {\n address currentOwner = ens.owner(\n keccak256(abi.encodePacked(rootNode, label))\n );\n require(currentOwner == address(0x0) || currentOwner == msg.sender);\n _;\n }\n\n /**\n * Constructor.\n * @param ensAddr The address of the ENS registry.\n * @param node The node that this registrar administers.\n */\n constructor(ENS ensAddr, bytes32 node) public {\n ens = ensAddr;\n rootNode = node;\n }\n\n /**\n * Register a name, or change the owner of an existing registration.\n * @param label The hash of the label to register.\n * @param owner The address of the new owner.\n */\n function register(bytes32 label, address owner) public only_owner(label) {\n ens.setSubnodeOwner(rootNode, label, owner);\n }\n}\n" + }, + "contracts/registry/TestRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./ENS.sol\";\n\n/**\n * A registrar that allocates subdomains to the first person to claim them, but\n * expires registrations a fixed period after they're initially claimed.\n */\ncontract TestRegistrar {\n uint256 constant registrationPeriod = 4 weeks;\n\n ENS public immutable ens;\n bytes32 public immutable rootNode;\n mapping(bytes32 => uint256) public expiryTimes;\n\n /**\n * Constructor.\n * @param ensAddr The address of the ENS registry.\n * @param node The node that this registrar administers.\n */\n constructor(ENS ensAddr, bytes32 node) {\n ens = ensAddr;\n rootNode = node;\n }\n\n /**\n * Register a name that's not currently registered\n * @param label The hash of the label to register.\n * @param owner The address of the new owner.\n */\n function register(bytes32 label, address owner) public {\n require(expiryTimes[label] < block.timestamp);\n\n expiryTimes[label] = block.timestamp + registrationPeriod;\n ens.setSubnodeOwner(rootNode, label, owner);\n }\n}\n" + }, + "contracts/resolvers/IMulticallable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IMulticallable {\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n function multicallWithNodeCheck(\n bytes32,\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n}\n" + }, + "contracts/resolvers/mocks/DummyNameWrapper.sol": { + "content": "pragma solidity ^0.8.4;\n\n/**\n * @dev Implements a dummy NameWrapper which returns the caller's address\n */\ncontract DummyNameWrapper {\n function ownerOf(uint256 /* id */) public view returns (address) {\n return tx.origin;\n }\n}\n" + }, + "contracts/resolvers/Multicallable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"./IMulticallable.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\nabstract contract Multicallable is IMulticallable, ERC165 {\n function _multicall(\n bytes32 nodehash,\n bytes[] calldata data\n ) internal returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n if (nodehash != bytes32(0)) {\n bytes32 txNamehash = bytes32(data[i][4:36]);\n require(\n txNamehash == nodehash,\n \"multicall: All records must have a matching namehash\"\n );\n }\n (bool success, bytes memory result) = address(this).delegatecall(\n data[i]\n );\n require(success);\n results[i] = result;\n }\n return results;\n }\n\n // This function provides an extra security check when called\n // from priviledged contracts (such as EthRegistrarController)\n // that can set records on behalf of the node owners\n function multicallWithNodeCheck(\n bytes32 nodehash,\n bytes[] calldata data\n ) external returns (bytes[] memory results) {\n return _multicall(nodehash, data);\n }\n\n function multicall(\n bytes[] calldata data\n ) public override returns (bytes[] memory results) {\n return _multicall(bytes32(0), data);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IMulticallable).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/OwnedResolver.sol": { + "content": "pragma solidity >=0.8.4;\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./profiles/ABIResolver.sol\";\nimport \"./profiles/AddrResolver.sol\";\nimport \"./profiles/ContentHashResolver.sol\";\nimport \"./profiles/DNSResolver.sol\";\nimport \"./profiles/InterfaceResolver.sol\";\nimport \"./profiles/NameResolver.sol\";\nimport \"./profiles/PubkeyResolver.sol\";\nimport \"./profiles/TextResolver.sol\";\nimport \"./profiles/ExtendedResolver.sol\";\n\n/**\n * A simple resolver anyone can use; only allows the owner of a node to set its\n * address.\n */\ncontract OwnedResolver is\n Ownable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver,\n ExtendedResolver\n{\n function isAuthorised(bytes32) internal view override returns (bool) {\n return msg.sender == owner();\n }\n\n function supportsInterface(\n bytes4 interfaceID\n )\n public\n view\n virtual\n override(\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver\n )\n returns (bool)\n {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/ABIResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"./IABIResolver.sol\";\nimport \"../ResolverBase.sol\";\n\nabstract contract ABIResolver is IABIResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_abis;\n\n /**\n * Sets the ABI associated with an ENS node.\n * Nodes may have one ABI of each content type. To remove an ABI, set it to\n * the empty string.\n * @param node The node to update.\n * @param contentType The content type of the ABI\n * @param data The ABI data.\n */\n function setABI(\n bytes32 node,\n uint256 contentType,\n bytes calldata data\n ) external virtual authorised(node) {\n // Content types must be powers of 2\n require(((contentType - 1) & contentType) == 0);\n\n versionable_abis[recordVersions[node]][node][contentType] = data;\n emit ABIChanged(node, contentType);\n }\n\n /**\n * Returns the ABI associated with an ENS node.\n * Defined in EIP205.\n * @param node The ENS node to query\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\n * @return contentType The content type of the return value\n * @return data The ABI data\n */\n function ABI(\n bytes32 node,\n uint256 contentTypes\n ) external view virtual override returns (uint256, bytes memory) {\n mapping(uint256 => bytes) storage abiset = versionable_abis[\n recordVersions[node]\n ][node];\n\n for (\n uint256 contentType = 1;\n contentType <= contentTypes;\n contentType <<= 1\n ) {\n if (\n (contentType & contentTypes) != 0 &&\n abiset[contentType].length > 0\n ) {\n return (contentType, abiset[contentType]);\n }\n }\n\n return (0, bytes(\"\"));\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IABIResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/AddrResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IAddrResolver.sol\";\nimport \"./IAddressResolver.sol\";\n\nabstract contract AddrResolver is\n IAddrResolver,\n IAddressResolver,\n ResolverBase\n{\n uint256 private constant COIN_TYPE_ETH = 60;\n\n mapping(uint64 => mapping(bytes32 => mapping(uint256 => bytes))) versionable_addresses;\n\n /**\n * Sets the address associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param a The address to set.\n */\n function setAddr(\n bytes32 node,\n address a\n ) external virtual authorised(node) {\n setAddr(node, COIN_TYPE_ETH, addressToBytes(a));\n }\n\n /**\n * Returns the address associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated address.\n */\n function addr(\n bytes32 node\n ) public view virtual override returns (address payable) {\n bytes memory a = addr(node, COIN_TYPE_ETH);\n if (a.length == 0) {\n return payable(0);\n }\n return bytesToAddress(a);\n }\n\n function setAddr(\n bytes32 node,\n uint256 coinType,\n bytes memory a\n ) public virtual authorised(node) {\n emit AddressChanged(node, coinType, a);\n if (coinType == COIN_TYPE_ETH) {\n emit AddrChanged(node, bytesToAddress(a));\n }\n versionable_addresses[recordVersions[node]][node][coinType] = a;\n }\n\n function addr(\n bytes32 node,\n uint256 coinType\n ) public view virtual override returns (bytes memory) {\n return versionable_addresses[recordVersions[node]][node][coinType];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IAddrResolver).interfaceId ||\n interfaceID == type(IAddressResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n\n function bytesToAddress(\n bytes memory b\n ) internal pure returns (address payable a) {\n require(b.length == 20);\n assembly {\n a := div(mload(add(b, 32)), exp(256, 12))\n }\n }\n\n function addressToBytes(address a) internal pure returns (bytes memory b) {\n b = new bytes(20);\n assembly {\n mstore(add(b, 32), mul(a, exp(256, 12)))\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/ContentHashResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IContentHashResolver.sol\";\n\nabstract contract ContentHashResolver is IContentHashResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => bytes)) versionable_hashes;\n\n /**\n * Sets the contenthash associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param hash The contenthash to set\n */\n function setContenthash(\n bytes32 node,\n bytes calldata hash\n ) external virtual authorised(node) {\n versionable_hashes[recordVersions[node]][node] = hash;\n emit ContenthashChanged(node, hash);\n }\n\n /**\n * Returns the contenthash associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function contenthash(\n bytes32 node\n ) external view virtual override returns (bytes memory) {\n return versionable_hashes[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IContentHashResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/DNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"../../dnssec-oracle/RRUtils.sol\";\nimport \"./IDNSRecordResolver.sol\";\nimport \"./IDNSZoneResolver.sol\";\n\nabstract contract DNSResolver is\n IDNSRecordResolver,\n IDNSZoneResolver,\n ResolverBase\n{\n using RRUtils for *;\n using BytesUtils for bytes;\n\n // Zone hashes for the domains.\n // A zone hash is an EIP-1577 content hash in binary format that should point to a\n // resource containing a single zonefile.\n // node => contenthash\n mapping(uint64 => mapping(bytes32 => bytes)) private versionable_zonehashes;\n\n // The records themselves. Stored as binary RRSETs\n // node => version => name => resource => data\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => mapping(uint16 => bytes))))\n private versionable_records;\n\n // Count of number of entries for a given name. Required for DNS resolvers\n // when resolving wildcards.\n // node => version => name => number of records\n mapping(uint64 => mapping(bytes32 => mapping(bytes32 => uint16)))\n private versionable_nameEntriesCount;\n\n /**\n * Set one or more DNS records. Records are supplied in wire-format.\n * Records with the same node/name/resource must be supplied one after the\n * other to ensure the data is updated correctly. For example, if the data\n * was supplied:\n * a.example.com IN A 1.2.3.4\n * a.example.com IN A 5.6.7.8\n * www.example.com IN CNAME a.example.com.\n * then this would store the two A records for a.example.com correctly as a\n * single RRSET, however if the data was supplied:\n * a.example.com IN A 1.2.3.4\n * www.example.com IN CNAME a.example.com.\n * a.example.com IN A 5.6.7.8\n * then this would store the first A record, the CNAME, then the second A\n * record which would overwrite the first.\n *\n * @param node the namehash of the node for which to set the records\n * @param data the DNS wire format records to set\n */\n function setDNSRecords(\n bytes32 node,\n bytes calldata data\n ) external virtual authorised(node) {\n uint16 resource = 0;\n uint256 offset = 0;\n bytes memory name;\n bytes memory value;\n bytes32 nameHash;\n uint64 version = recordVersions[node];\n // Iterate over the data to add the resource records\n for (\n RRUtils.RRIterator memory iter = data.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n if (resource == 0) {\n resource = iter.dnstype;\n name = iter.name();\n nameHash = keccak256(abi.encodePacked(name));\n value = bytes(iter.rdata());\n } else {\n bytes memory newName = iter.name();\n if (resource != iter.dnstype || !name.equals(newName)) {\n setDNSRRSet(\n node,\n name,\n resource,\n data,\n offset,\n iter.offset - offset,\n value.length == 0,\n version\n );\n resource = iter.dnstype;\n offset = iter.offset;\n name = newName;\n nameHash = keccak256(name);\n value = bytes(iter.rdata());\n }\n }\n }\n if (name.length > 0) {\n setDNSRRSet(\n node,\n name,\n resource,\n data,\n offset,\n data.length - offset,\n value.length == 0,\n version\n );\n }\n }\n\n /**\n * Obtain a DNS record.\n * @param node the namehash of the node for which to fetch the record\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\n * @return the DNS record in wire format if present, otherwise empty\n */\n function dnsRecord(\n bytes32 node,\n bytes32 name,\n uint16 resource\n ) public view virtual override returns (bytes memory) {\n return versionable_records[recordVersions[node]][node][name][resource];\n }\n\n /**\n * Check if a given node has records.\n * @param node the namehash of the node for which to check the records\n * @param name the namehash of the node for which to check the records\n */\n function hasDNSRecords(\n bytes32 node,\n bytes32 name\n ) public view virtual returns (bool) {\n return (versionable_nameEntriesCount[recordVersions[node]][node][\n name\n ] != 0);\n }\n\n /**\n * setZonehash sets the hash for the zone.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param hash The zonehash to set\n */\n function setZonehash(\n bytes32 node,\n bytes calldata hash\n ) external virtual authorised(node) {\n uint64 currentRecordVersion = recordVersions[node];\n bytes memory oldhash = versionable_zonehashes[currentRecordVersion][\n node\n ];\n versionable_zonehashes[currentRecordVersion][node] = hash;\n emit DNSZonehashChanged(node, oldhash, hash);\n }\n\n /**\n * zonehash obtains the hash for the zone.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function zonehash(\n bytes32 node\n ) external view virtual override returns (bytes memory) {\n return versionable_zonehashes[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IDNSRecordResolver).interfaceId ||\n interfaceID == type(IDNSZoneResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n\n function setDNSRRSet(\n bytes32 node,\n bytes memory name,\n uint16 resource,\n bytes memory data,\n uint256 offset,\n uint256 size,\n bool deleteRecord,\n uint64 version\n ) private {\n bytes32 nameHash = keccak256(name);\n bytes memory rrData = data.substring(offset, size);\n if (deleteRecord) {\n if (\n versionable_records[version][node][nameHash][resource].length !=\n 0\n ) {\n versionable_nameEntriesCount[version][node][nameHash]--;\n }\n delete (versionable_records[version][node][nameHash][resource]);\n emit DNSRecordDeleted(node, name, resource);\n } else {\n if (\n versionable_records[version][node][nameHash][resource].length ==\n 0\n ) {\n versionable_nameEntriesCount[version][node][nameHash]++;\n }\n versionable_records[version][node][nameHash][resource] = rrData;\n emit DNSRecordChanged(node, name, resource, rrData);\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/ExtendedResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ncontract ExtendedResolver {\n function resolve(\n bytes memory /* name */,\n bytes memory data\n ) external view returns (bytes memory) {\n (bool success, bytes memory result) = address(this).staticcall(data);\n if (success) {\n return result;\n } else {\n // Revert with the reason provided by the call\n assembly {\n revert(add(result, 0x20), mload(result))\n }\n }\n }\n}\n" + }, + "contracts/resolvers/profiles/IABIResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IABIResolver {\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\n\n /**\n * Returns the ABI associated with an ENS node.\n * Defined in EIP205.\n * @param node The ENS node to query\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\n * @return contentType The content type of the return value\n * @return data The ABI data\n */\n function ABI(\n bytes32 node,\n uint256 contentTypes\n ) external view returns (uint256, bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IAddressResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the new (multicoin) addr function.\n */\ninterface IAddressResolver {\n event AddressChanged(\n bytes32 indexed node,\n uint256 coinType,\n bytes newAddress\n );\n\n function addr(\n bytes32 node,\n uint256 coinType\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IAddrResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the legacy (ETH-only) addr function.\n */\ninterface IAddrResolver {\n event AddrChanged(bytes32 indexed node, address a);\n\n /**\n * Returns the address associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated address.\n */\n function addr(bytes32 node) external view returns (address payable);\n}\n" + }, + "contracts/resolvers/profiles/IContentHashResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IContentHashResolver {\n event ContenthashChanged(bytes32 indexed node, bytes hash);\n\n /**\n * Returns the contenthash associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function contenthash(bytes32 node) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IDNSRecordResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSRecordResolver {\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\n event DNSRecordChanged(\n bytes32 indexed node,\n bytes name,\n uint16 resource,\n bytes record\n );\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\n\n /**\n * Obtain a DNS record.\n * @param node the namehash of the node for which to fetch the record\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\n * @return the DNS record in wire format if present, otherwise empty\n */\n function dnsRecord(\n bytes32 node,\n bytes32 name,\n uint16 resource\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IDNSZoneResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSZoneResolver {\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\n event DNSZonehashChanged(\n bytes32 indexed node,\n bytes lastzonehash,\n bytes zonehash\n );\n\n /**\n * zonehash obtains the hash for the zone.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function zonehash(bytes32 node) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IExtendedDNSResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedDNSResolver {\n function resolve(\n bytes memory name,\n bytes memory data,\n bytes memory context\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IExtendedResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedResolver {\n function resolve(\n bytes memory name,\n bytes memory data\n ) external view returns (bytes memory);\n}\n" + }, + "contracts/resolvers/profiles/IInterfaceResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IInterfaceResolver {\n event InterfaceChanged(\n bytes32 indexed node,\n bytes4 indexed interfaceID,\n address implementer\n );\n\n /**\n * Returns the address of a contract that implements the specified interface for this name.\n * If an implementer has not been set for this interfaceID and name, the resolver will query\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\n * will be returned.\n * @param node The ENS node to query.\n * @param interfaceID The EIP 165 interface ID to check for.\n * @return The address that implements this interface, or 0 if the interface is unsupported.\n */\n function interfaceImplementer(\n bytes32 node,\n bytes4 interfaceID\n ) external view returns (address);\n}\n" + }, + "contracts/resolvers/profiles/INameResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface INameResolver {\n event NameChanged(bytes32 indexed node, string name);\n\n /**\n * Returns the name associated with an ENS node, for reverse records.\n * Defined in EIP181.\n * @param node The ENS node to query.\n * @return The associated name.\n */\n function name(bytes32 node) external view returns (string memory);\n}\n" + }, + "contracts/resolvers/profiles/InterfaceResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../ResolverBase.sol\";\nimport \"./AddrResolver.sol\";\nimport \"./IInterfaceResolver.sol\";\n\nabstract contract InterfaceResolver is IInterfaceResolver, AddrResolver {\n mapping(uint64 => mapping(bytes32 => mapping(bytes4 => address))) versionable_interfaces;\n\n /**\n * Sets an interface associated with a name.\n * Setting the address to 0 restores the default behaviour of querying the contract at `addr()` for interface support.\n * @param node The node to update.\n * @param interfaceID The EIP 165 interface ID.\n * @param implementer The address of a contract that implements this interface for this node.\n */\n function setInterface(\n bytes32 node,\n bytes4 interfaceID,\n address implementer\n ) external virtual authorised(node) {\n versionable_interfaces[recordVersions[node]][node][\n interfaceID\n ] = implementer;\n emit InterfaceChanged(node, interfaceID, implementer);\n }\n\n /**\n * Returns the address of a contract that implements the specified interface for this name.\n * If an implementer has not been set for this interfaceID and name, the resolver will query\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\n * will be returned.\n * @param node The ENS node to query.\n * @param interfaceID The EIP 165 interface ID to check for.\n * @return The address that implements this interface, or 0 if the interface is unsupported.\n */\n function interfaceImplementer(\n bytes32 node,\n bytes4 interfaceID\n ) external view virtual override returns (address) {\n address implementer = versionable_interfaces[recordVersions[node]][\n node\n ][interfaceID];\n if (implementer != address(0)) {\n return implementer;\n }\n\n address a = addr(node);\n if (a == address(0)) {\n return address(0);\n }\n\n (bool success, bytes memory returnData) = a.staticcall(\n abi.encodeWithSignature(\n \"supportsInterface(bytes4)\",\n type(IERC165).interfaceId\n )\n );\n if (!success || returnData.length < 32 || returnData[31] == 0) {\n // EIP 165 not supported by target\n return address(0);\n }\n\n (success, returnData) = a.staticcall(\n abi.encodeWithSignature(\"supportsInterface(bytes4)\", interfaceID)\n );\n if (!success || returnData.length < 32 || returnData[31] == 0) {\n // Specified interface not supported by target\n return address(0);\n }\n\n return a;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IInterfaceResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/IPubkeyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IPubkeyResolver {\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\n\n /**\n * Returns the SECP256k1 public key associated with an ENS node.\n * Defined in EIP 619.\n * @param node The ENS node to query\n * @return x The X coordinate of the curve point for the public key.\n * @return y The Y coordinate of the curve point for the public key.\n */\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\n}\n" + }, + "contracts/resolvers/profiles/ITextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface ITextResolver {\n event TextChanged(\n bytes32 indexed node,\n string indexed indexedKey,\n string key,\n string value\n );\n\n /**\n * Returns the text data associated with an ENS node and key.\n * @param node The ENS node to query.\n * @param key The text data key to query.\n * @return The associated text data.\n */\n function text(\n bytes32 node,\n string calldata key\n ) external view returns (string memory);\n}\n" + }, + "contracts/resolvers/profiles/IVersionableResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IVersionableResolver {\n event VersionChanged(bytes32 indexed node, uint64 newVersion);\n\n function recordVersions(bytes32 node) external view returns (uint64);\n}\n" + }, + "contracts/resolvers/profiles/NameResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./INameResolver.sol\";\n\nabstract contract NameResolver is INameResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => string)) versionable_names;\n\n /**\n * Sets the name associated with an ENS node, for reverse records.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n */\n function setName(\n bytes32 node,\n string calldata newName\n ) external virtual authorised(node) {\n versionable_names[recordVersions[node]][node] = newName;\n emit NameChanged(node, newName);\n }\n\n /**\n * Returns the name associated with an ENS node, for reverse records.\n * Defined in EIP181.\n * @param node The ENS node to query.\n * @return The associated name.\n */\n function name(\n bytes32 node\n ) external view virtual override returns (string memory) {\n return versionable_names[recordVersions[node]][node];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(INameResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/PubkeyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./IPubkeyResolver.sol\";\n\nabstract contract PubkeyResolver is IPubkeyResolver, ResolverBase {\n struct PublicKey {\n bytes32 x;\n bytes32 y;\n }\n\n mapping(uint64 => mapping(bytes32 => PublicKey)) versionable_pubkeys;\n\n /**\n * Sets the SECP256k1 public key associated with an ENS node.\n * @param node The ENS node to query\n * @param x the X coordinate of the curve point for the public key.\n * @param y the Y coordinate of the curve point for the public key.\n */\n function setPubkey(\n bytes32 node,\n bytes32 x,\n bytes32 y\n ) external virtual authorised(node) {\n versionable_pubkeys[recordVersions[node]][node] = PublicKey(x, y);\n emit PubkeyChanged(node, x, y);\n }\n\n /**\n * Returns the SECP256k1 public key associated with an ENS node.\n * Defined in EIP 619.\n * @param node The ENS node to query\n * @return x The X coordinate of the curve point for the public key.\n * @return y The Y coordinate of the curve point for the public key.\n */\n function pubkey(\n bytes32 node\n ) external view virtual override returns (bytes32 x, bytes32 y) {\n uint64 currentRecordVersion = recordVersions[node];\n return (\n versionable_pubkeys[currentRecordVersion][node].x,\n versionable_pubkeys[currentRecordVersion][node].y\n );\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IPubkeyResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/TextResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"../ResolverBase.sol\";\nimport \"./ITextResolver.sol\";\n\nabstract contract TextResolver is ITextResolver, ResolverBase {\n mapping(uint64 => mapping(bytes32 => mapping(string => string))) versionable_texts;\n\n /**\n * Sets the text data associated with an ENS node and key.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n * @param key The key to set.\n * @param value The text data value to set.\n */\n function setText(\n bytes32 node,\n string calldata key,\n string calldata value\n ) external virtual authorised(node) {\n versionable_texts[recordVersions[node]][node][key] = value;\n emit TextChanged(node, key, key, value);\n }\n\n /**\n * Returns the text data associated with an ENS node and key.\n * @param node The ENS node to query.\n * @param key The text data key to query.\n * @return The associated text data.\n */\n function text(\n bytes32 node,\n string calldata key\n ) external view virtual override returns (string memory) {\n return versionable_texts[recordVersions[node]][node][key];\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(ITextResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/PublicResolver.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport \"../registry/ENS.sol\";\nimport \"./profiles/ABIResolver.sol\";\nimport \"./profiles/AddrResolver.sol\";\nimport \"./profiles/ContentHashResolver.sol\";\nimport \"./profiles/DNSResolver.sol\";\nimport \"./profiles/InterfaceResolver.sol\";\nimport \"./profiles/NameResolver.sol\";\nimport \"./profiles/PubkeyResolver.sol\";\nimport \"./profiles/TextResolver.sol\";\nimport \"./Multicallable.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {INameWrapper} from \"../wrapper/INameWrapper.sol\";\n\n/**\n * A simple resolver anyone can use; only allows the owner of a node to set its\n * address.\n */\ncontract PublicResolver is\n Multicallable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver,\n ReverseClaimer\n{\n ENS immutable ens;\n INameWrapper immutable nameWrapper;\n address immutable trustedETHController;\n address immutable trustedReverseRegistrar;\n\n /**\n * A mapping of operators. An address that is authorised for an address\n * may make any changes to the name that the owner could, but may not update\n * the set of authorisations.\n * (owner, operator) => approved\n */\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * A mapping of delegates. A delegate that is authorised by an owner\n * for a name may make changes to the name's resolver, but may not update\n * the set of token approvals.\n * (owner, name, delegate) => approved\n */\n mapping(address => mapping(bytes32 => mapping(address => bool)))\n private _tokenApprovals;\n\n // Logged when an operator is added or removed.\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n\n // Logged when a delegate is approved or an approval is revoked.\n event Approved(\n address owner,\n bytes32 indexed node,\n address indexed delegate,\n bool indexed approved\n );\n\n constructor(\n ENS _ens,\n INameWrapper wrapperAddress,\n address _trustedETHController,\n address _trustedReverseRegistrar\n ) ReverseClaimer(_ens, msg.sender) {\n ens = _ens;\n nameWrapper = wrapperAddress;\n trustedETHController = _trustedETHController;\n trustedReverseRegistrar = _trustedReverseRegistrar;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) external {\n require(\n msg.sender != operator,\n \"ERC1155: setting approval status for self\"\n );\n\n _operatorApprovals[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev Approve a delegate to be able to updated records on a node.\n */\n function approve(bytes32 node, address delegate, bool approved) external {\n require(msg.sender != delegate, \"Setting delegate status for self\");\n\n _tokenApprovals[msg.sender][node][delegate] = approved;\n emit Approved(msg.sender, node, delegate, approved);\n }\n\n /**\n * @dev Check to see if the delegate has been approved by the owner for the node.\n */\n function isApprovedFor(\n address owner,\n bytes32 node,\n address delegate\n ) public view returns (bool) {\n return _tokenApprovals[owner][node][delegate];\n }\n\n function isAuthorised(bytes32 node) internal view override returns (bool) {\n if (\n msg.sender == trustedETHController ||\n msg.sender == trustedReverseRegistrar\n ) {\n return true;\n }\n address owner = ens.owner(node);\n if (owner == address(nameWrapper)) {\n owner = nameWrapper.ownerOf(uint256(node));\n }\n return\n owner == msg.sender ||\n isApprovedForAll(owner, msg.sender) ||\n isApprovedFor(owner, node, msg.sender);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n )\n public\n view\n override(\n Multicallable,\n ABIResolver,\n AddrResolver,\n ContentHashResolver,\n DNSResolver,\n InterfaceResolver,\n NameResolver,\n PubkeyResolver,\n TextResolver\n )\n returns (bool)\n {\n return super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/Resolver.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"./profiles/IABIResolver.sol\";\nimport \"./profiles/IAddressResolver.sol\";\nimport \"./profiles/IAddrResolver.sol\";\nimport \"./profiles/IContentHashResolver.sol\";\nimport \"./profiles/IDNSRecordResolver.sol\";\nimport \"./profiles/IDNSZoneResolver.sol\";\nimport \"./profiles/IInterfaceResolver.sol\";\nimport \"./profiles/INameResolver.sol\";\nimport \"./profiles/IPubkeyResolver.sol\";\nimport \"./profiles/ITextResolver.sol\";\nimport \"./profiles/IExtendedResolver.sol\";\n\n/**\n * A generic resolver interface which includes all the functions including the ones deprecated\n */\ninterface Resolver is\n IERC165,\n IABIResolver,\n IAddressResolver,\n IAddrResolver,\n IContentHashResolver,\n IDNSRecordResolver,\n IDNSZoneResolver,\n IInterfaceResolver,\n INameResolver,\n IPubkeyResolver,\n ITextResolver,\n IExtendedResolver\n{\n /* Deprecated events */\n event ContentChanged(bytes32 indexed node, bytes32 hash);\n\n function setApprovalForAll(address, bool) external;\n\n function approve(bytes32 node, address delegate, bool approved) external;\n\n function isApprovedForAll(address account, address operator) external;\n\n function isApprovedFor(\n address owner,\n bytes32 node,\n address delegate\n ) external;\n\n function setABI(\n bytes32 node,\n uint256 contentType,\n bytes calldata data\n ) external;\n\n function setAddr(bytes32 node, address addr) external;\n\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\n\n function setContenthash(bytes32 node, bytes calldata hash) external;\n\n function setDnsrr(bytes32 node, bytes calldata data) external;\n\n function setName(bytes32 node, string calldata _name) external;\n\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\n\n function setText(\n bytes32 node,\n string calldata key,\n string calldata value\n ) external;\n\n function setInterface(\n bytes32 node,\n bytes4 interfaceID,\n address implementer\n ) external;\n\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n function multicallWithNodeCheck(\n bytes32 nodehash,\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n /* Deprecated functions */\n function content(bytes32 node) external view returns (bytes32);\n\n function multihash(bytes32 node) external view returns (bytes memory);\n\n function setContent(bytes32 node, bytes32 hash) external;\n\n function setMultihash(bytes32 node, bytes calldata hash) external;\n}\n" + }, + "contracts/resolvers/ResolverBase.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"./profiles/IVersionableResolver.sol\";\n\nabstract contract ResolverBase is ERC165, IVersionableResolver {\n mapping(bytes32 => uint64) public recordVersions;\n\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\n\n modifier authorised(bytes32 node) {\n require(isAuthorised(node));\n _;\n }\n\n /**\n * Increments the record version associated with an ENS node.\n * May only be called by the owner of that node in the ENS registry.\n * @param node The node to update.\n */\n function clearRecords(bytes32 node) public virtual authorised(node) {\n recordVersions[node]++;\n emit VersionChanged(node, recordVersions[node]);\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) public view virtual override returns (bool) {\n return\n interfaceID == type(IVersionableResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/reverseRegistrar/IReverseRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\ninterface IReverseRegistrar {\n function setDefaultResolver(address resolver) external;\n\n function claim(address owner) external returns (bytes32);\n\n function claimForAddr(\n address addr,\n address owner,\n address resolver\n ) external returns (bytes32);\n\n function claimWithResolver(\n address owner,\n address resolver\n ) external returns (bytes32);\n\n function setName(string memory name) external returns (bytes32);\n\n function setNameForAddr(\n address addr,\n address owner,\n address resolver,\n string memory name\n ) external returns (bytes32);\n\n function node(address addr) external pure returns (bytes32);\n}\n" + }, + "contracts/reverseRegistrar/ReverseClaimer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IReverseRegistrar} from \"../reverseRegistrar/IReverseRegistrar.sol\";\n\ncontract ReverseClaimer {\n bytes32 constant ADDR_REVERSE_NODE =\n 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\n\n constructor(ENS ens, address claimant) {\n IReverseRegistrar reverseRegistrar = IReverseRegistrar(\n ens.owner(ADDR_REVERSE_NODE)\n );\n reverseRegistrar.claim(claimant);\n }\n}\n" + }, + "contracts/reverseRegistrar/ReverseRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"./IReverseRegistrar.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"../root/Controllable.sol\";\n\nabstract contract NameResolver {\n function setName(bytes32 node, string memory name) public virtual;\n}\n\nbytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000;\n\nbytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;\n\n// namehash('addr.reverse')\n\ncontract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar {\n ENS public immutable ens;\n NameResolver public defaultResolver;\n\n event ReverseClaimed(address indexed addr, bytes32 indexed node);\n event DefaultResolverChanged(NameResolver indexed resolver);\n\n /**\n * @dev Constructor\n * @param ensAddr The address of the ENS registry.\n */\n constructor(ENS ensAddr) {\n ens = ensAddr;\n\n // Assign ownership of the reverse record to our deployer\n ReverseRegistrar oldRegistrar = ReverseRegistrar(\n ensAddr.owner(ADDR_REVERSE_NODE)\n );\n if (address(oldRegistrar) != address(0x0)) {\n oldRegistrar.claim(msg.sender);\n }\n }\n\n modifier authorised(address addr) {\n require(\n addr == msg.sender ||\n controllers[msg.sender] ||\n ens.isApprovedForAll(addr, msg.sender) ||\n ownsContract(addr),\n \"ReverseRegistrar: Caller is not a controller or authorised by address or the address itself\"\n );\n _;\n }\n\n function setDefaultResolver(address resolver) public override onlyOwner {\n require(\n address(resolver) != address(0),\n \"ReverseRegistrar: Resolver address must not be 0\"\n );\n defaultResolver = NameResolver(resolver);\n emit DefaultResolverChanged(NameResolver(resolver));\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @return The ENS node hash of the reverse record.\n */\n function claim(address owner) public override returns (bytes32) {\n return claimForAddr(msg.sender, owner, address(defaultResolver));\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param addr The reverse record to set\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @param resolver The resolver of the reverse node\n * @return The ENS node hash of the reverse record.\n */\n function claimForAddr(\n address addr,\n address owner,\n address resolver\n ) public override authorised(addr) returns (bytes32) {\n bytes32 labelHash = sha3HexAddress(addr);\n bytes32 reverseNode = keccak256(\n abi.encodePacked(ADDR_REVERSE_NODE, labelHash)\n );\n emit ReverseClaimed(addr, reverseNode);\n ens.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0);\n return reverseNode;\n }\n\n /**\n * @dev Transfers ownership of the reverse ENS record associated with the\n * calling account.\n * @param owner The address to set as the owner of the reverse record in ENS.\n * @param resolver The address of the resolver to set; 0 to leave unchanged.\n * @return The ENS node hash of the reverse record.\n */\n function claimWithResolver(\n address owner,\n address resolver\n ) public override returns (bytes32) {\n return claimForAddr(msg.sender, owner, resolver);\n }\n\n /**\n * @dev Sets the `name()` record for the reverse ENS record associated with\n * the calling account. First updates the resolver to the default reverse\n * resolver if necessary.\n * @param name The name to set for this address.\n * @return The ENS node hash of the reverse record.\n */\n function setName(string memory name) public override returns (bytes32) {\n return\n setNameForAddr(\n msg.sender,\n msg.sender,\n address(defaultResolver),\n name\n );\n }\n\n /**\n * @dev Sets the `name()` record for the reverse ENS record associated with\n * the account provided. Updates the resolver to a designated resolver\n * Only callable by controllers and authorised users\n * @param addr The reverse record to set\n * @param owner The owner of the reverse node\n * @param resolver The resolver of the reverse node\n * @param name The name to set for this address.\n * @return The ENS node hash of the reverse record.\n */\n function setNameForAddr(\n address addr,\n address owner,\n address resolver,\n string memory name\n ) public override returns (bytes32) {\n bytes32 node = claimForAddr(addr, owner, resolver);\n NameResolver(resolver).setName(node, name);\n return node;\n }\n\n /**\n * @dev Returns the node hash for a given account's reverse records.\n * @param addr The address to hash\n * @return The ENS node hash.\n */\n function node(address addr) public pure override returns (bytes32) {\n return\n keccak256(\n abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr))\n );\n }\n\n /**\n * @dev An optimised function to compute the sha3 of the lower-case\n * hexadecimal representation of an Ethereum address.\n * @param addr The address to hash\n * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the\n * input address.\n */\n function sha3HexAddress(address addr) private pure returns (bytes32 ret) {\n assembly {\n for {\n let i := 40\n } gt(i, 0) {\n\n } {\n i := sub(i, 1)\n mstore8(i, byte(and(addr, 0xf), lookup))\n addr := div(addr, 0x10)\n i := sub(i, 1)\n mstore8(i, byte(and(addr, 0xf), lookup))\n addr := div(addr, 0x10)\n }\n\n ret := keccak256(0, 40)\n }\n }\n\n function ownsContract(address addr) internal view returns (bool) {\n try Ownable(addr).owner() returns (address owner) {\n return owner == msg.sender;\n } catch {\n return false;\n }\n }\n}\n" + }, + "contracts/root/Controllable.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract Controllable is Ownable {\n mapping(address => bool) public controllers;\n\n event ControllerChanged(address indexed controller, bool enabled);\n\n modifier onlyController() {\n require(\n controllers[msg.sender],\n \"Controllable: Caller is not a controller\"\n );\n _;\n }\n\n function setController(address controller, bool enabled) public onlyOwner {\n controllers[controller] = enabled;\n emit ControllerChanged(controller, enabled);\n }\n}\n" + }, + "contracts/root/Ownable.sol": { + "content": "pragma solidity ^0.8.4;\n\ncontract Ownable {\n address public owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n modifier onlyOwner() {\n require(isOwner(msg.sender));\n _;\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function transferOwnership(address newOwner) public onlyOwner {\n emit OwnershipTransferred(owner, newOwner);\n owner = newOwner;\n }\n\n function isOwner(address addr) public view returns (bool) {\n return owner == addr;\n }\n}\n" + }, + "contracts/root/Root.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../registry/ENS.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./Controllable.sol\";\n\ncontract Root is Ownable, Controllable {\n bytes32 private constant ROOT_NODE = bytes32(0);\n\n bytes4 private constant INTERFACE_META_ID =\n bytes4(keccak256(\"supportsInterface(bytes4)\"));\n\n event TLDLocked(bytes32 indexed label);\n\n ENS public ens;\n mapping(bytes32 => bool) public locked;\n\n constructor(ENS _ens) public {\n ens = _ens;\n }\n\n function setSubnodeOwner(\n bytes32 label,\n address owner\n ) external onlyController {\n require(!locked[label]);\n ens.setSubnodeOwner(ROOT_NODE, label, owner);\n }\n\n function setResolver(address resolver) external onlyOwner {\n ens.setResolver(ROOT_NODE, resolver);\n }\n\n function lock(bytes32 label) external onlyOwner {\n emit TLDLocked(label);\n locked[label] = true;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external pure returns (bool) {\n return interfaceID == INTERFACE_META_ID;\n }\n}\n" + }, + "contracts/utils/ERC20Recoverable.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n/**\n @notice Contract is used to recover ERC20 tokens sent to the contract by mistake.\n */\n\ncontract ERC20Recoverable is Ownable {\n /**\n @notice Recover ERC20 tokens sent to the contract by mistake.\n @dev The contract is Ownable and only the owner can call the recover function.\n @param _to The address to send the tokens to.\n@param _token The address of the ERC20 token to recover\n @param _amount The amount of tokens to recover.\n */\n function recoverFunds(\n address _token,\n address _to,\n uint256 _amount\n ) external onlyOwner {\n IERC20(_token).transfer(_to, _amount);\n }\n}\n" + }, + "contracts/utils/HexUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nlibrary HexUtils {\n /**\n * @dev Attempts to parse bytes32 from a hex string\n * @param str The string to parse\n * @param idx The offset to start parsing at\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\n */\n function hexStringToBytes32(\n bytes memory str,\n uint256 idx,\n uint256 lastIdx\n ) internal pure returns (bytes32 r, bool valid) {\n valid = true;\n assembly {\n // check that the index to read to is not past the end of the string\n if gt(lastIdx, mload(str)) {\n revert(0, 0)\n }\n\n function getHex(c) -> ascii {\n // chars 48-57: 0-9\n if and(gt(c, 47), lt(c, 58)) {\n ascii := sub(c, 48)\n leave\n }\n // chars 65-70: A-F\n if and(gt(c, 64), lt(c, 71)) {\n ascii := add(sub(c, 65), 10)\n leave\n }\n // chars 97-102: a-f\n if and(gt(c, 96), lt(c, 103)) {\n ascii := add(sub(c, 97), 10)\n leave\n }\n // invalid char\n ascii := 0xff\n }\n\n let ptr := add(str, 32)\n for {\n let i := idx\n } lt(i, lastIdx) {\n i := add(i, 2)\n } {\n let byte1 := getHex(byte(0, mload(add(ptr, i))))\n let byte2 := getHex(byte(0, mload(add(ptr, add(i, 1)))))\n // if either byte is invalid, set invalid and break loop\n if or(eq(byte1, 0xff), eq(byte2, 0xff)) {\n valid := false\n break\n }\n let combined := or(shl(4, byte1), byte2)\n r := or(shl(8, r), combined)\n }\n }\n }\n\n /**\n * @dev Attempts to parse an address from a hex string\n * @param str The string to parse\n * @param idx The offset to start parsing at\n * @param lastIdx The (exclusive) last index in `str` to consider. Use `str.length` to scan the whole string.\n */\n function hexToAddress(\n bytes memory str,\n uint256 idx,\n uint256 lastIdx\n ) internal pure returns (address, bool) {\n if (lastIdx - idx < 40) return (address(0x0), false);\n (bytes32 r, bool valid) = hexStringToBytes32(str, idx, lastIdx);\n return (address(uint160(uint256(r))), valid);\n }\n}\n" + }, + "contracts/utils/LowLevelCallUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.13;\n\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\n\nlibrary LowLevelCallUtils {\n using Address for address;\n\n /**\n * @dev Makes a static call to the specified `target` with `data`. Return data can be fetched with\n * `returnDataSize` and `readReturnData`.\n * @param target The address to staticcall.\n * @param data The data to pass to the call.\n * @return success True if the call succeeded, or false if it reverts.\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bool success) {\n require(\n target.isContract(),\n \"LowLevelCallUtils: static call to non-contract\"\n );\n assembly {\n success := staticcall(\n gas(),\n target,\n add(data, 32),\n mload(data),\n 0,\n 0\n )\n }\n }\n\n /**\n * @dev Returns the size of the return data of the most recent external call.\n */\n function returnDataSize() internal pure returns (uint256 len) {\n assembly {\n len := returndatasize()\n }\n }\n\n /**\n * @dev Reads return data from the most recent external call.\n * @param offset Offset into the return data.\n * @param length Number of bytes to return.\n */\n function readReturnData(\n uint256 offset,\n uint256 length\n ) internal pure returns (bytes memory data) {\n data = new bytes(length);\n assembly {\n returndatacopy(add(data, 32), offset, length)\n }\n }\n\n /**\n * @dev Reverts with the return data from the most recent external call.\n */\n function propagateRevert() internal pure {\n assembly {\n returndatacopy(0, 0, returndatasize())\n revert(0, returndatasize())\n }\n }\n}\n" + }, + "contracts/utils/NameEncoder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {BytesUtils} from \"../wrapper/BytesUtils.sol\";\n\nlibrary NameEncoder {\n using BytesUtils for bytes;\n\n function dnsEncodeName(\n string memory name\n ) internal pure returns (bytes memory dnsName, bytes32 node) {\n uint8 labelLength = 0;\n bytes memory bytesName = bytes(name);\n uint256 length = bytesName.length;\n dnsName = new bytes(length + 2);\n node = 0;\n if (length == 0) {\n dnsName[0] = 0;\n return (dnsName, node);\n }\n\n // use unchecked to save gas since we check for an underflow\n // and we check for the length before the loop\n unchecked {\n for (uint256 i = length - 1; i >= 0; i--) {\n if (bytesName[i] == \".\") {\n dnsName[i + 1] = bytes1(labelLength);\n node = keccak256(\n abi.encodePacked(\n node,\n bytesName.keccak(i + 1, labelLength)\n )\n );\n labelLength = 0;\n } else {\n labelLength += 1;\n dnsName[i + 1] = bytesName[i];\n }\n if (i == 0) {\n break;\n }\n }\n }\n\n node = keccak256(\n abi.encodePacked(node, bytesName.keccak(0, labelLength))\n );\n\n dnsName[0] = bytes1(labelLength);\n return (dnsName, node);\n }\n}\n" + }, + "contracts/utils/TestHexUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {HexUtils} from \"./HexUtils.sol\";\n\ncontract TestHexUtils {\n using HexUtils for *;\n\n function hexStringToBytes32(\n bytes calldata name,\n uint256 idx,\n uint256 lastInx\n ) public pure returns (bytes32, bool) {\n return name.hexStringToBytes32(idx, lastInx);\n }\n\n function hexToAddress(\n bytes calldata input,\n uint256 idx,\n uint256 lastInx\n ) public pure returns (address, bool) {\n return input.hexToAddress(idx, lastInx);\n }\n}\n" + }, + "contracts/utils/TestNameEncoder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\nimport {NameEncoder} from \"./NameEncoder.sol\";\n\ncontract TestNameEncoder {\n using NameEncoder for string;\n\n function encodeName(\n string memory name\n ) public pure returns (bytes memory, bytes32) {\n return name.dnsEncodeName();\n }\n}\n" + }, + "contracts/utils/UniversalResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ERC165} from \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {LowLevelCallUtils} from \"./LowLevelCallUtils.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IExtendedResolver} from \"../resolvers/profiles/IExtendedResolver.sol\";\nimport {Resolver, INameResolver, IAddrResolver} from \"../resolvers/Resolver.sol\";\nimport {NameEncoder} from \"./NameEncoder.sol\";\nimport {BytesUtils} from \"../wrapper/BytesUtils.sol\";\nimport {HexUtils} from \"./HexUtils.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\nstruct MulticallData {\n bytes name;\n bytes[] data;\n string[] gateways;\n bytes4 callbackFunction;\n bool isWildcard;\n address resolver;\n bytes metaData;\n bool[] failures;\n}\n\nstruct OffchainLookupCallData {\n address sender;\n string[] urls;\n bytes callData;\n}\n\nstruct OffchainLookupExtraData {\n bytes4 callbackFunction;\n bytes data;\n}\n\ninterface BatchGateway {\n function query(\n OffchainLookupCallData[] memory data\n ) external returns (bool[] memory failures, bytes[] memory responses);\n}\n\n/**\n * The Universal Resolver is a contract that handles the work of resolving a name entirely onchain,\n * making it possible to make a single smart contract call to resolve an ENS name.\n */\ncontract UniversalResolver is ERC165, Ownable {\n using Address for address;\n using NameEncoder for string;\n using BytesUtils for bytes;\n using HexUtils for bytes;\n\n string[] public batchGatewayURLs;\n ENS public immutable registry;\n\n constructor(address _registry, string[] memory _urls) {\n registry = ENS(_registry);\n batchGatewayURLs = _urls;\n }\n\n function setGatewayURLs(string[] memory _urls) public onlyOwner {\n batchGatewayURLs = _urls;\n }\n\n /**\n * @dev Performs ENS name resolution for the supplied name and resolution data.\n * @param name The name to resolve, in normalised and DNS-encoded form.\n * @param data The resolution data, as specified in ENSIP-10.\n * @return The result of resolving the name.\n */\n function resolve(\n bytes calldata name,\n bytes memory data\n ) external view returns (bytes memory, address) {\n return\n _resolveSingle(\n name,\n data,\n batchGatewayURLs,\n this.resolveSingleCallback.selector,\n \"\"\n );\n }\n\n function resolve(\n bytes calldata name,\n bytes[] memory data\n ) external view returns (bytes[] memory, address) {\n return resolve(name, data, batchGatewayURLs);\n }\n\n function resolve(\n bytes calldata name,\n bytes memory data,\n string[] memory gateways\n ) external view returns (bytes memory, address) {\n return\n _resolveSingle(\n name,\n data,\n gateways,\n this.resolveSingleCallback.selector,\n \"\"\n );\n }\n\n function resolve(\n bytes calldata name,\n bytes[] memory data,\n string[] memory gateways\n ) public view returns (bytes[] memory, address) {\n return\n _resolve(name, data, gateways, this.resolveCallback.selector, \"\");\n }\n\n function _resolveSingle(\n bytes calldata name,\n bytes memory data,\n string[] memory gateways,\n bytes4 callbackFunction,\n bytes memory metaData\n ) public view returns (bytes memory, address) {\n bytes[] memory dataArr = new bytes[](1);\n dataArr[0] = data;\n (bytes[] memory results, address resolver) = _resolve(\n name,\n dataArr,\n gateways,\n callbackFunction,\n metaData\n );\n return (results[0], resolver);\n }\n\n function _resolve(\n bytes calldata name,\n bytes[] memory data,\n string[] memory gateways,\n bytes4 callbackFunction,\n bytes memory metaData\n ) internal view returns (bytes[] memory results, address resolverAddress) {\n (Resolver resolver, , uint256 finalOffset) = findResolver(name);\n resolverAddress = address(resolver);\n if (resolverAddress == address(0)) {\n return (results, address(0));\n }\n\n bool isWildcard = finalOffset != 0;\n\n results = _multicall(\n MulticallData(\n name,\n data,\n gateways,\n callbackFunction,\n isWildcard,\n resolverAddress,\n metaData,\n new bool[](data.length)\n )\n );\n }\n\n function reverse(\n bytes calldata reverseName\n ) external view returns (string memory, address, address, address) {\n return reverse(reverseName, batchGatewayURLs);\n }\n\n /**\n * @dev Performs ENS name reverse resolution for the supplied reverse name.\n * @param reverseName The reverse name to resolve, in normalised and DNS-encoded form. e.g. b6E040C9ECAaE172a89bD561c5F73e1C48d28cd9.addr.reverse\n * @return The resolved name, the resolved address, the reverse resolver address, and the resolver address.\n */\n function reverse(\n bytes calldata reverseName,\n string[] memory gateways\n ) public view returns (string memory, address, address, address) {\n bytes memory encodedCall = abi.encodeCall(\n INameResolver.name,\n reverseName.namehash(0)\n );\n (\n bytes memory resolvedReverseData,\n address reverseResolverAddress\n ) = _resolveSingle(\n reverseName,\n encodedCall,\n gateways,\n this.reverseCallback.selector,\n \"\"\n );\n\n return\n getForwardDataFromReverse(\n resolvedReverseData,\n reverseResolverAddress,\n gateways\n );\n }\n\n function getForwardDataFromReverse(\n bytes memory resolvedReverseData,\n address reverseResolverAddress,\n string[] memory gateways\n ) internal view returns (string memory, address, address, address) {\n string memory resolvedName = abi.decode(resolvedReverseData, (string));\n\n (bytes memory encodedName, bytes32 namehash) = resolvedName\n .dnsEncodeName();\n\n bytes memory encodedCall = abi.encodeCall(IAddrResolver.addr, namehash);\n bytes memory metaData = abi.encode(\n resolvedName,\n reverseResolverAddress\n );\n (bytes memory resolvedData, address resolverAddress) = this\n ._resolveSingle(\n encodedName,\n encodedCall,\n gateways,\n this.reverseCallback.selector,\n metaData\n );\n\n address resolvedAddress = abi.decode(resolvedData, (address));\n\n return (\n resolvedName,\n resolvedAddress,\n reverseResolverAddress,\n resolverAddress\n );\n }\n\n function resolveSingleCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory, address) {\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\n response,\n extraData,\n this.resolveSingleCallback.selector\n );\n return (results[0], resolver);\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes[] memory, address) {\n (bytes[] memory results, address resolver, , ) = _resolveCallback(\n response,\n extraData,\n this.resolveCallback.selector\n );\n return (results, resolver);\n }\n\n function reverseCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (string memory, address, address, address) {\n (\n bytes[] memory resolvedData,\n address resolverAddress,\n string[] memory gateways,\n bytes memory metaData\n ) = _resolveCallback(\n response,\n extraData,\n this.reverseCallback.selector\n );\n\n if (metaData.length > 0) {\n (string memory resolvedName, address reverseResolverAddress) = abi\n .decode(metaData, (string, address));\n address resolvedAddress = abi.decode(resolvedData[0], (address));\n return (\n resolvedName,\n resolvedAddress,\n reverseResolverAddress,\n resolverAddress\n );\n }\n\n return\n getForwardDataFromReverse(\n resolvedData[0],\n resolverAddress,\n gateways\n );\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == type(IExtendedResolver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function _resolveCallback(\n bytes calldata response,\n bytes calldata extraData,\n bytes4 callbackFunction\n )\n internal\n view\n returns (bytes[] memory, address, string[] memory, bytes memory)\n {\n MulticallData memory multicallData;\n multicallData.callbackFunction = callbackFunction;\n (bool[] memory failures, bytes[] memory responses) = abi.decode(\n response,\n (bool[], bytes[])\n );\n OffchainLookupExtraData[] memory extraDatas;\n (\n multicallData.isWildcard,\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData,\n extraDatas\n ) = abi.decode(\n extraData,\n (bool, address, string[], bytes, OffchainLookupExtraData[])\n );\n require(responses.length <= extraDatas.length);\n multicallData.data = new bytes[](extraDatas.length);\n multicallData.failures = new bool[](extraDatas.length);\n uint256 offchainCount = 0;\n for (uint256 i = 0; i < extraDatas.length; i++) {\n if (extraDatas[i].callbackFunction == bytes4(0)) {\n // This call did not require an offchain lookup; use the previous input data.\n multicallData.data[i] = extraDatas[i].data;\n } else {\n if (failures[offchainCount]) {\n multicallData.failures[i] = true;\n multicallData.data[i] = responses[offchainCount];\n } else {\n multicallData.data[i] = abi.encodeWithSelector(\n extraDatas[i].callbackFunction,\n responses[offchainCount],\n extraDatas[i].data\n );\n }\n offchainCount = offchainCount + 1;\n }\n }\n\n return (\n _multicall(multicallData),\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData\n );\n }\n\n /**\n * @dev Makes a call to `target` with `data`. If the call reverts with an `OffchainLookup` error, wraps\n * the error with the data necessary to continue the request where it left off.\n * @param target The address to call.\n * @param data The data to call `target` with.\n * @return offchain Whether the call reverted with an `OffchainLookup` error.\n * @return returnData If `target` did not revert, contains the return data from the call to `target`. Otherwise, contains a `OffchainLookupCallData` struct.\n * @return extraData If `target` did not revert, is empty. Otherwise, contains a `OffchainLookupExtraData` struct.\n * @return result Whether the call succeeded.\n */\n function callWithOffchainLookupPropagation(\n address target,\n bytes memory data\n )\n internal\n view\n returns (\n bool offchain,\n bytes memory returnData,\n OffchainLookupExtraData memory extraData,\n bool result\n )\n {\n result = LowLevelCallUtils.functionStaticCall(address(target), data);\n uint256 size = LowLevelCallUtils.returnDataSize();\n\n if (result) {\n return (\n false,\n LowLevelCallUtils.readReturnData(0, size),\n extraData,\n true\n );\n }\n\n // Failure\n if (size >= 4) {\n bytes memory errorId = LowLevelCallUtils.readReturnData(0, 4);\n // Offchain lookup. Decode the revert message and create our own that nests it.\n bytes memory revertData = LowLevelCallUtils.readReturnData(\n 4,\n size - 4\n );\n if (bytes4(errorId) == OffchainLookup.selector) {\n (\n address wrappedSender,\n string[] memory wrappedUrls,\n bytes memory wrappedCallData,\n bytes4 wrappedCallbackFunction,\n bytes memory wrappedExtraData\n ) = abi.decode(\n revertData,\n (address, string[], bytes, bytes4, bytes)\n );\n if (wrappedSender == target) {\n returnData = abi.encode(\n OffchainLookupCallData(\n wrappedSender,\n wrappedUrls,\n wrappedCallData\n )\n );\n extraData = OffchainLookupExtraData(\n wrappedCallbackFunction,\n wrappedExtraData\n );\n return (true, returnData, extraData, false);\n }\n } else {\n returnData = revertData;\n return (false, returnData, extraData, false);\n }\n }\n }\n\n /**\n * @dev Finds a resolver by recursively querying the registry, starting at the longest name and progressively\n * removing labels until it finds a result.\n * @param name The name to resolve, in DNS-encoded and normalised form.\n * @return resolver The Resolver responsible for this name.\n * @return namehash The namehash of the full name.\n * @return finalOffset The offset of the first label with a resolver.\n */\n function findResolver(\n bytes calldata name\n ) public view returns (Resolver, bytes32, uint256) {\n (\n address resolver,\n bytes32 namehash,\n uint256 finalOffset\n ) = findResolver(name, 0);\n return (Resolver(resolver), namehash, finalOffset);\n }\n\n function findResolver(\n bytes calldata name,\n uint256 offset\n ) internal view returns (address, bytes32, uint256) {\n uint256 labelLength = uint256(uint8(name[offset]));\n if (labelLength == 0) {\n return (address(0), bytes32(0), offset);\n }\n uint256 nextLabel = offset + labelLength + 1;\n bytes32 labelHash;\n if (\n labelLength == 66 &&\n // 0x5b == '['\n name[offset + 1] == 0x5b &&\n // 0x5d == ']'\n name[nextLabel - 1] == 0x5d\n ) {\n // Encrypted label\n (labelHash, ) = bytes(name[offset + 2:nextLabel - 1])\n .hexStringToBytes32(0, 64);\n } else {\n labelHash = keccak256(name[offset + 1:nextLabel]);\n }\n (\n address parentresolver,\n bytes32 parentnode,\n uint256 parentoffset\n ) = findResolver(name, nextLabel);\n bytes32 node = keccak256(abi.encodePacked(parentnode, labelHash));\n address resolver = registry.resolver(node);\n if (resolver != address(0)) {\n return (resolver, node, offset);\n }\n return (parentresolver, node, parentoffset);\n }\n\n function _hasExtendedResolver(\n address resolver\n ) internal view returns (bool) {\n try\n Resolver(resolver).supportsInterface{gas: 50000}(\n type(IExtendedResolver).interfaceId\n )\n returns (bool supported) {\n return supported;\n } catch {\n return false;\n }\n }\n\n function _multicall(\n MulticallData memory multicallData\n ) internal view returns (bytes[] memory results) {\n uint256 length = multicallData.data.length;\n uint256 offchainCount = 0;\n OffchainLookupCallData[]\n memory callDatas = new OffchainLookupCallData[](length);\n OffchainLookupExtraData[]\n memory extraDatas = new OffchainLookupExtraData[](length);\n results = new bytes[](length);\n bool isCallback = multicallData.name.length == 0;\n bool hasExtendedResolver = _hasExtendedResolver(multicallData.resolver);\n\n require(\n !multicallData.isWildcard || hasExtendedResolver,\n \"UniversalResolver: Wildcard on non-extended resolvers is not supported\"\n );\n\n for (uint256 i = 0; i < length; i++) {\n bytes memory item = multicallData.data[i];\n bool failure = multicallData.failures[i];\n if (failure) {\n results[i] = item;\n continue;\n }\n if (!isCallback && hasExtendedResolver) {\n item = abi.encodeCall(\n IExtendedResolver.resolve,\n (multicallData.name, item)\n );\n }\n (\n bool offchain,\n bytes memory returnData,\n OffchainLookupExtraData memory extraData,\n bool success\n ) = callWithOffchainLookupPropagation(multicallData.resolver, item);\n\n if (offchain) {\n callDatas[offchainCount] = abi.decode(\n returnData,\n (OffchainLookupCallData)\n );\n extraDatas[i] = extraData;\n offchainCount += 1;\n continue;\n }\n\n if (success && hasExtendedResolver) {\n // if this is a successful resolve() call, unwrap the result\n returnData = abi.decode(returnData, (bytes));\n }\n results[i] = returnData;\n extraDatas[i].data = multicallData.data[i];\n }\n\n if (offchainCount == 0) {\n return results;\n }\n\n // Trim callDatas if offchain data exists\n assembly {\n mstore(callDatas, offchainCount)\n }\n\n revert OffchainLookup(\n address(this),\n multicallData.gateways,\n abi.encodeWithSelector(BatchGateway.query.selector, callDatas),\n multicallData.callbackFunction,\n abi.encode(\n multicallData.isWildcard,\n multicallData.resolver,\n multicallData.gateways,\n multicallData.metaData,\n extraDatas\n )\n );\n }\n}\n" + }, + "contracts/wrapper/BytesUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nlibrary BytesUtils {\n /*\n * @dev Returns the keccak-256 hash of a byte range.\n * @param self The byte string to hash.\n * @param offset The position to start hashing at.\n * @param len The number of bytes to hash.\n * @return The hash of the byte range.\n */\n function keccak(\n bytes memory self,\n uint256 offset,\n uint256 len\n ) internal pure returns (bytes32 ret) {\n require(offset + len <= self.length);\n assembly {\n ret := keccak256(add(add(self, 32), offset), len)\n }\n }\n\n /**\n * @dev Returns the ENS namehash of a DNS-encoded name.\n * @param self The DNS-encoded name to hash.\n * @param offset The offset at which to start hashing.\n * @return The namehash of the name.\n */\n function namehash(\n bytes memory self,\n uint256 offset\n ) internal pure returns (bytes32) {\n (bytes32 labelhash, uint256 newOffset) = readLabel(self, offset);\n if (labelhash == bytes32(0)) {\n require(offset == self.length - 1, \"namehash: Junk at end of name\");\n return bytes32(0);\n }\n return\n keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));\n }\n\n /**\n * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.\n * @param self The byte string to read a label from.\n * @param idx The index to read a label at.\n * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.\n * @return newIdx The index of the start of the next label.\n */\n function readLabel(\n bytes memory self,\n uint256 idx\n ) internal pure returns (bytes32 labelhash, uint256 newIdx) {\n require(idx < self.length, \"readLabel: Index out of bounds\");\n uint256 len = uint256(uint8(self[idx]));\n if (len > 0) {\n labelhash = keccak(self, idx + 1, len);\n } else {\n labelhash = bytes32(0);\n }\n newIdx = idx + len + 1;\n }\n}\n" + }, + "contracts/wrapper/Controllable.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract Controllable is Ownable {\n mapping(address => bool) public controllers;\n\n event ControllerChanged(address indexed controller, bool active);\n\n function setController(address controller, bool active) public onlyOwner {\n controllers[controller] = active;\n emit ControllerChanged(controller, active);\n }\n\n modifier onlyController() {\n require(\n controllers[msg.sender],\n \"Controllable: Caller is not a controller\"\n );\n _;\n }\n}\n" + }, + "contracts/wrapper/ERC1155Fuse.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\n/* This contract is a variation on ERC1155 with the additions of _setData, getData and _beforeTransfer and ownerOf. _setData and getData allows the use of the other 96 bits next to the address of the owner for extra data. We use this to store 'fuses' that control permissions that can be burnt. 32 bits are used for the fuses themselves and 64 bits are used for the expiry of the name. When a name has expired, its fuses will be be set back to 0 */\n\nabstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(\n address indexed owner,\n address indexed approved,\n uint256 indexed tokenId\n );\n mapping(uint256 => uint256) public _tokens;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n // Mapping from token ID to approved address\n mapping(uint256 => address) internal _tokenApprovals;\n\n /**************************************************************************\n * ERC721 methods\n *************************************************************************/\n\n function ownerOf(uint256 id) public view virtual returns (address) {\n (address owner, , ) = getData(id);\n return owner;\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n address owner = ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(\n uint256 tokenId\n ) public view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override returns (uint256) {\n require(\n account != address(0),\n \"ERC1155: balance query for the zero address\"\n );\n address owner = ownerOf(id);\n if (owner == account) {\n return 1;\n }\n return 0;\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] memory accounts,\n uint256[] memory ids\n ) public view virtual override returns (uint256[] memory) {\n require(\n accounts.length == ids.length,\n \"ERC1155: accounts and ids length mismatch\"\n );\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(\n address operator,\n bool approved\n ) public virtual override {\n require(\n msg.sender != operator,\n \"ERC1155: setting approval status for self\"\n );\n\n _operatorApprovals[msg.sender][operator] = approved;\n emit ApprovalForAll(msg.sender, operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev Returns the Name's owner address and fuses\n */\n function getData(\n uint256 tokenId\n ) public view virtual returns (address owner, uint32 fuses, uint64 expiry) {\n uint256 t = _tokens[tokenId];\n owner = address(uint160(t));\n expiry = uint64(t >> 192);\n fuses = uint32(t >> 160);\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == msg.sender || isApprovedForAll(from, msg.sender),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _transfer(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n ids.length == amounts.length,\n \"ERC1155: ids and amounts length mismatch\"\n );\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == msg.sender || isApprovedForAll(from, msg.sender),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\n\n _beforeTransfer(id, fuses, expiry);\n\n require(\n amount == 1 && oldOwner == from,\n \"ERC1155: insufficient balance for transfer\"\n );\n _setData(id, to, fuses, expiry);\n }\n\n emit TransferBatch(msg.sender, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(\n msg.sender,\n from,\n to,\n ids,\n amounts,\n data\n );\n }\n\n /**************************************************************************\n * Internal/private methods\n *************************************************************************/\n\n /**\n * @dev Sets the Name's owner address and fuses\n */\n function _setData(\n uint256 tokenId,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual {\n _tokens[tokenId] =\n uint256(uint160(owner)) |\n (uint256(fuses) << 160) |\n (uint256(expiry) << 192);\n }\n\n function _beforeTransfer(\n uint256 id,\n uint32 fuses,\n uint64 expiry\n ) internal virtual;\n\n function _clearOwnerAndFuses(\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual returns (address, uint32);\n\n function _mint(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal virtual {\n uint256 tokenId = uint256(node);\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n\n uint32 parentControlledFuses = (uint32(type(uint16).max) << 16) &\n oldFuses;\n\n if (oldExpiry > expiry) {\n expiry = oldExpiry;\n }\n\n if (oldExpiry >= block.timestamp) {\n fuses = fuses | parentControlledFuses;\n }\n\n require(oldOwner == address(0), \"ERC1155: mint of existing token\");\n require(owner != address(0), \"ERC1155: mint to the zero address\");\n require(\n owner != address(this),\n \"ERC1155: newOwner cannot be the NameWrapper contract\"\n );\n\n _setData(tokenId, owner, fuses, expiry);\n emit TransferSingle(msg.sender, address(0x0), owner, tokenId, 1);\n _doSafeTransferAcceptanceCheck(\n msg.sender,\n address(0),\n owner,\n tokenId,\n 1,\n \"\"\n );\n }\n\n function _burn(uint256 tokenId) internal virtual {\n (address oldOwner, uint32 fuses, uint64 expiry) = ERC1155Fuse.getData(\n tokenId\n );\n (, fuses) = _clearOwnerAndFuses(oldOwner, fuses, expiry);\n // Clear approvals\n delete _tokenApprovals[tokenId];\n // Fuses and expiry are kept on burn\n _setData(tokenId, address(0x0), fuses, expiry);\n emit TransferSingle(msg.sender, oldOwner, address(0x0), tokenId, 1);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal {\n (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);\n\n _beforeTransfer(id, fuses, expiry);\n\n require(\n amount == 1 && oldOwner == from,\n \"ERC1155: insufficient balance for transfer\"\n );\n\n if (oldOwner == to) {\n return;\n }\n\n _setData(id, to, fuses, expiry);\n\n emit TransferSingle(msg.sender, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);\n }\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155Received(\n operator,\n from,\n id,\n amount,\n data\n )\n returns (bytes4 response) {\n if (\n response != IERC1155Receiver(to).onERC1155Received.selector\n ) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try\n IERC1155Receiver(to).onERC1155BatchReceived(\n operator,\n from,\n ids,\n amounts,\n data\n )\n returns (bytes4 response) {\n if (\n response !=\n IERC1155Receiver(to).onERC1155BatchReceived.selector\n ) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n /* ERC721 internal functions */\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ownerOf(tokenId), to, tokenId);\n }\n}\n" + }, + "contracts/wrapper/IMetadataService.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface IMetadataService {\n function uri(uint256) external view returns (string memory);\n}\n" + }, + "contracts/wrapper/INameWrapper.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../registry/ENS.sol\";\nimport \"../ethregistrar/IBaseRegistrar.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport \"./IMetadataService.sol\";\nimport \"./INameWrapperUpgrade.sol\";\n\nuint32 constant CANNOT_UNWRAP = 1;\nuint32 constant CANNOT_BURN_FUSES = 2;\nuint32 constant CANNOT_TRANSFER = 4;\nuint32 constant CANNOT_SET_RESOLVER = 8;\nuint32 constant CANNOT_SET_TTL = 16;\nuint32 constant CANNOT_CREATE_SUBDOMAIN = 32;\nuint32 constant CANNOT_APPROVE = 64;\n//uint16 reserved for parent controlled fuses from bit 17 to bit 32\nuint32 constant PARENT_CANNOT_CONTROL = 1 << 16;\nuint32 constant IS_DOT_ETH = 1 << 17;\nuint32 constant CAN_EXTEND_EXPIRY = 1 << 18;\nuint32 constant CAN_DO_EVERYTHING = 0;\nuint32 constant PARENT_CONTROLLED_FUSES = 0xFFFF0000;\n// all fuses apart from IS_DOT_ETH\nuint32 constant USER_SETTABLE_FUSES = 0xFFFDFFFF;\n\ninterface INameWrapper is IERC1155 {\n event NameWrapped(\n bytes32 indexed node,\n bytes name,\n address owner,\n uint32 fuses,\n uint64 expiry\n );\n\n event NameUnwrapped(bytes32 indexed node, address owner);\n\n event FusesSet(bytes32 indexed node, uint32 fuses);\n event ExpiryExtended(bytes32 indexed node, uint64 expiry);\n\n function ens() external view returns (ENS);\n\n function registrar() external view returns (IBaseRegistrar);\n\n function metadataService() external view returns (IMetadataService);\n\n function names(bytes32) external view returns (bytes memory);\n\n function name() external view returns (string memory);\n\n function upgradeContract() external view returns (INameWrapperUpgrade);\n\n function supportsInterface(bytes4 interfaceID) external view returns (bool);\n\n function wrap(\n bytes calldata name,\n address wrappedOwner,\n address resolver\n ) external;\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint16 ownerControlledFuses,\n address resolver\n ) external returns (uint64 expires);\n\n function registerAndWrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint256 duration,\n address resolver,\n uint16 ownerControlledFuses\n ) external returns (uint256 registrarExpiry);\n\n function renew(\n uint256 labelHash,\n uint256 duration\n ) external returns (uint256 expires);\n\n function unwrap(bytes32 node, bytes32 label, address owner) external;\n\n function unwrapETH2LD(\n bytes32 label,\n address newRegistrant,\n address newController\n ) external;\n\n function upgrade(bytes calldata name, bytes calldata extraData) external;\n\n function setFuses(\n bytes32 node,\n uint16 ownerControlledFuses\n ) external returns (uint32 newFuses);\n\n function setChildFuses(\n bytes32 parentNode,\n bytes32 labelhash,\n uint32 fuses,\n uint64 expiry\n ) external;\n\n function setSubnodeRecord(\n bytes32 node,\n string calldata label,\n address owner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) external returns (bytes32);\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeOwner(\n bytes32 node,\n string calldata label,\n address newOwner,\n uint32 fuses,\n uint64 expiry\n ) external returns (bytes32);\n\n function extendExpiry(\n bytes32 node,\n bytes32 labelhash,\n uint64 expiry\n ) external returns (uint64);\n\n function canModifyName(\n bytes32 node,\n address addr\n ) external view returns (bool);\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function ownerOf(uint256 id) external view returns (address owner);\n\n function approve(address to, uint256 tokenId) external;\n\n function getApproved(uint256 tokenId) external view returns (address);\n\n function getData(\n uint256 id\n ) external view returns (address, uint32, uint64);\n\n function setMetadataService(IMetadataService _metadataService) external;\n\n function uri(uint256 tokenId) external view returns (string memory);\n\n function setUpgradeContract(INameWrapperUpgrade _upgradeAddress) external;\n\n function allFusesBurned(\n bytes32 node,\n uint32 fuseMask\n ) external view returns (bool);\n\n function isWrapped(bytes32) external view returns (bool);\n\n function isWrapped(bytes32, bytes32) external view returns (bool);\n}\n" + }, + "contracts/wrapper/INameWrapperUpgrade.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface INameWrapperUpgrade {\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) external;\n}\n" + }, + "contracts/wrapper/mocks/ERC1155ReceiverMock.sol": { + "content": "// Based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.1.0/test/token/ERC1155/ERC1155.behaviour.js\n// Copyright (c) 2016-2020 zOS Global Limited\n\n// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract ERC1155ReceiverMock is IERC1155Receiver, ERC165 {\n bytes4 private _recRetval;\n bool private _recReverts;\n bytes4 private _batRetval;\n bool private _batReverts;\n\n event Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes data\n );\n event BatchReceived(\n address operator,\n address from,\n uint256[] ids,\n uint256[] values,\n bytes data\n );\n\n constructor(\n bytes4 recRetval,\n bool recReverts,\n bytes4 batRetval,\n bool batReverts\n ) {\n _recRetval = recRetval;\n _recReverts = recReverts;\n _batRetval = batRetval;\n _batReverts = batReverts;\n }\n\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external override returns (bytes4) {\n require(!_recReverts, \"ERC1155ReceiverMock: reverting on receive\");\n emit Received(operator, from, id, value, data);\n return _recRetval;\n }\n\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external override returns (bytes4) {\n require(\n !_batReverts,\n \"ERC1155ReceiverMock: reverting on batch receive\"\n );\n emit BatchReceived(operator, from, ids, values, data);\n return _batRetval;\n }\n}\n" + }, + "contracts/wrapper/mocks/TestUnwrap.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\nimport \"../../registry/ENS.sol\";\nimport \"../../ethregistrar/IBaseRegistrar.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract TestUnwrap is Ownable {\n using BytesUtils for bytes;\n\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n mapping(address => bool) public approvedWrapper;\n\n constructor(ENS _ens, IBaseRegistrar _registrar) {\n ens = _ens;\n registrar = _registrar;\n }\n\n function setWrapperApproval(\n address wrapper,\n bool approved\n ) public onlyOwner {\n approvedWrapper[wrapper] = approved;\n }\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) public {\n _unwrapETH2LD(keccak256(bytes(label)), wrappedOwner, msg.sender);\n }\n\n function setSubnodeRecord(\n bytes32 parentNode,\n string memory label,\n address newOwner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) public {\n bytes32 node = _makeNode(parentNode, keccak256(bytes(label)));\n _unwrapSubnode(node, newOwner, msg.sender);\n }\n\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (parentNode == ETH_NODE) {\n _unwrapETH2LD(labelhash, wrappedOwner, msg.sender);\n } else {\n _unwrapSubnode(node, wrappedOwner, msg.sender);\n }\n }\n\n function _unwrapETH2LD(\n bytes32 labelhash,\n address wrappedOwner,\n address sender\n ) private {\n uint256 tokenId = uint256(labelhash);\n address registrant = registrar.ownerOf(tokenId);\n\n require(\n approvedWrapper[sender] &&\n sender == registrant &&\n registrar.isApprovedForAll(registrant, address(this)),\n \"Unauthorised\"\n );\n\n registrar.reclaim(tokenId, wrappedOwner);\n registrar.transferFrom(registrant, wrappedOwner, tokenId);\n }\n\n function _unwrapSubnode(\n bytes32 node,\n address newOwner,\n address sender\n ) private {\n address owner = ens.owner(node);\n\n require(\n approvedWrapper[sender] &&\n owner == sender &&\n ens.isApprovedForAll(owner, address(this)),\n \"Unauthorised\"\n );\n\n ens.setOwner(node, newOwner);\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n}\n" + }, + "contracts/wrapper/mocks/UpgradedNameWrapperMock.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\nimport {INameWrapperUpgrade} from \"../INameWrapperUpgrade.sol\";\nimport \"../../registry/ENS.sol\";\nimport \"../../ethregistrar/IBaseRegistrar.sol\";\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract UpgradedNameWrapperMock is INameWrapperUpgrade {\n using BytesUtils for bytes;\n\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n\n constructor(ENS _ens, IBaseRegistrar _registrar) {\n ens = _ens;\n registrar = _registrar;\n }\n\n event NameUpgraded(\n bytes name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes extraData\n );\n\n function wrapFromUpgrade(\n bytes calldata name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address approved,\n bytes calldata extraData\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (parentNode == ETH_NODE) {\n address registrant = registrar.ownerOf(uint256(labelhash));\n require(\n msg.sender == registrant &&\n registrar.isApprovedForAll(registrant, address(this)),\n \"No approval for registrar\"\n );\n } else {\n address owner = ens.owner(node);\n require(\n msg.sender == owner &&\n ens.isApprovedForAll(owner, address(this)),\n \"No approval for registry\"\n );\n }\n emit NameUpgraded(\n name,\n wrappedOwner,\n fuses,\n expiry,\n approved,\n extraData\n );\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n}\n" + }, + "contracts/wrapper/NameWrapper.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {ERC1155Fuse, IERC165, IERC1155MetadataURI} from \"./ERC1155Fuse.sol\";\nimport {Controllable} from \"./Controllable.sol\";\nimport {INameWrapper, CANNOT_UNWRAP, CANNOT_BURN_FUSES, CANNOT_TRANSFER, CANNOT_SET_RESOLVER, CANNOT_SET_TTL, CANNOT_CREATE_SUBDOMAIN, CANNOT_APPROVE, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING, IS_DOT_ETH, CAN_EXTEND_EXPIRY, PARENT_CONTROLLED_FUSES, USER_SETTABLE_FUSES} from \"./INameWrapper.sol\";\nimport {INameWrapperUpgrade} from \"./INameWrapperUpgrade.sol\";\nimport {IMetadataService} from \"./IMetadataService.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IReverseRegistrar} from \"../reverseRegistrar/IReverseRegistrar.sol\";\nimport {ReverseClaimer} from \"../reverseRegistrar/ReverseClaimer.sol\";\nimport {IBaseRegistrar} from \"../ethregistrar/IBaseRegistrar.sol\";\nimport {IERC721Receiver} from \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {BytesUtils} from \"./BytesUtils.sol\";\nimport {ERC20Recoverable} from \"../utils/ERC20Recoverable.sol\";\n\nerror Unauthorised(bytes32 node, address addr);\nerror IncompatibleParent();\nerror IncorrectTokenType();\nerror LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);\nerror LabelTooShort();\nerror LabelTooLong(string label);\nerror IncorrectTargetOwner(address owner);\nerror CannotUpgrade();\nerror OperationProhibited(bytes32 node);\nerror NameIsNotWrapped();\nerror NameIsStillExpired();\n\ncontract NameWrapper is\n Ownable,\n ERC1155Fuse,\n INameWrapper,\n Controllable,\n IERC721Receiver,\n ERC20Recoverable,\n ReverseClaimer\n{\n using BytesUtils for bytes;\n\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n IMetadataService public metadataService;\n mapping(bytes32 => bytes) public names;\n string public constant name = \"NameWrapper\";\n\n uint64 private constant GRACE_PERIOD = 90 days;\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\n bytes32 private constant ETH_LABELHASH =\n 0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0;\n bytes32 private constant ROOT_NODE =\n 0x0000000000000000000000000000000000000000000000000000000000000000;\n\n INameWrapperUpgrade public upgradeContract;\n uint64 private constant MAX_EXPIRY = type(uint64).max;\n\n constructor(\n ENS _ens,\n IBaseRegistrar _registrar,\n IMetadataService _metadataService\n ) ReverseClaimer(_ens, msg.sender) {\n ens = _ens;\n registrar = _registrar;\n metadataService = _metadataService;\n\n /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE and ETH_NODE and set expiry to max */\n\n _setData(\n uint256(ETH_NODE),\n address(0),\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\n MAX_EXPIRY\n );\n _setData(\n uint256(ROOT_NODE),\n address(0),\n uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),\n MAX_EXPIRY\n );\n names[ROOT_NODE] = \"\\x00\";\n names[ETH_NODE] = \"\\x03eth\\x00\";\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC1155Fuse, INameWrapper) returns (bool) {\n return\n interfaceId == type(INameWrapper).interfaceId ||\n interfaceId == type(IERC721Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /* ERC1155 Fuse */\n\n /**\n * @notice Gets the owner of a name\n * @param id Label as a string of the .eth domain to wrap\n * @return owner The owner of the name\n */\n\n function ownerOf(\n uint256 id\n ) public view override(ERC1155Fuse, INameWrapper) returns (address owner) {\n return super.ownerOf(id);\n }\n\n /**\n * @notice Gets the owner of a name\n * @param id Namehash of the name\n * @return operator Approved operator of a name\n */\n\n function getApproved(\n uint256 id\n )\n public\n view\n override(ERC1155Fuse, INameWrapper)\n returns (address operator)\n {\n address owner = ownerOf(id);\n if (owner == address(0)) {\n return address(0);\n }\n return super.getApproved(id);\n }\n\n /**\n * @notice Approves an address for a name\n * @param to address to approve\n * @param tokenId name to approve\n */\n\n function approve(\n address to,\n uint256 tokenId\n ) public override(ERC1155Fuse, INameWrapper) {\n (, uint32 fuses, ) = getData(tokenId);\n if (fuses & CANNOT_APPROVE == CANNOT_APPROVE) {\n revert OperationProhibited(bytes32(tokenId));\n }\n super.approve(to, tokenId);\n }\n\n /**\n * @notice Gets the data for a name\n * @param id Namehash of the name\n * @return owner Owner of the name\n * @return fuses Fuses of the name\n * @return expiry Expiry of the name\n */\n\n function getData(\n uint256 id\n )\n public\n view\n override(ERC1155Fuse, INameWrapper)\n returns (address owner, uint32 fuses, uint64 expiry)\n {\n (owner, fuses, expiry) = super.getData(id);\n\n (owner, fuses) = _clearOwnerAndFuses(owner, fuses, expiry);\n }\n\n /* Metadata service */\n\n /**\n * @notice Set the metadata service. Only the owner can do this\n * @param _metadataService The new metadata service\n */\n\n function setMetadataService(\n IMetadataService _metadataService\n ) public onlyOwner {\n metadataService = _metadataService;\n }\n\n /**\n * @notice Get the metadata uri\n * @param tokenId The id of the token\n * @return string uri of the metadata service\n */\n\n function uri(\n uint256 tokenId\n )\n public\n view\n override(INameWrapper, IERC1155MetadataURI)\n returns (string memory)\n {\n return metadataService.uri(tokenId);\n }\n\n /**\n * @notice Set the address of the upgradeContract of the contract. only admin can do this\n * @dev The default value of upgradeContract is the 0 address. Use the 0 address at any time\n * to make the contract not upgradable.\n * @param _upgradeAddress address of an upgraded contract\n */\n\n function setUpgradeContract(\n INameWrapperUpgrade _upgradeAddress\n ) public onlyOwner {\n if (address(upgradeContract) != address(0)) {\n registrar.setApprovalForAll(address(upgradeContract), false);\n ens.setApprovalForAll(address(upgradeContract), false);\n }\n\n upgradeContract = _upgradeAddress;\n\n if (address(upgradeContract) != address(0)) {\n registrar.setApprovalForAll(address(upgradeContract), true);\n ens.setApprovalForAll(address(upgradeContract), true);\n }\n }\n\n /**\n * @notice Checks if msg.sender is the owner or operator of the owner of a name\n * @param node namehash of the name to check\n */\n\n modifier onlyTokenOwner(bytes32 node) {\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n _;\n }\n\n /**\n * @notice Checks if owner or operator of the owner\n * @param node namehash of the name to check\n * @param addr which address to check permissions for\n * @return whether or not is owner or operator\n */\n\n function canModifyName(\n bytes32 node,\n address addr\n ) public view returns (bool) {\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\n return\n (owner == addr || isApprovedForAll(owner, addr)) &&\n !_isETH2LDInGracePeriod(fuses, expiry);\n }\n\n /**\n * @notice Checks if owner/operator or approved by owner\n * @param node namehash of the name to check\n * @param addr which address to check permissions for\n * @return whether or not is owner/operator or approved\n */\n\n function canExtendSubnames(\n bytes32 node,\n address addr\n ) public view returns (bool) {\n (address owner, uint32 fuses, uint64 expiry) = getData(uint256(node));\n return\n (owner == addr ||\n isApprovedForAll(owner, addr) ||\n getApproved(uint256(node)) == addr) &&\n !_isETH2LDInGracePeriod(fuses, expiry);\n }\n\n /**\n * @notice Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract\n * @dev Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar\n * @param label Label as a string of the .eth domain to wrap\n * @param wrappedOwner Owner of the name in this contract\n * @param ownerControlledFuses Initial owner-controlled fuses to set\n * @param resolver Resolver contract address\n */\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint16 ownerControlledFuses,\n address resolver\n ) public returns (uint64 expiry) {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n address registrant = registrar.ownerOf(tokenId);\n if (\n registrant != msg.sender &&\n !registrar.isApprovedForAll(registrant, msg.sender)\n ) {\n revert Unauthorised(\n _makeNode(ETH_NODE, bytes32(tokenId)),\n msg.sender\n );\n }\n\n // transfer the token from the user to this contract\n registrar.transferFrom(registrant, address(this), tokenId);\n\n // transfer the ens record back to the new owner (this contract)\n registrar.reclaim(tokenId, address(this));\n\n expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\n\n _wrapETH2LD(\n label,\n wrappedOwner,\n ownerControlledFuses,\n expiry,\n resolver\n );\n }\n\n /**\n * @dev Registers a new .eth second-level domain and wraps it.\n * Only callable by authorised controllers.\n * @param label The label to register (Eg, 'foo' for 'foo.eth').\n * @param wrappedOwner The owner of the wrapped name.\n * @param duration The duration, in seconds, to register the name for.\n * @param resolver The resolver address to set on the ENS registry (optional).\n * @param ownerControlledFuses Initial owner-controlled fuses to set\n * @return registrarExpiry The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch.\n */\n\n function registerAndWrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint256 duration,\n address resolver,\n uint16 ownerControlledFuses\n ) external onlyController returns (uint256 registrarExpiry) {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n registrarExpiry = registrar.register(tokenId, address(this), duration);\n _wrapETH2LD(\n label,\n wrappedOwner,\n ownerControlledFuses,\n uint64(registrarExpiry) + GRACE_PERIOD,\n resolver\n );\n }\n\n /**\n * @notice Renews a .eth second-level domain.\n * @dev Only callable by authorised controllers.\n * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth').\n * @param duration The number of seconds to renew the name for.\n * @return expires The expiry date of the name on the .eth registrar, in seconds since the Unix epoch.\n */\n\n function renew(\n uint256 tokenId,\n uint256 duration\n ) external onlyController returns (uint256 expires) {\n bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));\n\n uint256 registrarExpiry = registrar.renew(tokenId, duration);\n\n // Do not set anything in wrapper if name is not wrapped\n try registrar.ownerOf(tokenId) returns (address registrarOwner) {\n if (\n registrarOwner != address(this) ||\n ens.owner(node) != address(this)\n ) {\n return registrarExpiry;\n }\n } catch {\n return registrarExpiry;\n }\n\n // Set expiry in Wrapper\n uint64 expiry = uint64(registrarExpiry) + GRACE_PERIOD;\n\n // Use super to allow names expired on the wrapper, but not expired on the registrar to renew()\n (address owner, uint32 fuses, ) = super.getData(uint256(node));\n _setData(node, owner, fuses, expiry);\n\n return registrarExpiry;\n }\n\n /**\n * @notice Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\n * @dev Can be called by the owner in the registry or an authorised caller in the registry\n * @param name The name to wrap, in DNS format\n * @param wrappedOwner Owner of the name in this contract\n * @param resolver Resolver contract\n */\n\n function wrap(\n bytes calldata name,\n address wrappedOwner,\n address resolver\n ) public {\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n bytes32 node = _makeNode(parentNode, labelhash);\n\n names[node] = name;\n\n if (parentNode == ETH_NODE) {\n revert IncompatibleParent();\n }\n\n address owner = ens.owner(node);\n\n if (owner != msg.sender && !ens.isApprovedForAll(owner, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n if (resolver != address(0)) {\n ens.setResolver(node, resolver);\n }\n\n ens.setOwner(node, address(this));\n\n _wrap(node, name, wrappedOwner, 0, 0);\n }\n\n /**\n * @notice Unwraps a .eth domain. e.g. vitalik.eth\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\n * @param labelhash Labelhash of the .eth domain\n * @param registrant Sets the owner in the .eth registrar to this address\n * @param controller Sets the owner in the registry to this address\n */\n\n function unwrapETH2LD(\n bytes32 labelhash,\n address registrant,\n address controller\n ) public onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {\n if (registrant == address(this)) {\n revert IncorrectTargetOwner(registrant);\n }\n _unwrap(_makeNode(ETH_NODE, labelhash), controller);\n registrar.safeTransferFrom(\n address(this),\n registrant,\n uint256(labelhash)\n );\n }\n\n /**\n * @notice Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\n * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param controller Sets the owner in the registry to this address\n */\n\n function unwrap(\n bytes32 parentNode,\n bytes32 labelhash,\n address controller\n ) public onlyTokenOwner(_makeNode(parentNode, labelhash)) {\n if (parentNode == ETH_NODE) {\n revert IncompatibleParent();\n }\n if (controller == address(0x0) || controller == address(this)) {\n revert IncorrectTargetOwner(controller);\n }\n _unwrap(_makeNode(parentNode, labelhash), controller);\n }\n\n /**\n * @notice Sets fuses of a name\n * @param node Namehash of the name\n * @param ownerControlledFuses Owner-controlled fuses to burn\n * @return Old fuses\n */\n\n function setFuses(\n bytes32 node,\n uint16 ownerControlledFuses\n )\n public\n onlyTokenOwner(node)\n operationAllowed(node, CANNOT_BURN_FUSES)\n returns (uint32)\n {\n // owner protected by onlyTokenOwner\n (address owner, uint32 oldFuses, uint64 expiry) = getData(\n uint256(node)\n );\n _setFuses(node, owner, ownerControlledFuses | oldFuses, expiry, expiry);\n return oldFuses;\n }\n\n /**\n * @notice Extends expiry for a name\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return New expiry\n */\n\n function extendExpiry(\n bytes32 parentNode,\n bytes32 labelhash,\n uint64 expiry\n ) public returns (uint64) {\n bytes32 node = _makeNode(parentNode, labelhash);\n\n if (!_isWrapped(node)) {\n revert NameIsNotWrapped();\n }\n\n // this flag is used later, when checking fuses\n bool canExtendSubname = canExtendSubnames(parentNode, msg.sender);\n // only allow the owner of the name or owner of the parent name\n if (!canExtendSubname && !canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n (address owner, uint32 fuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n\n // Either CAN_EXTEND_EXPIRY must be set, or the caller must have permission to modify the parent name\n if (!canExtendSubname && fuses & CAN_EXTEND_EXPIRY == 0) {\n revert OperationProhibited(node);\n }\n\n // Max expiry is set to the expiry of the parent\n (, , uint64 maxExpiry) = getData(uint256(parentNode));\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n\n _setData(node, owner, fuses, expiry);\n emit ExpiryExtended(node, expiry);\n return expiry;\n }\n\n /**\n * @notice Upgrades a domain of any kind. Could be a .eth name vitalik.eth, a DNSSEC name vitalik.xyz, or a subdomain\n * @dev Can be called by the owner or an authorised caller\n * @param name The name to upgrade, in DNS format\n * @param extraData Extra data to pass to the upgrade contract\n */\n\n function upgrade(bytes calldata name, bytes calldata extraData) public {\n bytes32 node = name.namehash(0);\n\n if (address(upgradeContract) == address(0)) {\n revert CannotUpgrade();\n }\n\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n (address currentOwner, uint32 fuses, uint64 expiry) = getData(\n uint256(node)\n );\n\n address approved = getApproved(uint256(node));\n\n _burn(uint256(node));\n\n upgradeContract.wrapFromUpgrade(\n name,\n currentOwner,\n fuses,\n expiry,\n approved,\n extraData\n );\n }\n\n /** \n /* @notice Sets fuses of a name that you own the parent of\n * @param parentNode Parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')\n * @param labelhash Labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')\n * @param fuses Fuses to burn\n * @param expiry When the name will expire in seconds since the Unix epoch\n */\n\n function setChildFuses(\n bytes32 parentNode,\n bytes32 labelhash,\n uint32 fuses,\n uint64 expiry\n ) public {\n bytes32 node = _makeNode(parentNode, labelhash);\n _checkFusesAreSettable(node, fuses);\n (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n if (owner == address(0) || ens.owner(node) != address(this)) {\n revert NameIsNotWrapped();\n }\n // max expiry is set to the expiry of the parent\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\n if (parentNode == ROOT_NODE) {\n if (!canModifyName(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n } else {\n if (!canModifyName(parentNode, msg.sender)) {\n revert Unauthorised(parentNode, msg.sender);\n }\n }\n\n _checkParentFuses(node, fuses, parentFuses);\n\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n\n // if PARENT_CANNOT_CONTROL has been burned and fuses have changed\n if (\n oldFuses & PARENT_CANNOT_CONTROL != 0 &&\n oldFuses | fuses != oldFuses\n ) {\n revert OperationProhibited(node);\n }\n fuses |= oldFuses;\n _setFuses(node, owner, fuses, oldExpiry, expiry);\n }\n\n /**\n * @notice Sets the subdomain owner in the registry and then wraps the subdomain\n * @param parentNode Parent namehash of the subdomain\n * @param label Label of the subdomain as a string\n * @param owner New owner in the wrapper\n * @param fuses Initial fuses for the wrapped subdomain\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return node Namehash of the subdomain\n */\n\n function setSubnodeOwner(\n bytes32 parentNode,\n string calldata label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\n _checkCanCallSetSubnodeOwner(parentNode, node);\n _checkFusesAreSettable(node, fuses);\n bytes memory name = _saveLabel(parentNode, node, label);\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\n\n if (!_isWrapped(node)) {\n ens.setSubnodeOwner(parentNode, labelhash, address(this));\n _wrap(node, name, owner, fuses, expiry);\n } else {\n _updateName(parentNode, node, label, owner, fuses, expiry);\n }\n }\n\n /**\n * @notice Sets the subdomain owner in the registry with records and then wraps the subdomain\n * @param parentNode parent namehash of the subdomain\n * @param label label of the subdomain as a string\n * @param owner new owner in the wrapper\n * @param resolver resolver contract in the registry\n * @param ttl ttl in the registry\n * @param fuses initial fuses for the wrapped subdomain\n * @param expiry When the name will expire in seconds since the Unix epoch\n * @return node Namehash of the subdomain\n */\n\n function setSubnodeRecord(\n bytes32 parentNode,\n string memory label,\n address owner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) public onlyTokenOwner(parentNode) returns (bytes32 node) {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\n _checkCanCallSetSubnodeOwner(parentNode, node);\n _checkFusesAreSettable(node, fuses);\n _saveLabel(parentNode, node, label);\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\n if (!_isWrapped(node)) {\n ens.setSubnodeRecord(\n parentNode,\n labelhash,\n address(this),\n resolver,\n ttl\n );\n _storeNameAndWrap(parentNode, node, label, owner, fuses, expiry);\n } else {\n ens.setSubnodeRecord(\n parentNode,\n labelhash,\n address(this),\n resolver,\n ttl\n );\n _updateName(parentNode, node, label, owner, fuses, expiry);\n }\n }\n\n /**\n * @notice Sets records for the name in the ENS Registry\n * @param node Namehash of the name to set a record for\n * @param owner New owner in the registry\n * @param resolver Resolver contract\n * @param ttl Time to live in the registry\n */\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n )\n public\n onlyTokenOwner(node)\n operationAllowed(\n node,\n CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL\n )\n {\n ens.setRecord(node, address(this), resolver, ttl);\n if (owner == address(0)) {\n (, uint32 fuses, ) = getData(uint256(node));\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\n revert IncorrectTargetOwner(owner);\n }\n _unwrap(node, address(0));\n } else {\n address oldOwner = ownerOf(uint256(node));\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\n }\n }\n\n /**\n * @notice Sets resolver contract in the registry\n * @param node namehash of the name\n * @param resolver the resolver contract\n */\n\n function setResolver(\n bytes32 node,\n address resolver\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_RESOLVER) {\n ens.setResolver(node, resolver);\n }\n\n /**\n * @notice Sets TTL in the registry\n * @param node Namehash of the name\n * @param ttl TTL in the registry\n */\n\n function setTTL(\n bytes32 node,\n uint64 ttl\n ) public onlyTokenOwner(node) operationAllowed(node, CANNOT_SET_TTL) {\n ens.setTTL(node, ttl);\n }\n\n /**\n * @dev Allows an operation only if none of the specified fuses are burned.\n * @param node The namehash of the name to check fuses on.\n * @param fuseMask A bitmask of fuses that must not be burned.\n */\n\n modifier operationAllowed(bytes32 node, uint32 fuseMask) {\n (, uint32 fuses, ) = getData(uint256(node));\n if (fuses & fuseMask != 0) {\n revert OperationProhibited(node);\n }\n _;\n }\n\n /**\n * @notice Check whether a name can call setSubnodeOwner/setSubnodeRecord\n * @dev Checks both CANNOT_CREATE_SUBDOMAIN and PARENT_CANNOT_CONTROL and whether not they have been burnt\n * and checks whether the owner of the subdomain is 0x0 for creating or already exists for\n * replacing a subdomain. If either conditions are true, then it is possible to call\n * setSubnodeOwner\n * @param parentNode Namehash of the parent name to check\n * @param subnode Namehash of the subname to check\n */\n\n function _checkCanCallSetSubnodeOwner(\n bytes32 parentNode,\n bytes32 subnode\n ) internal view {\n (\n address subnodeOwner,\n uint32 subnodeFuses,\n uint64 subnodeExpiry\n ) = getData(uint256(subnode));\n\n // check if the registry owner is 0 and expired\n // check if the wrapper owner is 0 and expired\n // If either, then check parent fuses for CANNOT_CREATE_SUBDOMAIN\n bool expired = subnodeExpiry < block.timestamp;\n if (\n expired &&\n // protects a name that has been unwrapped with PCC and doesn't allow the parent to take control by recreating it if unexpired\n (subnodeOwner == address(0) ||\n // protects a name that has been burnt and doesn't allow the parent to take control by recreating it if unexpired\n ens.owner(subnode) == address(0))\n ) {\n (, uint32 parentFuses, ) = getData(uint256(parentNode));\n if (parentFuses & CANNOT_CREATE_SUBDOMAIN != 0) {\n revert OperationProhibited(subnode);\n }\n } else {\n if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {\n revert OperationProhibited(subnode);\n }\n }\n }\n\n /**\n * @notice Checks all Fuses in the mask are burned for the node\n * @param node Namehash of the name\n * @param fuseMask The fuses you want to check\n * @return Boolean of whether or not all the selected fuses are burned\n */\n\n function allFusesBurned(\n bytes32 node,\n uint32 fuseMask\n ) public view returns (bool) {\n (, uint32 fuses, ) = getData(uint256(node));\n return fuses & fuseMask == fuseMask;\n }\n\n /**\n * @notice Checks if a name is wrapped\n * @param node Namehash of the name\n * @return Boolean of whether or not the name is wrapped\n */\n\n function isWrapped(bytes32 node) public view returns (bool) {\n bytes memory name = names[node];\n if (name.length == 0) {\n return false;\n }\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n return isWrapped(parentNode, labelhash);\n }\n\n /**\n * @notice Checks if a name is wrapped in a more gas efficient way\n * @param parentNode Namehash of the name\n * @param labelhash Namehash of the name\n * @return Boolean of whether or not the name is wrapped\n */\n\n function isWrapped(\n bytes32 parentNode,\n bytes32 labelhash\n ) public view returns (bool) {\n bytes32 node = _makeNode(parentNode, labelhash);\n bool wrapped = _isWrapped(node);\n if (parentNode != ETH_NODE) {\n return wrapped;\n }\n try registrar.ownerOf(uint256(labelhash)) returns (address owner) {\n return owner == address(this);\n } catch {\n return false;\n }\n }\n\n function onERC721Received(\n address to,\n address,\n uint256 tokenId,\n bytes calldata data\n ) public returns (bytes4) {\n //check if it's the eth registrar ERC721\n if (msg.sender != address(registrar)) {\n revert IncorrectTokenType();\n }\n\n (\n string memory label,\n address owner,\n uint16 ownerControlledFuses,\n address resolver\n ) = abi.decode(data, (string, address, uint16, address));\n\n bytes32 labelhash = bytes32(tokenId);\n bytes32 labelhashFromData = keccak256(bytes(label));\n\n if (labelhashFromData != labelhash) {\n revert LabelMismatch(labelhashFromData, labelhash);\n }\n\n // transfer the ens record back to the new owner (this contract)\n registrar.reclaim(uint256(labelhash), address(this));\n\n uint64 expiry = uint64(registrar.nameExpires(tokenId)) + GRACE_PERIOD;\n\n _wrapETH2LD(label, owner, ownerControlledFuses, expiry, resolver);\n\n return IERC721Receiver(to).onERC721Received.selector;\n }\n\n /***** Internal functions */\n\n function _beforeTransfer(\n uint256 id,\n uint32 fuses,\n uint64 expiry\n ) internal override {\n // For this check, treat .eth 2LDs as expiring at the start of the grace period.\n if (fuses & IS_DOT_ETH == IS_DOT_ETH) {\n expiry -= GRACE_PERIOD;\n }\n\n if (expiry < block.timestamp) {\n // Transferable if the name was not emancipated\n if (fuses & PARENT_CANNOT_CONTROL != 0) {\n revert(\"ERC1155: insufficient balance for transfer\");\n }\n } else {\n // Transferable if CANNOT_TRANSFER is unburned\n if (fuses & CANNOT_TRANSFER != 0) {\n revert OperationProhibited(bytes32(id));\n }\n }\n\n // delete token approval if CANNOT_APPROVE has not been burnt\n if (fuses & CANNOT_APPROVE == 0) {\n delete _tokenApprovals[id];\n }\n }\n\n function _clearOwnerAndFuses(\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal view override returns (address, uint32) {\n if (expiry < block.timestamp) {\n if (fuses & PARENT_CANNOT_CONTROL == PARENT_CANNOT_CONTROL) {\n owner = address(0);\n }\n fuses = 0;\n }\n\n return (owner, fuses);\n }\n\n function _makeNode(\n bytes32 node,\n bytes32 labelhash\n ) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n\n function _addLabel(\n string memory label,\n bytes memory name\n ) internal pure returns (bytes memory ret) {\n if (bytes(label).length < 1) {\n revert LabelTooShort();\n }\n if (bytes(label).length > 255) {\n revert LabelTooLong(label);\n }\n return abi.encodePacked(uint8(bytes(label).length), label, name);\n }\n\n function _mint(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal override {\n _canFusesBeBurned(node, fuses);\n (address oldOwner, , ) = super.getData(uint256(node));\n if (oldOwner != address(0)) {\n // burn and unwrap old token of old owner\n _burn(uint256(node));\n emit NameUnwrapped(node, address(0));\n }\n super._mint(node, owner, fuses, expiry);\n }\n\n function _wrap(\n bytes32 node,\n bytes memory name,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n _mint(node, wrappedOwner, fuses, expiry);\n emit NameWrapped(node, name, wrappedOwner, fuses, expiry);\n }\n\n function _storeNameAndWrap(\n bytes32 parentNode,\n bytes32 node,\n string memory label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n bytes memory name = _addLabel(label, names[parentNode]);\n _wrap(node, name, owner, fuses, expiry);\n }\n\n function _saveLabel(\n bytes32 parentNode,\n bytes32 node,\n string memory label\n ) internal returns (bytes memory) {\n bytes memory name = _addLabel(label, names[parentNode]);\n names[node] = name;\n return name;\n }\n\n function _updateName(\n bytes32 parentNode,\n bytes32 node,\n string memory label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n bytes memory name = _addLabel(label, names[parentNode]);\n if (names[node].length == 0) {\n names[node] = name;\n }\n _setFuses(node, oldOwner, oldFuses | fuses, oldExpiry, expiry);\n if (owner == address(0)) {\n _unwrap(node, address(0));\n } else {\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\n }\n }\n\n // wrapper function for stack limit\n function _checkParentFusesAndExpiry(\n bytes32 parentNode,\n bytes32 node,\n uint32 fuses,\n uint64 expiry\n ) internal view returns (uint64) {\n (, , uint64 oldExpiry) = getData(uint256(node));\n (, uint32 parentFuses, uint64 maxExpiry) = getData(uint256(parentNode));\n _checkParentFuses(node, fuses, parentFuses);\n return _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n }\n\n function _checkParentFuses(\n bytes32 node,\n uint32 fuses,\n uint32 parentFuses\n ) internal pure {\n bool isBurningParentControlledFuses = fuses & PARENT_CONTROLLED_FUSES !=\n 0;\n\n bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;\n\n if (isBurningParentControlledFuses && parentHasNotBurnedCU) {\n revert OperationProhibited(node);\n }\n }\n\n function _normaliseExpiry(\n uint64 expiry,\n uint64 oldExpiry,\n uint64 maxExpiry\n ) private pure returns (uint64) {\n // Expiry cannot be more than maximum allowed\n // .eth names will check registrar, non .eth check parent\n if (expiry > maxExpiry) {\n expiry = maxExpiry;\n }\n // Expiry cannot be less than old expiry\n if (expiry < oldExpiry) {\n expiry = oldExpiry;\n }\n\n return expiry;\n }\n\n function _wrapETH2LD(\n string memory label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) private {\n bytes32 labelhash = keccak256(bytes(label));\n bytes32 node = _makeNode(ETH_NODE, labelhash);\n // hardcode dns-encoded eth string for gas savings\n bytes memory name = _addLabel(label, \"\\x03eth\\x00\");\n names[node] = name;\n\n _wrap(\n node,\n name,\n wrappedOwner,\n fuses | PARENT_CANNOT_CONTROL | IS_DOT_ETH,\n expiry\n );\n\n if (resolver != address(0)) {\n ens.setResolver(node, resolver);\n }\n }\n\n function _unwrap(bytes32 node, address owner) private {\n if (allFusesBurned(node, CANNOT_UNWRAP)) {\n revert OperationProhibited(node);\n }\n\n // Burn token and fuse data\n _burn(uint256(node));\n ens.setOwner(node, owner);\n\n emit NameUnwrapped(node, owner);\n }\n\n function _setFuses(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 oldExpiry,\n uint64 expiry\n ) internal {\n _setData(node, owner, fuses, expiry);\n emit FusesSet(node, fuses);\n if (expiry > oldExpiry) {\n emit ExpiryExtended(node, expiry);\n }\n }\n\n function _setData(\n bytes32 node,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n _canFusesBeBurned(node, fuses);\n super._setData(uint256(node), owner, fuses, expiry);\n }\n\n function _canFusesBeBurned(bytes32 node, uint32 fuses) internal pure {\n // If a non-parent controlled fuse is being burned, check PCC and CU are burnt\n if (\n fuses & ~PARENT_CONTROLLED_FUSES != 0 &&\n fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=\n (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)\n ) {\n revert OperationProhibited(node);\n }\n }\n\n function _checkFusesAreSettable(bytes32 node, uint32 fuses) internal pure {\n if (fuses | USER_SETTABLE_FUSES != USER_SETTABLE_FUSES) {\n // Cannot directly burn other non-user settable fuses\n revert OperationProhibited(node);\n }\n }\n\n function _isWrapped(bytes32 node) internal view returns (bool) {\n return\n ownerOf(uint256(node)) != address(0) &&\n ens.owner(node) == address(this);\n }\n\n function _isETH2LDInGracePeriod(\n uint32 fuses,\n uint64 expiry\n ) internal view returns (bool) {\n return\n fuses & IS_DOT_ETH == IS_DOT_ETH &&\n expiry - GRACE_PERIOD < block.timestamp;\n }\n}\n" + }, + "contracts/wrapper/StaticMetadataService.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ncontract StaticMetadataService {\n string private _uri;\n\n constructor(string memory _metaDataUri) {\n _uri = _metaDataUri;\n }\n\n function uri(uint256) public view returns (string memory) {\n return _uri;\n }\n}\n" + }, + "contracts/wrapper/test/NameGriefer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BytesUtils} from \"../BytesUtils.sol\";\nimport {INameWrapper} from \"../INameWrapper.sol\";\nimport {ENS} from \"../../registry/ENS.sol\";\nimport {IERC1155Receiver} from \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\n\ncontract NameGriefer is IERC1155Receiver {\n using BytesUtils for *;\n\n ENS public immutable ens;\n INameWrapper public immutable wrapper;\n\n constructor(INameWrapper _wrapper) {\n wrapper = _wrapper;\n ENS _ens = _wrapper.ens();\n ens = _ens;\n _ens.setApprovalForAll(address(_wrapper), true);\n }\n\n function destroy(bytes calldata name) public {\n wrapper.wrap(name, address(this), address(0));\n }\n\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256,\n bytes calldata\n ) external override returns (bytes4) {\n require(operator == address(this), \"Operator must be us\");\n require(from == address(0), \"Token must be new\");\n\n // Unwrap the name\n bytes memory name = wrapper.names(bytes32(id));\n (bytes32 labelhash, uint256 offset) = name.readLabel(0);\n bytes32 parentNode = name.namehash(offset);\n wrapper.unwrap(parentNode, labelhash, address(this));\n\n // Here we can do something with the name before it's permanently burned, like\n // set the resolver or create subdomains.\n\n return NameGriefer.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external override returns (bytes4) {\n return NameGriefer.onERC1155BatchReceived.selector;\n }\n\n function supportsInterface(\n bytes4 interfaceID\n ) external view override returns (bool) {\n return\n interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`).\n interfaceID == 0x4e2312e0; // ERC-1155 `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\")) ^ bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`).\n }\n}\n" + }, + "contracts/wrapper/test/TestBytesUtils.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {BytesUtils} from \"../BytesUtils.sol\";\n\ncontract TestBytesUtils {\n using BytesUtils for *;\n\n function readLabel(\n bytes calldata name,\n uint256 offset\n ) public pure returns (bytes32, uint256) {\n return name.readLabel(offset);\n }\n\n function namehash(\n bytes calldata name,\n uint256 offset\n ) public pure returns (bytes32) {\n return name.namehash(offset);\n }\n}\n" + }, + "contracts/wrapper/test/TestNameWrapperReentrancy.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"../INameWrapper.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract TestNameWrapperReentrancy is ERC165, IERC1155Receiver {\n INameWrapper nameWrapper;\n address owner;\n bytes32 parentNode;\n bytes32 labelHash;\n uint256 tokenId;\n\n constructor(\n address _owner,\n INameWrapper _nameWrapper,\n bytes32 _parentNode,\n bytes32 _labelHash\n ) {\n owner = _owner;\n nameWrapper = _nameWrapper;\n parentNode = _parentNode;\n labelHash = _labelHash;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function onERC1155Received(\n address,\n address,\n uint256 _id,\n uint256,\n bytes calldata\n ) public override returns (bytes4) {\n tokenId = _id;\n nameWrapper.unwrap(parentNode, labelHash, owner);\n\n return this.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual override returns (bytes4) {\n return this.onERC1155BatchReceived.selector;\n }\n\n function claimToOwner() public {\n nameWrapper.safeTransferFrom(address(this), owner, tokenId, 1, \"\");\n }\n}\n" + }, + "test/dnssec-oracle/TestBytesUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../../contracts/dnssec-oracle/RRUtils.sol\";\nimport \"../../contracts/dnssec-oracle/BytesUtils.sol\";\n\ncontract TestBytesUtils {\n using BytesUtils for *;\n\n function testKeccak() public pure {\n require(\n \"\".keccak(0, 0) ==\n bytes32(\n 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\n ),\n \"Incorrect hash of empty string\"\n );\n require(\n \"foo\".keccak(0, 3) ==\n bytes32(\n 0x41b1a0649752af1b28b3dc29a1556eee781e4a4c3a1f7f53f90fa834de098c4d\n ),\n \"Incorrect hash of 'foo'\"\n );\n require(\n \"foo\".keccak(0, 0) ==\n bytes32(\n 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\n ),\n \"Incorrect hash of empty string\"\n );\n }\n\n function testEquals() public pure {\n require(\"hello\".equals(\"hello\") == true, \"String equality\");\n require(\"hello\".equals(\"goodbye\") == false, \"String inequality\");\n require(\n \"hello\".equals(1, \"ello\") == true,\n \"Substring to string equality\"\n );\n require(\n \"hello\".equals(1, \"jello\", 1, 4) == true,\n \"Substring to substring equality\"\n );\n require(\n \"zhello\".equals(1, \"abchello\", 3) == true,\n \"Compare different value with multiple length\"\n );\n require(\n \"0x0102030000\".equals(0, \"0x010203\") == false,\n \"Compare with offset and trailing bytes\"\n );\n }\n\n function testComparePartial() public pure {\n require(\n \"xax\".compare(1, 1, \"xxbxx\", 2, 1) < 0 == true,\n \"Compare same length\"\n );\n require(\n \"xax\".compare(1, 1, \"xxabxx\", 2, 2) < 0 == true,\n \"Compare different length\"\n );\n require(\n \"xax\".compare(1, 1, \"xxaxx\", 2, 1) == 0 == true,\n \"Compare same with different offset\"\n );\n require(\n \"01234567890123450123456789012345ab\".compare(\n 0,\n 33,\n \"01234567890123450123456789012345aa\",\n 0,\n 33\n ) ==\n 0 ==\n true,\n \"Compare different long strings same length smaller partial length which must be equal\"\n );\n require(\n \"01234567890123450123456789012345ab\".compare(\n 0,\n 33,\n \"01234567890123450123456789012345aa\",\n 0,\n 34\n ) <\n 0 ==\n true,\n \"Compare long strings same length different partial length\"\n );\n require(\n \"0123456789012345012345678901234a\".compare(\n 0,\n 32,\n \"0123456789012345012345678901234b\",\n 0,\n 32\n ) <\n 0 ==\n true,\n \"Compare strings exactly 32 characters long\"\n );\n }\n\n function testCompare() public pure {\n require(\"a\".compare(\"a\") == 0 == true, \"Compare equal\");\n require(\n \"a\".compare(\"b\") < 0 == true,\n \"Compare different value with same length\"\n );\n require(\n \"b\".compare(\"a\") > 0 == true,\n \"Compare different value with same length\"\n );\n require(\n \"aa\".compare(\"ab\") < 0 == true,\n \"Compare different value with multiple length\"\n );\n require(\n \"a\".compare(\"aa\") < 0 == true,\n \"Compare different value with different length\"\n );\n require(\n \"aa\".compare(\"a\") > 0 == true,\n \"Compare different value with different length\"\n );\n bytes memory longChar = \"1234567890123456789012345678901234\";\n require(\n longChar.compare(longChar) == 0 == true,\n \"Compares more than 32 bytes char\"\n );\n bytes memory otherLongChar = \"2234567890123456789012345678901234\";\n require(\n longChar.compare(otherLongChar) < 0 == true,\n \"Compare long char with difference at start\"\n );\n }\n\n function testSubstring() public pure {\n require(\n keccak256(bytes(\"hello\".substring(0, 0))) == keccak256(bytes(\"\")),\n \"Copy 0 bytes\"\n );\n require(\n keccak256(bytes(\"hello\".substring(0, 4))) ==\n keccak256(bytes(\"hell\")),\n \"Copy substring\"\n );\n require(\n keccak256(bytes(\"hello\".substring(1, 4))) ==\n keccak256(bytes(\"ello\")),\n \"Copy substring\"\n );\n require(\n keccak256(bytes(\"hello\".substring(0, 5))) ==\n keccak256(bytes(\"hello\")),\n \"Copy whole string\"\n );\n }\n\n function testReadUint8() public pure {\n require(uint(\"a\".readUint8(0)) == 0x61, \"a == 0x61\");\n require(uint(\"ba\".readUint8(1)) == 0x61, \"a == 0x61\");\n }\n\n function testReadUint16() public pure {\n require(uint(\"abc\".readUint16(1)) == 0x6263, \"Read uint 16\");\n }\n\n function testReadUint32() public pure {\n require(uint(\"abcde\".readUint32(1)) == 0x62636465, \"Read uint 32\");\n }\n\n function testReadBytes20() public pure {\n require(\n bytes32(\"abcdefghijklmnopqrstuv\".readBytes20(1)) ==\n bytes32(\n 0x62636465666768696a6b6c6d6e6f707172737475000000000000000000000000\n ),\n \"readBytes20\"\n );\n }\n\n function testReadBytes32() public pure {\n require(\n \"0123456789abcdef0123456789abcdef\".readBytes32(0) ==\n bytes32(\n 0x3031323334353637383961626364656630313233343536373839616263646566\n ),\n \"readBytes32\"\n );\n }\n\n function testBase32HexDecodeWord() public pure {\n require(\n \"C4\".base32HexDecodeWord(0, 2) == bytes32(bytes1(\"a\")),\n \"Decode 'a'\"\n );\n require(\n \"C5GG\".base32HexDecodeWord(0, 4) == bytes32(bytes2(\"aa\")),\n \"Decode 'aa'\"\n );\n require(\n \"C5GM2\".base32HexDecodeWord(0, 5) == bytes32(bytes3(\"aaa\")),\n \"Decode 'aaa'\"\n );\n require(\n \"C5GM2O8\".base32HexDecodeWord(0, 7) == bytes32(bytes4(\"aaaa\")),\n \"Decode 'aaaa'\"\n );\n require(\n \"C5GM2OB1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")),\n \"Decode 'aaaaa'\"\n );\n require(\n \"c5gm2Ob1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")),\n \"Decode 'aaaaa' lowercase\"\n );\n require(\n \"C5H66P35CPJMGQBADDM6QRJFE1ON4SRKELR7EU3PF8\".base32HexDecodeWord(\n 0,\n 42\n ) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")),\n \"Decode alphabet\"\n );\n require(\n \"c5h66p35cpjmgqbaddm6qrjfe1on4srkelr7eu3pf8\".base32HexDecodeWord(\n 0,\n 42\n ) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")),\n \"Decode alphabet lowercase\"\n );\n require(\n \"C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GG\"\n .base32HexDecodeWord(0, 52) ==\n bytes32(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"),\n \"Decode 32*'a'\"\n );\n require(\n \" bst4hlje7r0o8c8p4o8q582lm0ejmiqt\\x07matoken\\x03xyz\\x00\"\n .base32HexDecodeWord(1, 32) ==\n bytes32(hex\"5f3a48d66e3ec18431192611a2a055b01d3b4b5d\"),\n \"Decode real bytes32hex\"\n );\n }\n}\n" + }, + "test/dnssec-oracle/TestRRUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\nimport \"../../contracts/dnssec-oracle/RRUtils.sol\";\nimport \"../../contracts/dnssec-oracle/BytesUtils.sol\";\n\ncontract TestRRUtils {\n using BytesUtils for *;\n using RRUtils for *;\n\n uint16 constant DNSTYPE_A = 1;\n uint16 constant DNSTYPE_CNAME = 5;\n uint16 constant DNSTYPE_MX = 15;\n uint16 constant DNSTYPE_TEXT = 16;\n uint16 constant DNSTYPE_RRSIG = 46;\n uint16 constant DNSTYPE_TYPE1234 = 1234;\n\n function testNameLength() public pure {\n require(hex\"00\".nameLength(0) == 1, \"nameLength('.') == 1\");\n require(hex\"0361626300\".nameLength(4) == 1, \"nameLength('.') == 1\");\n require(hex\"0361626300\".nameLength(0) == 5, \"nameLength('abc.') == 5\");\n }\n\n function testLabelCount() public pure {\n require(hex\"00\".labelCount(0) == 0, \"labelCount('.') == 0\");\n require(hex\"016100\".labelCount(0) == 1, \"labelCount('a.') == 1\");\n require(\n hex\"016201610000\".labelCount(0) == 2,\n \"labelCount('b.a.') == 2\"\n );\n require(\n hex\"066574686c61620378797a00\".labelCount(6 + 1) == 1,\n \"nameLength('(bthlab).xyz.') == 6\"\n );\n }\n\n function testIterateRRs() public pure {\n // a. IN A 3600 127.0.0.1\n // b.a. IN A 3600 192.168.1.1\n bytes\n memory rrs = hex\"0161000001000100000e1000047400000101620161000001000100000e100004c0a80101\";\n bytes[2] memory names = [bytes(hex\"016100\"), bytes(hex\"0162016100\")];\n bytes[2] memory rdatas = [bytes(hex\"74000001\"), bytes(hex\"c0a80101\")];\n uint i = 0;\n for (\n RRUtils.RRIterator memory iter = rrs.iterateRRs(0);\n !iter.done();\n iter.next()\n ) {\n require(uint(iter.dnstype) == 1, \"Type matches\");\n require(uint(iter.class) == 1, \"Class matches\");\n require(uint(iter.ttl) == 3600, \"TTL matches\");\n require(\n keccak256(iter.name()) == keccak256(names[i]),\n \"Name matches\"\n );\n require(\n keccak256(iter.rdata()) == keccak256(rdatas[i]),\n \"Rdata matches\"\n );\n i++;\n }\n require(i == 2, \"Expected 2 records\");\n }\n\n // Canonical ordering https://tools.ietf.org/html/rfc4034#section-6.1\n function testCompareNames() public pure {\n bytes memory bthLabXyz = hex\"066274686c61620378797a00\";\n bytes memory ethLabXyz = hex\"066574686c61620378797a00\";\n bytes memory xyz = hex\"0378797a00\";\n bytes memory a_b_c = hex\"01610162016300\";\n bytes memory b_b_c = hex\"01620162016300\";\n bytes memory c = hex\"016300\";\n bytes memory d = hex\"016400\";\n bytes memory a_d_c = hex\"01610164016300\";\n bytes memory b_a_c = hex\"01620161016300\";\n bytes memory ab_c_d = hex\"0261620163016400\";\n bytes memory a_c_d = hex\"01610163016400\";\n bytes\n memory verylong1_eth = hex\"223031323334353637383930313233343536373839303132333435363738393031613031303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637380365746800\";\n bytes\n memory verylong2_eth = hex\"2130313233343536373839303132333435363738393031323334353637383930316131303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637380365746800\";\n\n require(\n hex\"0301616100\".compareNames(hex\"0302616200\") < 0,\n \"label lengths are correctly checked\"\n );\n require(\n a_b_c.compareNames(c) > 0,\n \"one name has a difference of >1 label to with the same root name\"\n );\n require(\n a_b_c.compareNames(d) < 0,\n \"one name has a difference of >1 label to with different root name\"\n );\n require(\n a_b_c.compareNames(a_d_c) < 0,\n \"two names start the same but have differences in later labels\"\n );\n require(\n a_b_c.compareNames(b_a_c) > 0,\n \"the first label sorts later, but the first label sorts earlier\"\n );\n require(\n ab_c_d.compareNames(a_c_d) > 0,\n \"two names where the first label on one is a prefix of the first label on the other\"\n );\n require(\n a_b_c.compareNames(b_b_c) < 0,\n \"two names where the first label on one is a prefix of the first label on the other\"\n );\n require(xyz.compareNames(ethLabXyz) < 0, \"xyz comes before ethLab.xyz\");\n require(\n bthLabXyz.compareNames(ethLabXyz) < 0,\n \"bthLab.xyz comes before ethLab.xyz\"\n );\n require(\n bthLabXyz.compareNames(bthLabXyz) == 0,\n \"bthLab.xyz and bthLab.xyz are the same\"\n );\n require(\n ethLabXyz.compareNames(bthLabXyz) > 0,\n \"ethLab.xyz comes after bethLab.xyz\"\n );\n require(bthLabXyz.compareNames(xyz) > 0, \"bthLab.xyz comes after xyz\");\n\n require(\n verylong1_eth.compareNames(verylong2_eth) > 0,\n \"longa.vlong.eth comes after long.vlong.eth\"\n );\n }\n\n function testSerialNumberGt() public pure {\n require(RRUtils.serialNumberGte(1, 0), \"1 >= 0\");\n require(!RRUtils.serialNumberGte(0, 1), \"!(0 <= 1)\");\n require(RRUtils.serialNumberGte(0, 0xFFFFFFFF), \"0 >= 0xFFFFFFFF\");\n require(!RRUtils.serialNumberGte(0xFFFFFFFF, 0), \"!(0 <= 0xFFFFFFFF)\");\n require(\n RRUtils.serialNumberGte(0x11111111, 0xAAAAAAAA),\n \"0x11111111 >= 0xAAAAAAAA\"\n );\n require(RRUtils.serialNumberGte(1, 1), \"1 >= 1\");\n }\n\n function testKeyTag() public view {\n require(\n hex\"0101030803010001a80020a95566ba42e886bb804cda84e47ef56dbd7aec612615552cec906d2116d0ef207028c51554144dfeafe7c7cb8f005dd18234133ac0710a81182ce1fd14ad2283bc83435f9df2f6313251931a176df0da51e54f42e604860dfb359580250f559cc543c4ffd51cbe3de8cfd06719237f9fc47ee729da06835fa452e825e9a18ebc2ecbcf563474652c33cf56a9033bcdf5d973121797ec8089041b6e03a1b72d0a735b984e03687309332324f27c2dba85e9db15e83a0143382e974b0621c18e625ecec907577d9e7bade95241a81ebbe8a901d4d3276e40b114c0a2e6fc38d19c2e6aab02644b2813f575fc21601e0dee49cd9ee96a43103e524d62873d\"\n .computeKeytag() == 19036,\n \"Invalid keytag\"\n );\n require(\n hex\"010003050440000003ba2fa05a75e173bede89eb71831ab14035f2408ad09df4d8dc8f8f72e8f13506feaddf7b04cb14958b82966e3420562302c4002bc4fd088432e160519bb14dae82443850c1423e06085710b5caf070d46b7ba7e481414f6a5fe225fdca984c959091645d0cf1c9a1a313d7e7fb7ba60b967b71a65f8cef2c3768e11b081c8fcf\"\n .computeKeytag() == 21693,\n \"Invalid keytag (2)\"\n );\n require(\n hex\"0100030503010001bfa54c38d909fabb0f937d70d775ba0df4c0badb09707d995249406950407a621c794c68b186b15dbf8f9f9ea231e9f96414ccda4eceb50b17a9ac6c4bd4b95da04849e96ee791578b703bc9ae184fb1794bac792a0787f693a40f19f523ee6dbd3599dbaaa9a50437926ecf6438845d1d49448962524f2a1a7a36b3a0a1eca3\"\n .computeKeytag() == 33630\n );\n require(\n hex\"0101030803010001acffb409bcc939f831f7a1e5ec88f7a59255ec53040be432027390a4ce896d6f9086f3c5e177fbfe118163aaec7af1462c47945944c4e2c026be5e98bbcded25978272e1e3e079c5094d573f0e83c92f02b32d3513b1550b826929c80dd0f92cac966d17769fd5867b647c3f38029abdc48152eb8f207159ecc5d232c7c1537c79f4b7ac28ff11682f21681bf6d6aba555032bf6f9f036beb2aaa5b3778d6eebfba6bf9ea191be4ab0caea759e2f773a1f9029c73ecb8d5735b9321db085f1b8e2d8038fe2941992548cee0d67dd4547e11dd63af9c9fc1c5466fb684cf009d7197c2cf79e792ab501e6a8a1ca519af2cb9b5f6367e94c0d47502451357be1b5\"\n .computeKeytag() == 20326,\n \"Invalid keytag (3)\"\n );\n }\n}\n" + }, + "test/registry/mocks/DummyResolver.sol": { + "content": "pragma solidity >=0.8.4;\n\ncontract DummyResolver {\n mapping(bytes32 => string) public name;\n\n function setName(bytes32 node, string memory _name) public {\n name[node] = _name;\n }\n}\n" + }, + "test/reverseRegistrar/mocks/MockReverseClaimerImplementer.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ENS} from \"../../../contracts/registry/ENS.sol\";\nimport {ReverseClaimer} from \"../../../contracts/reverseRegistrar/ReverseClaimer.sol\";\n\ncontract MockReverseClaimerImplementer is ReverseClaimer {\n constructor(ENS ens, address claimant) ReverseClaimer(ens, claimant) {}\n}\n" + }, + "test/utils/mocks/DummyOffchainResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\nimport \"../../../contracts/resolvers/profiles/IExtendedResolver.sol\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\n);\n\ncontract DummyOffchainResolver is IExtendedResolver, ERC165 {\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return\n interfaceId == type(IExtendedResolver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function resolve(\n bytes calldata /* name */,\n bytes calldata data\n ) external view returns (bytes memory) {\n string[] memory urls = new string[](1);\n urls[0] = \"https://example.com/\";\n revert OffchainLookup(\n address(this),\n urls,\n data,\n DummyOffchainResolver.resolveCallback.selector,\n data\n );\n }\n\n function addr(bytes32) external pure returns (bytes memory) {\n return abi.encode(\"onchain\");\n }\n\n function resolveCallback(\n bytes calldata response,\n bytes calldata extraData\n ) external view returns (bytes memory) {\n require(\n keccak256(response) == keccak256(extraData),\n \"Response data error\"\n );\n if (bytes4(extraData) == bytes4(keccak256(\"name(bytes32)\"))) {\n return abi.encode(\"offchain.test.eth\");\n }\n return abi.encode(address(this));\n }\n}\n" + }, + "test/utils/mocks/LegacyResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.13;\n\ncontract LegacyResolver {\n function addr(bytes32 /* node */) public view returns (address) {\n return address(this);\n }\n}\n" + }, + "test/utils/mocks/MockERC20.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.17 <0.9.0;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockERC20 is ERC20 {\n constructor(\n string memory name,\n string memory symbol,\n address[] memory addresses\n ) ERC20(name, symbol) {\n _mint(msg.sender, 100 * 10 ** uint256(decimals()));\n\n for (uint256 i = 0; i < addresses.length; i++) {\n _mint(addresses[i], 100 * 10 ** uint256(decimals()));\n }\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 1200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } + } \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 22640d15..900f3541 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -88,7 +88,7 @@ const config: HardhatUserConfig = { settings: { optimizer: { enabled: true, - runs: 1300, + runs: 1200, }, }, }, @@ -126,7 +126,7 @@ const config: HardhatUserConfig = { default: 0, }, owner: { - default: 0, + default: 1, }, }, external: {