diff --git a/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts b/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts index e8473092..b5c528ca 100644 --- a/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts +++ b/deploy/ethregistrar/00_deploy_base_registrar_implementation.ts @@ -21,10 +21,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { args: [registry.address, namehash.hash('eth')], log: true, }; - const { differences } = await fetchIfDifferent('BaseRegistrarImplementation', deployArgs); - if(!differences) return; - await deploy('BaseRegistrarImplementation', deployArgs) + const bri = await deploy('BaseRegistrarImplementation', deployArgs) + if(!bri.newlyDeployed) return; const registrar = await ethers.getContract('BaseRegistrarImplementation') diff --git a/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts b/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts index 67a0c0a0..e06cb227 100644 --- a/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts +++ b/deploy/ethregistrar/03_deploy_eth_registrar_controller.ts @@ -1,7 +1,14 @@ +import { Interface } from 'ethers/lib/utils'; import { ethers } from 'hardhat' import { DeployFunction } from 'hardhat-deploy/types' import { HardhatRuntimeEnvironment } from 'hardhat/types' +const { makeInterfaceId } = require('@openzeppelin/test-helpers') + +function computeInterfaceId(iface: Interface) { + return makeInterfaceId.ERC165(Object.values(iface.functions).map((frag) => frag.format("sighash"))); +} + const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { getNamedAccounts, deployments, network } = hre const { deploy, fetchIfDifferent } = deployments @@ -24,32 +31,40 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ], log: true, }; - const { differences } = await fetchIfDifferent('ETHRegistrarController', deployArgs); - if(!differences) return; - const controller = await deploy('ETHRegistrarController', deployArgs) + if(!controller.newlyDeployed) return; - const tx1 = await registrar.addController(controller.address, { + // Only attempt to make controller etc changes directly on testnets + if(network.name === 'mainnet') return; + + const tx1 = await nameWrapper.setController(controller.address, { from: deployer, }) console.log( - `Adding ETHRegistrarController as controller on BaseRegistrarImplementation (tx: ${tx1.hash})...`, + `Adding ETHRegistrarController as a controller of NameWrapper (tx: ${tx1.hash})...`, ) await tx1.wait() - const tx2 = await nameWrapper.setController(controller.address, { + const tx2 = await reverseRegistrar.setController(controller.address, { from: deployer, }) console.log( - `Adding ETHRegistrarController as a controller of NameWrapper (tx: ${tx2.hash})...`, + `Adding ETHRegistrarController as a controller of ReverseRegistrar (tx: ${tx2.hash})...`, ) await tx2.wait() - const tx3 = await reverseRegistrar.setController(controller.address, { - from: deployer, - }) + const artifact = await deployments.getArtifact("IETHRegistrarController"); + const interfaceId = computeInterfaceId(new Interface(artifact.abi)); + const provider = await ethers.getDefaultProvider(); + const resolver = await provider.getResolver("eth"); + if(resolver === null) { + console.log("No resolver set for .eth; not setting interface for ETH Registrar Controller"); + return; + } + const resolverContract = await ethers.getContractAt('PublicResolver', resolver.address); + const tx3 = await resolverContract.setInterface(ethers.utils.namehash('eth'), interfaceId, controller.address); console.log( - `Adding ETHRegistrarController as a controller of ReverseRegistrar (tx: ${tx3.hash})...`, + `Setting ETHRegistrarController interface ID ${interfaceId} on .eth resolver (tx: ${tx3.hash})...` ) await tx3.wait() } diff --git a/deploy/registry/01_deploy_reverse_registrar.ts b/deploy/registry/01_deploy_reverse_registrar.ts index 87ba053b..c2b646de 100644 --- a/deploy/registry/01_deploy_reverse_registrar.ts +++ b/deploy/registry/01_deploy_reverse_registrar.ts @@ -5,7 +5,7 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types' import { keccak256 } from 'js-sha3' const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { getNamedAccounts, deployments } = hre + const { getNamedAccounts, deployments, network } = hre const { deploy, fetchIfDifferent } = deployments const { deployer, owner } = await getNamedAccounts() @@ -16,10 +16,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { args: [registry.address], log: true, }; - const { differences } = await fetchIfDifferent('ReverseRegistrar', deployArgs); - if(!differences) return; - const reverseRegistrar = await deploy('ReverseRegistrar', deployArgs); + if(!reverseRegistrar.newlyDeployed) return; + + // Only attempt to make controller etc changes directly on testnets + if(network.name === 'mainnet') return; const root = await ethers.getContract('Root') @@ -43,7 +44,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } func.id = 'reverse-registrar' -func.tags = ['registry', 'ReverseRegistrar'] +func.tags = ['ReverseRegistrar'] func.dependencies = ['root'] export default func diff --git a/deploy/resolvers/00_deploy_public_resolver.ts b/deploy/resolvers/00_deploy_public_resolver.ts index e85a7f50..8305b42b 100644 --- a/deploy/resolvers/00_deploy_public_resolver.ts +++ b/deploy/resolvers/00_deploy_public_resolver.ts @@ -22,10 +22,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ], log: true, }; - const { differences } = await fetchIfDifferent('PublicResolver', deployArgs); - if(!differences) return; - const publicResolver = await deploy('PublicResolver', deployArgs) + if(!publicResolver.newlyDeployed) return; const tx = await reverseRegistrar.setDefaultResolver(publicResolver.address, { from: deployer, diff --git a/deploy/wrapper/01_deploy_name_wrapper.ts b/deploy/wrapper/01_deploy_name_wrapper.ts index 078f5d0c..b5f5ee46 100644 --- a/deploy/wrapper/01_deploy_name_wrapper.ts +++ b/deploy/wrapper/01_deploy_name_wrapper.ts @@ -1,21 +1,34 @@ +import { Interface } from 'ethers/lib/utils' import { ethers } from 'hardhat' import { DeployFunction } from 'hardhat-deploy/types' import { HardhatRuntimeEnvironment } from 'hardhat/types' +const { makeInterfaceId } = require('@openzeppelin/test-helpers') + +function computeInterfaceId(iface: Interface) { + return makeInterfaceId.ERC165(Object.values(iface.functions).map((frag) => frag.format("sighash"))); +} + const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { getNamedAccounts, deployments } = hre - const { deploy } = deployments + const { getNamedAccounts, deployments, network } = hre + const { deploy, fetchIfDifferent } = deployments const { deployer } = await getNamedAccounts() const registry = await ethers.getContract('ENSRegistry') const registrar = await ethers.getContract('BaseRegistrarImplementation') const metadata = await ethers.getContract('StaticMetadataService') - const nameWrapper = await deploy('NameWrapper', { + const deployArgs = { from: deployer, args: [registry.address, registrar.address, metadata.address], log: true, - }) + }; + + const nameWrapper = await deploy('NameWrapper', deployArgs) + if(!nameWrapper.newlyDeployed) return; + + // Only attempt to make controller etc changes directly on testnets + if(network.name === 'mainnet') return; const tx = await registrar.addController(nameWrapper.address, { from: deployer, @@ -24,6 +37,21 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { `Adding NameWrapper as controller on registrar (tx: ${tx.hash})...`, ) await tx.wait() + + const artifact = await deployments.getArtifact("NameWrapper"); + const interfaceId = computeInterfaceId(new Interface(artifact.abi)); + const provider = await ethers.getDefaultProvider(); + const resolver = await provider.getResolver("eth"); + if(resolver === null) { + console.log("No resolver set for .eth; not setting interface for NameWrapper"); + return; + } + const resolverContract = await ethers.getContractAt('PublicResolver', resolver.address); + const tx2 = await resolverContract.setInterface(ethers.utils.namehash('eth'), interfaceId, nameWrapper.address); + console.log( + `Setting NameWrapper interface ID ${interfaceId} on .eth resolver (tx: ${tx2.hash})...` + ) + await tx2.wait() } func.id = 'name-wrapper' diff --git a/deployments/goerli/DummyOracle.json b/deployments/goerli/DummyOracle.json new file mode 100644 index 00000000..88074580 --- /dev/null +++ b/deployments/goerli/DummyOracle.json @@ -0,0 +1,95 @@ +{ + "address": "0xeB5245aa9619D05BC2bAa1baa31c2876ad392E5e", + "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": "0x4935be779b08d881114527a60d1fed7656ce95d96ad37f74e3aedffc0306d8df", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0xeB5245aa9619D05BC2bAa1baa31c2876ad392E5e", + "transactionIndex": 2, + "gasUsed": "114009", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf7f9a95e6604c96afcafd2e638aa56a25a17e78ffef540c39b8847cb6ec4de90", + "transactionHash": "0x4935be779b08d881114527a60d1fed7656ce95d96ad37f74e3aedffc0306d8df", + "logs": [], + "blockNumber": 7625497, + "cumulativeGasUsed": "337909", + "status": 1, + "byzantium": true + }, + "args": [ + "160000000000" + ], + "numDeployments": 1, + "solcInputHash": "9ab134ee99f7410d077d71824d3e2f84", + "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\":10000},\"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": "0x608060405234801561001057600080fd5b5060405161011138038061011183398101604081905261002f9161003e565b61003881600055565b50610057565b60006020828403121561005057600080fd5b5051919050565b60ac806100656000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806350d25bcd146037578063e5c19b2d14604c575b600080fd5b60005460405190815260200160405180910390f35b605c6057366004605e565b600055565b005b600060208284031215606f57600080fd5b503591905056fea2646970667358221220a8de3ba5e8615edab3cc4519b8f2c3736cd9eaaf1dad97bca592b10503c7a63864736f6c63430008110033", + "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c806350d25bcd146037578063e5c19b2d14604c575b600080fd5b60005460405190815260200160405180910390f35b605c6057366004605e565b600055565b005b600060208284031215606f57600080fd5b503591905056fea2646970667358221220a8de3ba5e8615edab3cc4519b8f2c3736cd9eaaf1dad97bca592b10503c7a63864736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3, + "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/goerli/ETHRegistrarController.json b/deployments/goerli/ETHRegistrarController.json new file mode 100644 index 00000000..19718185 --- /dev/null +++ b/deployments/goerli/ETHRegistrarController.json @@ -0,0 +1,765 @@ +{ + "address": "0x5913678e207e39F848D0E69Ccd6df46A9c5031FA", + "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" + } + ], + "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": "node", + "type": "bytes32" + } + ], + "name": "Unauthorised", + "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": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "wrapperExpiry", + "type": "uint64" + } + ], + "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": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "wrapperExpiry", + "type": "uint64" + } + ], + "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": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "wrapperExpiry", + "type": "uint64" + } + ], + "name": "renewWithFuses", + "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": "0x7b5cd10fe26b97f02ba5437578c96c4950ac00ac5a4b7ef56aee6d6e156499e9", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0x5913678e207e39F848D0E69Ccd6df46A9c5031FA", + "transactionIndex": 18, + "gasUsed": "2127161", + "logsBloom": "0x00000000000000000000000000000000000040000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000010000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000040000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000001000000000", + "blockHash": "0xee57d136496860dc2fa7b8683c43c75c7e7c778a64201cc5ebac4e4af29c283b", + "transactionHash": "0x7b5cd10fe26b97f02ba5437578c96c4950ac00ac5a4b7ef56aee6d6e156499e9", + "logs": [ + { + "transactionIndex": 18, + "blockNumber": 7625512, + "transactionHash": "0x7b5cd10fe26b97f02ba5437578c96c4950ac00ac5a4b7ef56aee6d6e156499e9", + "address": "0x5913678e207e39F848D0E69Ccd6df46A9c5031FA", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a303ddc620aa7d1390baccc8a495508b183fab59" + ], + "data": "0x", + "logIndex": 52, + "blockHash": "0xee57d136496860dc2fa7b8683c43c75c7e7c778a64201cc5ebac4e4af29c283b" + } + ], + "blockNumber": 7625512, + "cumulativeGasUsed": "5796280", + "status": 1, + "byzantium": true + }, + "args": [ + "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85", + "0x446C8f1ce718D100a2018B887416cDd4A213E95c", + 60, + 86400, + "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48", + "0xC5A419AbB14d69945B3A143326B2d825d505714f" + ], + "numDeployments": 1, + "solcInputHash": "a5ab15037ea2d912526c4e5696fda13f", + "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\"}],\"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\":\"node\",\"type\":\"bytes32\"}],\"name\":\"Unauthorised\",\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"wrapperExpiry\",\"type\":\"uint64\"}],\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"wrapperExpiry\",\"type\":\"uint64\"}],\"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\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"wrapperExpiry\",\"type\":\"uint64\"}],\"name\":\"renewWithFuses\",\"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\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 be 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\":\"0x8e93de94c9062ebc94fb7e2e3929b0781ac6a2b7772e2f7a59045861c93e5be9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 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 /**\\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\",\"keccak256\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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: balance query for the zero address\\\");\\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 = _owners[tokenId];\\n require(owner != address(0), \\\"ERC721: owner query for nonexistent token\\\");\\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 require(_exists(tokenId), \\\"ERC721Metadata: URI query for nonexistent token\\\");\\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 overriden 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 owner nor 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 require(_exists(tokenId), \\\"ERC721: approved query for nonexistent token\\\");\\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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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 require(_exists(tokenId), \\\"ERC721: operator query for nonexistent token\\\");\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);\\n\\n _balances[to] += 1;\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\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);\\n\\n // Clear approvals\\n _approve(address(0), tokenId);\\n\\n _balances[owner] -= 1;\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId);\\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);\\n\\n // Clear approvals from the previous owner\\n _approve(address(0), tokenId);\\n\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits a {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 a {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 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 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\\n * and burning.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\\n * transferred to `to`.\\n * - When `from` is zero, `tokenId` will be minted for `to`.\\n * - When `to` is zero, ``from``'s `tokenId` 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 tokenId\\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.\\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 tokenId\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x11b84bb56dc112a6590bfe3e0efa118aa1b5891132342200d04c4ef544cb93de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\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 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 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 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 /**\\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\",\"keccak256\":\"0x516a22876c1fab47f49b1bc22b4614491cd05338af8bd2e7b382da090a079990\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 `IERC721.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\":\"0xd5fa74b4fb323776fa4a8158800fec9d5ac0fec0d6dd046dd93798632ada265f\",\"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.5.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"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 v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\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 // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\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 if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\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] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n}\\n\",\"keccak256\":\"0x32c202bd28995dd20c4347b7c6467a6d3241c74c8ad3edcbb610cd9205916c45\",\"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/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(address spender, uint256 tokenId)\\n internal\\n view\\n override\\n returns (bool)\\n {\\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(uint256 tokenId)\\n public\\n view\\n override(IERC721, ERC721)\\n returns (address)\\n {\\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(uint256 id, uint256 duration)\\n external\\n override\\n live\\n onlyController\\n returns (uint256)\\n {\\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(bytes4 interfaceID)\\n public\\n view\\n override(ERC721, IERC165)\\n returns (bool)\\n {\\n return\\n interfaceID == INTERFACE_META_ID ||\\n interfaceID == ERC721_ID ||\\n interfaceID == RECLAIM_ID;\\n }\\n}\\n\",\"keccak256\":\"0xb757a151137d4b1b877773226797c8f95a4320cd3d68c7c2cfa588b22f5438ed\"},\"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 {ReverseRegistrar} from \\\"../registry/ReverseRegistrar.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{\\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 ) {\\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(string memory name, uint256 duration)\\n public\\n view\\n override\\n returns (IPriceOracle.Price memory price)\\n {\\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 uint32 fuses,\\n uint64 wrapperExpiry\\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 resolver,\\n data,\\n secret,\\n reverseRecord,\\n fuses,\\n wrapperExpiry\\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 uint32 fuses,\\n uint64 wrapperExpiry\\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 fuses,\\n wrapperExpiry\\n )\\n );\\n\\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\\n name,\\n owner,\\n duration,\\n resolver,\\n fuses,\\n wrapperExpiry\\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(string calldata name, uint256 duration)\\n external\\n payable\\n override\\n {\\n _renew(name, duration, 0, 0);\\n }\\n\\n function renewWithFuses(\\n string calldata name,\\n uint256 duration,\\n uint32 fuses,\\n uint64 wrapperExpiry\\n ) external payable {\\n bytes32 labelhash = keccak256(bytes(name));\\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, labelhash));\\n if (!nameWrapper.isTokenOwnerOrApproved(nodehash, msg.sender)) {\\n revert Unauthorised(nodehash);\\n }\\n _renew(name, duration, fuses, wrapperExpiry);\\n }\\n\\n function _renew(\\n string calldata name,\\n uint256 duration,\\n uint32 fuses,\\n uint64 wrapperExpiry\\n ) internal {\\n bytes32 labelhash = keccak256(bytes(name));\\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, labelhash));\\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;\\n if (nameWrapper.isWrapped(nodehash)) {\\n expires = nameWrapper.renew(\\n tokenId,\\n duration,\\n fuses,\\n wrapperExpiry\\n );\\n } else {\\n expires = base.renew(tokenId, duration);\\n }\\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(bytes4 interfaceID)\\n external\\n pure\\n returns (bool)\\n {\\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\":\"0x88fa793320fc7f510b0b3a9286664b8ac76c5b27da90b25d370854757b0dfecd\",\"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 iff 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\":\"0x9ac51351ff72d73083aed62b7cdad4c07e9d1eb68401d7fd8457bdd828f2c6fe\"},\"contracts/ethregistrar/IETHRegistrarController.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./IPriceOracle.sol\\\";\\n\\ninterface IETHRegistrarController {\\n function rentPrice(string memory, uint256)\\n external\\n 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 uint32,\\n uint64\\n ) external 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 uint32,\\n uint64\\n ) external payable;\\n\\n function renew(string calldata, uint256) external payable;\\n}\\n\",\"keccak256\":\"0x999c1c3386cfef6a52b86b33a45820d551366141db8c5915740895c9f2425772\",\"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(address owner, address operator)\\n external\\n view\\n returns (bool);\\n}\\n\",\"keccak256\":\"0xf79be82c1a2eb0a77fba4e0972221912e803309081ca460fd2cf61653e55758a\"},\"contracts/registry/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(address owner, address resolver)\\n external\\n 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\":\"0xd6ba83973ffbab31dec17a716af3bb5703844d16dceb5078583fb2c509f8bcc2\"},\"contracts/registry/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"./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(address owner, address resolver)\\n public\\n override\\n returns (bytes32)\\n {\\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\":\"0x4430930561750d2de1163f7b7ba22ae003a7684394371e90a04374859a2337cf\"},\"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 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(\\n bytes32 node,\\n uint256 coinType,\\n bytes calldata a\\n ) 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(\\n bytes32 node,\\n bytes32 x,\\n bytes32 y\\n ) 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(bytes[] calldata data)\\n external\\n returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(bytes32 nodehash, bytes[] calldata data)\\n external\\n 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\":\"0x73b6cd44b0ed803083996abd3d2683f2444731b6486045f8274c44fce66bf939\",\"license\":\"MIT\"},\"contracts/resolvers/ResolverBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\n\\nabstract contract ResolverBase is ERC165 {\\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\\n\\n modifier authorised(bytes32 node) {\\n require(isAuthorised(node));\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xc749aecc4b1ea253d7ba60d130014954dd0dd327c085b1863f8bb7ad3e32f2e3\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"./IABIResolver.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\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(bytes32 node, uint256 contentTypes)\\n external\\n view\\n returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0xc6db25d9b07ea925c64bb777f00ba557e99fbccd4c30c20e5a1b5cd8c159dcbf\",\"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(bytes32 node, uint256 coinType)\\n external\\n view\\n returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x37221203e063dee5aa2a067a6ab3401e9cca41cce5b15230994b6ea377f05ed5\",\"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 // DNSZoneCleared is emitted whenever a given node's zone information is cleared.\\n event DNSZoneCleared(bytes32 indexed node);\\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\":\"0x78cfc99568f9b092692d825b7c8f29ccc02c057e0ef2707ce037a1b4381c7fc2\",\"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(bytes memory name, bytes memory data)\\n external\\n view\\n returns (bytes memory, address);\\n}\\n\",\"keccak256\":\"0x0a586a1725cdc5f90f2e302c620a4a033adfc87e49bbcc5a43604ba579bce7a7\",\"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(bytes32 node, bytes4 interfaceID)\\n external\\n view\\n returns (address);\\n}\\n\",\"keccak256\":\"0x6d75d6010016684030e13711b3bc1a4e1a784c7398937f1b7c2b2f328f962c2b\",\"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(bytes32 node, string calldata key)\\n external\\n view\\n returns (string memory);\\n}\\n\",\"keccak256\":\"0xcc5eada60de63f42f47a4bbc8a5d2bed4cd1394646197a08da7957c6fd90ba5d\",\"license\":\"MIT\"},\"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\\\";\\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 PARENT_CANNOT_CONTROL = 64;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\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, 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 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 uint32 fuses,\\n uint64 _expiry,\\n address resolver\\n ) external returns (uint64 expiry);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (uint256 expires);\\n\\n function unwrap(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function setFuses(bytes32 node, uint32 fuses)\\n external\\n 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 isTokenOwnerOrApproved(bytes32 node, address addr)\\n external\\n 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 returns (address owner);\\n\\n function allFusesBurned(bytes32 node, uint32 fuseMask)\\n external\\n view\\n returns (bool);\\n\\n function isWrapped(bytes32 node) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa44868603a1df17a4ebbc25354f49db6e1dd73c46e02c3557151154678848cb6\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101406040523480156200001257600080fd5b50604051620027783803806200277883398101604081905262000035916200011a565b6200004033620000b1565b83831162000061576040516307cb550760e31b815260040160405180910390fd5b428311156200008357604051630b4319e560e21b815260040160405180910390fd5b6001600160a01b0395861660805293851660a05260c09290925260e052821661010052166101205262000197565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200011757600080fd5b50565b60008060008060008060c087890312156200013457600080fd5b8651620001418162000101565b6020880151909650620001548162000101565b8095505060408701519350606087015192506080870151620001768162000101565b60a0880151909250620001898162000101565b809150509295509295509295565b60805160a05160c05160e0516101005161012051612544620002346000396000818161038d0152818161074f015281816109e4015281816111bc015261129301526000818161022801526117410152600081816103f401528181610f03015261156901526000818161030e01526114f20152600081816104280152610c30015260008181610c7201528181610db7015261135201526125446000f3fe60806040526004361061016a5760003560e01c80638d839ffe116100cb578063aeb8ce9b1161007f578063d555254a11610059578063d555254a1461044a578063f14fcbc81461046a578063f2fde38b1461048a57600080fd5b8063aeb8ce9b146103c2578063ce1e09c0146103e2578063d3419bf31461041657600080fd5b80639791c097116100b05780639791c0971461035b578063a8e5fbc01461037b578063acf1a841146103af57600080fd5b80638d839ffe146102fc5780638da5cb5b1461033057600080fd5b80637acaaf2611610122578063839df94511610107578063839df9451461026f57806383e7f6ff146102aa5780638a95b09f146102e557600080fd5b80637acaaf2614610203578063808698531461021657600080fd5b80635d3590d5116101535780635d3590d5146101bb5780636459220f146101db578063715018a6146101ee57600080fd5b806301ffc9a71461016f5780633ccfd60b146101a4575b600080fd5b34801561017b57600080fd5b5061018f61018a366004611a07565b6104aa565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101b9610543565b005b3480156101c757600080fd5b506101b96101d6366004611a72565b61058d565b6101b96101e9366004611b23565b6106b2565b3480156101fa57600080fd5b506101b9610820565b6101b9610211366004611be4565b6108ad565b34801561022257600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561027b57600080fd5b5061029c61028a366004611cbd565b60016020526000908152604090205481565b60405190815260200161019b565b3480156102b657600080fd5b506102ca6102c5366004611db4565b610be6565b6040805182518152602092830151928101929092520161019b565b3480156102f157600080fd5b5061029c6224ea0081565b34801561030857600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561033c57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661024a565b34801561036757600080fd5b5061018f610376366004611df9565b610d46565b34801561038757600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b6101b96103bd366004611e2e565b610d5b565b3480156103ce57600080fd5b5061018f6103dd366004611df9565b610d6e565b3480156103ee57600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561042257600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561045657600080fd5b5061029c610465366004611e7a565b610e3e565b34801561047657600080fd5b506101b9610485366004611cbd565b610eec565b34801561049657600080fd5b506101b96104a5366004611f4d565b610f75565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061053d57507fffffffff0000000000000000000000000000000000000000000000000000000082167fdf7ed18100000000000000000000000000000000000000000000000000000000145b92915050565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116914780156108fc02929091818181858888f1935050505015801561058a573d6000803e3d6000fd5b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ac9190611f68565b50505050565b600085856040516106c4929190611f85565b604080519182900382207f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020840152908201819052915060009060600160408051808303601f190181529082905280516020909101207ff44779b90000000000000000000000000000000000000000000000000000000082526004820181905233602483015291507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f44779b9906044016020604051808303816000875af11580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611f68565b61080a576040517fe4fd57ae0000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b61081787878787876110a2565b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060a565b6108ab6000611466565b565b60006108f08c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d9250610be6915050565b6020810151815191925061090391611fc4565b34101561093c576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e08c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508a6109db8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e8e8e8e8e8e8e8e8e610e3e565b6114db565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639f56dac68e8e8e8e8d8a8a6040518863ffffffff1660e01b8152600401610a479796959493929190612002565b6020604051808303816000875af1158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a919061206c565b90508515610ab557610ab5888e8e604051610aa6929190611f85565b60405180910390208989611658565b8415610afe57610afe8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925033915061173f9050565b8a73ffffffffffffffffffffffffffffffffffffffff168d8d604051610b25929190611f85565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278f8f8660000151876020015187604051610b6c959493929190612085565b60405180910390a360208201518251610b859190611fc4565b341115610bd7576020820151825133916108fc91610ba39190611fc4565b610bad90346120b6565b6040518115909202916000818181858888f19350505050158015610bd5573d6000803e3d6000fd5b505b50505050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116916350e9a7159187917f00000000000000000000000000000000000000000000000000000000000000009091169063d6e4fa8690602401602060405180830381865afa158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf919061206c565b866040518463ffffffff1660e01b8152600401610cfe93929190612119565b6040805180830381865afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e919061213e565b949350505050565b60006003610d5383611800565b101592915050565b610d698383836000806110a2565b505050565b80516020820120600090610d8183610d46565b8015610e3757506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906396e494e890602401602060405180830381865afa158015610e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e379190611f68565b9392505050565b895160208b01206000908515801590610e6b575073ffffffffffffffffffffffffffffffffffffffff8816155b15610ea2576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808b8b8a8a8a8e8b8b8b604051602001610ec59a9998979695949392919061223d565b604051602081830303815290604052805190602001209150509a9950505050505050505050565b6000818152600160205260409020544290610f28907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b10610f62576040517f0a059d710000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b6000908152600160205260409020429055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ff6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060a565b73ffffffffffffffffffffffffffffffffffffffff8116611099576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161060a565b61058a81611466565b600085856040516110b4929190611f85565b604080519182900382207f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020840152908201819052915060009060600160408051601f198184030181528282528051602091820120601f8a01829004820284018201909252888352909250839160009161114c91908b908b90819084018382808284376000920191909152508b9250610be6915050565b805190915034101561118a576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd0cd0d9000000000000000000000000000000000000000000000000000000008152600481018490526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063fd0cd0d990602401602060405180830381865afa158015611218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123c9190611f68565b1561131c576040517f47d2e9fe000000000000000000000000000000000000000000000000000000008152600481018490526024810189905263ffffffff8816604482015267ffffffffffffffff871660648201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906347d2e9fe906084016020604051808303816000875af11580156112f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611315919061206c565b90506113d7565b6040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101849052602481018990527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063c475abff906044016020604051808303816000875af11580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d4919061206c565b90505b815134111561141c57815133906108fc906113f290346120b6565b6040518115909202916000818181858888f1935050505015801561141a573d6000803e3d6000fd5b505b847f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8b8b348560405161145294939291906122bf565b60405180910390a250505050505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600160205260409020544290611517907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b1115611552576040517f5320bcf90000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b600081815260016020526040902054429061158e907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b116115c8576040517fcb7690d70000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b6115d183610d6e565b61160957826040517f477707e800000000000000000000000000000000000000000000000000000000815260040161060a91906122e6565b6000818152600160205260408120556224ea00821015610d69576040517f9a71997b0000000000000000000000000000000000000000000000000000000081526004810183905260240161060a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb00000000000000000000000000000000000000000000000000000000909252859073ffffffffffffffffffffffffffffffffffffffff82169063e32954eb906116f8908590889088906064016122f9565b6000604051808303816000875af1158015611717573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610817919081019061231c565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637a806d6b3383858760405160200161178f919061241b565b6040516020818303038152906040526040518563ffffffff1660e01b81526004016117bd949392919061245c565b6020604051808303816000875af11580156117dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ac919061206c565b8051600090819081905b808210156119fe576000858381518110611826576118266124a7565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561188957611882600184611fc4565b92506119eb565b7fe0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156118de57611882600284611fc4565b7ff0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561193357611882600384611fc4565b7ff8000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561198857611882600484611fc4565b7ffc000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156119dd57611882600584611fc4565b6119e8600684611fc4565b92505b50826119f6816124d6565b93505061180a565b50909392505050565b600060208284031215611a1957600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610e3757600080fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114611a6d57600080fd5b919050565b600080600060608486031215611a8757600080fd5b611a9084611a49565b9250611a9e60208501611a49565b9150604084013590509250925092565b60008083601f840112611ac057600080fd5b50813567ffffffffffffffff811115611ad857600080fd5b602083019150836020828501011115611af057600080fd5b9250929050565b803563ffffffff81168114611a6d57600080fd5b803567ffffffffffffffff81168114611a6d57600080fd5b600080600080600060808688031215611b3b57600080fd5b853567ffffffffffffffff811115611b5257600080fd5b611b5e88828901611aae565b90965094505060208601359250611b7760408701611af7565b9150611b8560608701611b0b565b90509295509295909350565b60008083601f840112611ba357600080fd5b50813567ffffffffffffffff811115611bbb57600080fd5b6020830191508360208260051b8501011115611af057600080fd5b801515811461058a57600080fd5b60008060008060008060008060008060006101208c8e031215611c0657600080fd5b67ffffffffffffffff808d351115611c1d57600080fd5b611c2a8e8e358f01611aae565b909c509a50611c3b60208e01611a49565b995060408d0135985060608d01359750611c5760808e01611a49565b96508060a08e01351115611c6a57600080fd5b50611c7b8d60a08e01358e01611b91565b909550935060c08c0135611c8e81611bd6565b9250611c9c60e08d01611af7565b9150611cab6101008d01611b0b565b90509295989b509295989b9093969950565b600060208284031215611ccf57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d2e57611d2e611cd6565b604052919050565b600067ffffffffffffffff821115611d5057611d50611cd6565b50601f01601f191660200190565b600082601f830112611d6f57600080fd5b8135611d82611d7d82611d36565b611d05565b818152846020838601011115611d9757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215611dc757600080fd5b823567ffffffffffffffff811115611dde57600080fd5b611dea85828601611d5e565b95602094909401359450505050565b600060208284031215611e0b57600080fd5b813567ffffffffffffffff811115611e2257600080fd5b610d3e84828501611d5e565b600080600060408486031215611e4357600080fd5b833567ffffffffffffffff811115611e5a57600080fd5b611e6686828701611aae565b909790965060209590950135949350505050565b6000806000806000806000806000806101208b8d031215611e9a57600080fd5b8a3567ffffffffffffffff80821115611eb257600080fd5b611ebe8e838f01611d5e565b9b50611ecc60208e01611a49565b9a5060408d0135995060608d01359850611ee860808e01611a49565b975060a08d0135915080821115611efe57600080fd5b50611f0b8d828e01611b91565b90965094505060c08b0135611f1f81611bd6565b9250611f2d60e08c01611af7565b9150611f3c6101008c01611b0b565b90509295989b9194979a5092959850565b600060208284031215611f5f57600080fd5b610e3782611a49565b600060208284031215611f7a57600080fd5b8151610e3781611bd6565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561053d5761053d611f95565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60c08152600061201660c08301898b611fd7565b905073ffffffffffffffffffffffffffffffffffffffff808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a083015298975050505050505050565b60006020828403121561207e57600080fd5b5051919050565b608081526000612099608083018789611fd7565b602083019590955250604081019290925260609091015292915050565b8181038181111561053d5761053d611f95565b60005b838110156120e45781810151838201526020016120cc565b50506000910152565b600081518084526121058160208601602086016120c9565b601f01601f19169290920160200192915050565b60608152600061212c60608301866120ed565b60208301949094525060400152919050565b60006040828403121561215057600080fd5b6040516040810181811067ffffffffffffffff8211171561217357612173611cd6565b604052825181526020928301519281019290925250919050565b81835260006020808501808196508560051b810191508460005b8781101561223057828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030181126121e657600080fd5b8701858101903567ffffffffffffffff81111561220257600080fd5b80360382131561221157600080fd5b61221c868284611fd7565b9a87019a95505050908401906001016121a7565b5091979650505050505050565b60006101208c835273ffffffffffffffffffffffffffffffffffffffff808d1660208501528b6040850152808b16606085015250806080840152612284818401898b61218d565b60a0840197909752505092151560c084015263ffffffff9190911660e083015267ffffffffffffffff16610100909101529695505050505050565b6060815260006122d3606083018688611fd7565b6020830194909452506040015292915050565b602081526000610e3760208301846120ed565b83815260406020820152600061231360408301848661218d565b95945050505050565b6000602080838503121561232f57600080fd5b825167ffffffffffffffff8082111561234757600080fd5b818501915085601f83011261235b57600080fd5b81518181111561236d5761236d611cd6565b8060051b61237c858201611d05565b918252838101850191858101908984111561239657600080fd5b86860192505b8383101561240e578251858111156123b45760008081fd5b8601603f81018b136123c65760008081fd5b8781015160406123d8611d7d83611d36565b8281528d828486010111156123ed5760008081fd5b6123fc838c83018487016120c9565b8552505050918601919086019061239c565b9998505050505050505050565b6000825161242d8184602087016120c9565b7f2e65746800000000000000000000000000000000000000000000000000000000920191825250600401919050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401528085166040840152506080606083015261249d60808301846120ed565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361250757612507611f95565b506001019056fea264697066735822122092ddcb8646c7f023058a651dcf40dd9700dd7430568d85ad5d2178d7283f2bbe64736f6c63430008110033", + "deployedBytecode": "0x60806040526004361061016a5760003560e01c80638d839ffe116100cb578063aeb8ce9b1161007f578063d555254a11610059578063d555254a1461044a578063f14fcbc81461046a578063f2fde38b1461048a57600080fd5b8063aeb8ce9b146103c2578063ce1e09c0146103e2578063d3419bf31461041657600080fd5b80639791c097116100b05780639791c0971461035b578063a8e5fbc01461037b578063acf1a841146103af57600080fd5b80638d839ffe146102fc5780638da5cb5b1461033057600080fd5b80637acaaf2611610122578063839df94511610107578063839df9451461026f57806383e7f6ff146102aa5780638a95b09f146102e557600080fd5b80637acaaf2614610203578063808698531461021657600080fd5b80635d3590d5116101535780635d3590d5146101bb5780636459220f146101db578063715018a6146101ee57600080fd5b806301ffc9a71461016f5780633ccfd60b146101a4575b600080fd5b34801561017b57600080fd5b5061018f61018a366004611a07565b6104aa565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101b9610543565b005b3480156101c757600080fd5b506101b96101d6366004611a72565b61058d565b6101b96101e9366004611b23565b6106b2565b3480156101fa57600080fd5b506101b9610820565b6101b9610211366004611be4565b6108ad565b34801561022257600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561027b57600080fd5b5061029c61028a366004611cbd565b60016020526000908152604090205481565b60405190815260200161019b565b3480156102b657600080fd5b506102ca6102c5366004611db4565b610be6565b6040805182518152602092830151928101929092520161019b565b3480156102f157600080fd5b5061029c6224ea0081565b34801561030857600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561033c57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661024a565b34801561036757600080fd5b5061018f610376366004611df9565b610d46565b34801561038757600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b6101b96103bd366004611e2e565b610d5b565b3480156103ce57600080fd5b5061018f6103dd366004611df9565b610d6e565b3480156103ee57600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561042257600080fd5b5061024a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561045657600080fd5b5061029c610465366004611e7a565b610e3e565b34801561047657600080fd5b506101b9610485366004611cbd565b610eec565b34801561049657600080fd5b506101b96104a5366004611f4d565b610f75565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061053d57507fffffffff0000000000000000000000000000000000000000000000000000000082167fdf7ed18100000000000000000000000000000000000000000000000000000000145b92915050565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116914780156108fc02929091818181858888f1935050505015801561058a573d6000803e3d6000fd5b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ac9190611f68565b50505050565b600085856040516106c4929190611f85565b604080519182900382207f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020840152908201819052915060009060600160408051808303601f190181529082905280516020909101207ff44779b90000000000000000000000000000000000000000000000000000000082526004820181905233602483015291507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f44779b9906044016020604051808303816000875af11580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611f68565b61080a576040517fe4fd57ae0000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b61081787878787876110a2565b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060a565b6108ab6000611466565b565b60006108f08c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d9250610be6915050565b6020810151815191925061090391611fc4565b34101561093c576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109e08c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508a6109db8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e8e8e8e8e8e8e8e8e610e3e565b6114db565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639f56dac68e8e8e8e8d8a8a6040518863ffffffff1660e01b8152600401610a479796959493929190612002565b6020604051808303816000875af1158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a919061206c565b90508515610ab557610ab5888e8e604051610aa6929190611f85565b60405180910390208989611658565b8415610afe57610afe8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925033915061173f9050565b8a73ffffffffffffffffffffffffffffffffffffffff168d8d604051610b25929190611f85565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278f8f8660000151876020015187604051610b6c959493929190612085565b60405180910390a360208201518251610b859190611fc4565b341115610bd7576020820151825133916108fc91610ba39190611fc4565b610bad90346120b6565b6040518115909202916000818181858888f19350505050158015610bd5573d6000803e3d6000fd5b505b50505050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116916350e9a7159187917f00000000000000000000000000000000000000000000000000000000000000009091169063d6e4fa8690602401602060405180830381865afa158015610cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdf919061206c565b866040518463ffffffff1660e01b8152600401610cfe93929190612119565b6040805180830381865afa158015610d1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3e919061213e565b949350505050565b60006003610d5383611800565b101592915050565b610d698383836000806110a2565b505050565b80516020820120600090610d8183610d46565b8015610e3757506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906396e494e890602401602060405180830381865afa158015610e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e379190611f68565b9392505050565b895160208b01206000908515801590610e6b575073ffffffffffffffffffffffffffffffffffffffff8816155b15610ea2576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808b8b8a8a8a8e8b8b8b604051602001610ec59a9998979695949392919061223d565b604051602081830303815290604052805190602001209150509a9950505050505050505050565b6000818152600160205260409020544290610f28907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b10610f62576040517f0a059d710000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b6000908152600160205260409020429055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ff6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060a565b73ffffffffffffffffffffffffffffffffffffffff8116611099576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161060a565b61058a81611466565b600085856040516110b4929190611f85565b604080519182900382207f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020840152908201819052915060009060600160408051601f198184030181528282528051602091820120601f8a01829004820284018201909252888352909250839160009161114c91908b908b90819084018382808284376000920191909152508b9250610be6915050565b805190915034101561118a576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd0cd0d9000000000000000000000000000000000000000000000000000000008152600481018490526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063fd0cd0d990602401602060405180830381865afa158015611218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123c9190611f68565b1561131c576040517f47d2e9fe000000000000000000000000000000000000000000000000000000008152600481018490526024810189905263ffffffff8816604482015267ffffffffffffffff871660648201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906347d2e9fe906084016020604051808303816000875af11580156112f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611315919061206c565b90506113d7565b6040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101849052602481018990527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063c475abff906044016020604051808303816000875af11580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d4919061206c565b90505b815134111561141c57815133906108fc906113f290346120b6565b6040518115909202916000818181858888f1935050505015801561141a573d6000803e3d6000fd5b505b847f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8b8b348560405161145294939291906122bf565b60405180910390a250505050505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600160205260409020544290611517907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b1115611552576040517f5320bcf90000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b600081815260016020526040902054429061158e907f000000000000000000000000000000000000000000000000000000000000000090611fc4565b116115c8576040517fcb7690d70000000000000000000000000000000000000000000000000000000081526004810182905260240161060a565b6115d183610d6e565b61160957826040517f477707e800000000000000000000000000000000000000000000000000000000815260040161060a91906122e6565b6000818152600160205260408120556224ea00821015610d69576040517f9a71997b0000000000000000000000000000000000000000000000000000000081526004810183905260240161060a565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb00000000000000000000000000000000000000000000000000000000909252859073ffffffffffffffffffffffffffffffffffffffff82169063e32954eb906116f8908590889088906064016122f9565b6000604051808303816000875af1158015611717573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610817919081019061231c565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637a806d6b3383858760405160200161178f919061241b565b6040516020818303038152906040526040518563ffffffff1660e01b81526004016117bd949392919061245c565b6020604051808303816000875af11580156117dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ac919061206c565b8051600090819081905b808210156119fe576000858381518110611826576118266124a7565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561188957611882600184611fc4565b92506119eb565b7fe0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156118de57611882600284611fc4565b7ff0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561193357611882600384611fc4565b7ff8000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561198857611882600484611fc4565b7ffc000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156119dd57611882600584611fc4565b6119e8600684611fc4565b92505b50826119f6816124d6565b93505061180a565b50909392505050565b600060208284031215611a1957600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610e3757600080fd5b803573ffffffffffffffffffffffffffffffffffffffff81168114611a6d57600080fd5b919050565b600080600060608486031215611a8757600080fd5b611a9084611a49565b9250611a9e60208501611a49565b9150604084013590509250925092565b60008083601f840112611ac057600080fd5b50813567ffffffffffffffff811115611ad857600080fd5b602083019150836020828501011115611af057600080fd5b9250929050565b803563ffffffff81168114611a6d57600080fd5b803567ffffffffffffffff81168114611a6d57600080fd5b600080600080600060808688031215611b3b57600080fd5b853567ffffffffffffffff811115611b5257600080fd5b611b5e88828901611aae565b90965094505060208601359250611b7760408701611af7565b9150611b8560608701611b0b565b90509295509295909350565b60008083601f840112611ba357600080fd5b50813567ffffffffffffffff811115611bbb57600080fd5b6020830191508360208260051b8501011115611af057600080fd5b801515811461058a57600080fd5b60008060008060008060008060008060006101208c8e031215611c0657600080fd5b67ffffffffffffffff808d351115611c1d57600080fd5b611c2a8e8e358f01611aae565b909c509a50611c3b60208e01611a49565b995060408d0135985060608d01359750611c5760808e01611a49565b96508060a08e01351115611c6a57600080fd5b50611c7b8d60a08e01358e01611b91565b909550935060c08c0135611c8e81611bd6565b9250611c9c60e08d01611af7565b9150611cab6101008d01611b0b565b90509295989b509295989b9093969950565b600060208284031215611ccf57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611d2e57611d2e611cd6565b604052919050565b600067ffffffffffffffff821115611d5057611d50611cd6565b50601f01601f191660200190565b600082601f830112611d6f57600080fd5b8135611d82611d7d82611d36565b611d05565b818152846020838601011115611d9757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215611dc757600080fd5b823567ffffffffffffffff811115611dde57600080fd5b611dea85828601611d5e565b95602094909401359450505050565b600060208284031215611e0b57600080fd5b813567ffffffffffffffff811115611e2257600080fd5b610d3e84828501611d5e565b600080600060408486031215611e4357600080fd5b833567ffffffffffffffff811115611e5a57600080fd5b611e6686828701611aae565b909790965060209590950135949350505050565b6000806000806000806000806000806101208b8d031215611e9a57600080fd5b8a3567ffffffffffffffff80821115611eb257600080fd5b611ebe8e838f01611d5e565b9b50611ecc60208e01611a49565b9a5060408d0135995060608d01359850611ee860808e01611a49565b975060a08d0135915080821115611efe57600080fd5b50611f0b8d828e01611b91565b90965094505060c08b0135611f1f81611bd6565b9250611f2d60e08c01611af7565b9150611f3c6101008c01611b0b565b90509295989b9194979a5092959850565b600060208284031215611f5f57600080fd5b610e3782611a49565b600060208284031215611f7a57600080fd5b8151610e3781611bd6565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561053d5761053d611f95565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60c08152600061201660c08301898b611fd7565b905073ffffffffffffffffffffffffffffffffffffffff808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a083015298975050505050505050565b60006020828403121561207e57600080fd5b5051919050565b608081526000612099608083018789611fd7565b602083019590955250604081019290925260609091015292915050565b8181038181111561053d5761053d611f95565b60005b838110156120e45781810151838201526020016120cc565b50506000910152565b600081518084526121058160208601602086016120c9565b601f01601f19169290920160200192915050565b60608152600061212c60608301866120ed565b60208301949094525060400152919050565b60006040828403121561215057600080fd5b6040516040810181811067ffffffffffffffff8211171561217357612173611cd6565b604052825181526020928301519281019290925250919050565b81835260006020808501808196508560051b810191508460005b8781101561223057828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030181126121e657600080fd5b8701858101903567ffffffffffffffff81111561220257600080fd5b80360382131561221157600080fd5b61221c868284611fd7565b9a87019a95505050908401906001016121a7565b5091979650505050505050565b60006101208c835273ffffffffffffffffffffffffffffffffffffffff808d1660208501528b6040850152808b16606085015250806080840152612284818401898b61218d565b60a0840197909752505092151560c084015263ffffffff9190911660e083015267ffffffffffffffff16610100909101529695505050505050565b6060815260006122d3606083018688611fd7565b6020830194909452506040015292915050565b602081526000610e3760208301846120ed565b83815260406020820152600061231360408301848661218d565b95945050505050565b6000602080838503121561232f57600080fd5b825167ffffffffffffffff8082111561234757600080fd5b818501915085601f83011261235b57600080fd5b81518181111561236d5761236d611cd6565b8060051b61237c858201611d05565b918252838101850191858101908984111561239657600080fd5b86860192505b8383101561240e578251858111156123b45760008081fd5b8601603f81018b136123c65760008081fd5b8781015160406123d8611d7d83611d36565b8281528d828486010111156123ed5760008081fd5b6123fc838c83018487016120c9565b8552505050918601919086019061239c565b9998505050505050505050565b6000825161242d8184602087016120c9565b7f2e65746800000000000000000000000000000000000000000000000000000000920191825250600401919050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401528085166040840152506080606083015261249d60808301846120ed565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361250757612507611f95565b506001019056fea264697066735822122092ddcb8646c7f023058a651dcf40dd9700dd7430568d85ad5d2178d7283f2bbe64736f6c63430008110033", + "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": 545, + "contract": "contracts/ethregistrar/ETHRegistrarController.sol:ETHRegistrarController", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 9866, + "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/goerli/ExponentialPremiumPriceOracle.json b/deployments/goerli/ExponentialPremiumPriceOracle.json new file mode 100644 index 00000000..5d2ff868 --- /dev/null +++ b/deployments/goerli/ExponentialPremiumPriceOracle.json @@ -0,0 +1,304 @@ +{ + "address": "0x446C8f1ce718D100a2018B887416cDd4A213E95c", + "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": "0x8443bc6bb529de22ffbeab07df87fa10c571b69e07594612eeb24a14279b2b24", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0x446C8f1ce718D100a2018B887416cDd4A213E95c", + "transactionIndex": 14, + "gasUsed": "860573", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xff77c92e43e8bdac0fac6b643ed1468d651c7b2a289b98060be8c9b57ba7b0f9", + "transactionHash": "0x8443bc6bb529de22ffbeab07df87fa10c571b69e07594612eeb24a14279b2b24", + "logs": [], + "blockNumber": 7625499, + "cumulativeGasUsed": "3476871", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeB5245aa9619D05BC2bAa1baa31c2876ad392E5e", + [ + 0, + 0, + "20294266869609", + "5073566717402", + "158548959919" + ], + "100000000000000000000000000", + 21 + ], + "numDeployments": 1, + "solcInputHash": "a5ab15037ea2d912526c4e5696fda13f", + "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\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"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(uint256 startPremium, uint256 elapsed)\\n public\\n pure\\n returns (uint256)\\n {\\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(uint256 fraction, uint256 premium)\\n internal\\n pure\\n returns (uint256)\\n {\\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(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x27c65d1e85df53443323b399cc0356c7659304c58863655d66edbd1048a9a3aa\",\"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/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\",\"keccak256\":\"0xcb33819183087dcf646afd774ac6d2fb59d4fcb3f669b45b679cb8a936f0d22b\",\"license\":\"MIT\"},\"contracts/ethregistrar/StablePriceOracle.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport \\\"./IPriceOracle.sol\\\";\\nimport \\\"./SafeMath.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 SafeMath for *;\\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(bytes4 interfaceID)\\n public\\n view\\n virtual\\n returns (bool)\\n {\\n return\\n interfaceID == type(IERC165).interfaceId ||\\n interfaceID == type(IPriceOracle).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xb05505ede4d654283caaa035e1083af0ff7df41e1038889a35ac129703b45b58\",\"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": "0x6101806040523480156200001257600080fd5b50604051620011683803806200116883398101604081905262000035916200012c565b6001600160a01b0384166101205282518490849081906000906200005d576200005d62000227565b6020026020010151608081815250508060018151811062000082576200008262000227565b602002602001015160a0818152505080600281518110620000a757620000a762000227565b602002602001015160c0818152505080600381518110620000cc57620000cc62000227565b602002602001015160e0818152505080600481518110620000f157620000f162000227565b60209081029190910101516101005250506101408290521c61016052506200023d9050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156200014357600080fd5b84516001600160a01b03811681146200015b57600080fd5b602086810151919550906001600160401b03808211156200017b57600080fd5b818801915088601f8301126200019057600080fd5b815181811115620001a557620001a562000116565b8060051b604051601f19603f83011681018181108582111715620001cd57620001cd62000116565b60405291825284820192508381018501918b831115620001ec57600080fd5b938501935b828510156200020c57845184529385019392850192620001f1565b60408b01516060909b0151999c909b50975050505050505050565b634e487b7160e01b600052603260045260246000fd5b60805160a05160c05160e05161010051610120516101405161016051610e95620002d3600039600081816108d101526108fb015260006108a80152600081816101c701526107c301526000818161015301526102d401526000818161023a015261030d01526000818161018d015261033f015260008181610213015261037101526000818160f0015261039b0152610e956000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a200e15311610076578063c8a4271f1161005b578063c8a4271f146101c2578063cd5d2c741461020e578063d820ed421461023557600080fd5b8063a200e15314610188578063a34e3596146101af57600080fd5b806350e9a715116100a757806350e9a7151461012057806359b6b86c1461014e57806359e1777c1461017557600080fd5b806301ffc9a7146100c35780632c0fd74c146100eb575b600080fd5b6100d66100d1366004610c55565b61025c565b60405190151581526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100e2565b61013361012e366004610c97565b61026d565b604080518251815260209283015192810192909252016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b610112610183366004610d16565b610433565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101126101bd366004610c97565b6104ce565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60006102678261051f565b92915050565b604080518082019091526000808252602082015260006102c286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105b792505050565b90506000600582106102ff576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b90506103c2565b81600403610331576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b81600303610363576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b81600203610395576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b6103bf847f0000000000000000000000000000000000000000000000000000000000000000610d67565b90505b60405180604001604052806103d6836107be565b81526020016104266104218a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92508b91506108729050565b6107be565b9052979650505050505050565b6000806201518061044c670de0b6b3a764000085610d67565b6104569190610d7e565b9050600061046c670de0b6b3a764000083610d7e565b905084811c6000610485670de0b6b3a764000084610d67565b61048f9085610db9565b90506000670de0b6b3a76400006104a98362010000610d67565b6104b39190610d7e565b905060006104c18285610935565b9998505050505050505050565b600061051661042186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506108729050565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061026757507fffffffff0000000000000000000000000000000000000000000000000000000082167f50e9a715000000000000000000000000000000000000000000000000000000001492915050565b8051600090819081905b808210156107b55760008583815181106105dd576105dd610dcc565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561064057610639600184610dfb565b92506107a2565b7fe0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561069557610639600284610dfb565b7ff0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156106ea57610639600384610dfb565b7ff8000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561073f57610639600484610dfb565b7ffc000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561079457610639600584610dfb565b61079f600684610dfb565b92505b50826107ad81610e0e565b9350506105c1565b50909392505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108509190610e46565b905080610861846305f5e100610d67565b61086b9190610d7e565b9392505050565b60006108816276a70084610dfb565b9250428311156108935750600061086b565b600061089f8442610db9565b905060006108cd7f000000000000000000000000000000000000000000000000000000000000000083610433565b90507f00000000000000000000000000000000000000000000000000000000000000008110610929576109207f000000000000000000000000000000000000000000000000000000000000000082610db9565b9250505061086b565b50600095945050505050565b6000600183161561096857670de0b6b3a764000061095b670de0ad151d09418084610d67565b6109659190610d7e565b91505b600283161561099957670de0b6b3a764000061098c670de0a3769959680084610d67565b6109969190610d7e565b91505b60048316156109ca57670de0b6b3a76400006109bd670de09039a5fa510084610d67565b6109c79190610d7e565b91505b60088316156109fb57670de0b6b3a76400006109ee670de069c00f3e120084610d67565b6109f89190610d7e565b91505b6010831615610a2c57670de0b6b3a7640000610a1f670de01cce21c9440084610d67565b610a299190610d7e565b91505b6020831615610a5d57670de0b6b3a7640000610a50670ddf82ef46ce100084610d67565b610a5a9190610d7e565b91505b6040831615610a8e57670de0b6b3a7640000610a81670dde4f458f8e8d8084610d67565b610a8b9190610d7e565b91505b6080831615610abf57670de0b6b3a7640000610ab2670ddbe84213d5f08084610d67565b610abc9190610d7e565b91505b610100831615610af157670de0b6b3a7640000610ae4670dd71b7aa6df5b8084610d67565b610aee9190610d7e565b91505b610200831615610b2357670de0b6b3a7640000610b16670dcd86e7f28cde0084610d67565b610b209190610d7e565b91505b610400831615610b5557670de0b6b3a7640000610b48670dba71a3084ad68084610d67565b610b529190610d7e565b91505b610800831615610b8757670de0b6b3a7640000610b7a670d94961b13dbde8084610d67565b610b849190610d7e565b91505b611000831615610bb957670de0b6b3a7640000610bac670d4a171c35c9838084610d67565b610bb69190610d7e565b91505b612000831615610beb57670de0b6b3a7640000610bde670cb9da519ccfb70084610d67565b610be89190610d7e565b91505b614000831615610c1d57670de0b6b3a7640000610c10670bab76d59c18d68084610d67565b610c1a9190610d7e565b91505b618000831615610c4f57670de0b6b3a7640000610c426709d025defee4df8084610d67565b610c4c9190610d7e565b91505b50919050565b600060208284031215610c6757600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461086b57600080fd5b60008060008060608587031215610cad57600080fd5b843567ffffffffffffffff80821115610cc557600080fd5b818701915087601f830112610cd957600080fd5b813581811115610ce857600080fd5b886020828501011115610cfa57600080fd5b6020928301999098509187013596604001359550909350505050565b60008060408385031215610d2957600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761026757610267610d38565b600082610db4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561026757610267610d38565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8082018082111561026757610267610d38565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e3f57610e3f610d38565b5060010190565b600060208284031215610e5857600080fd5b505191905056fea264697066735822122026ee1972789ed12d69c43bb984759c3d84f50065c3e2508d4e865675e467d74564736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063a200e15311610076578063c8a4271f1161005b578063c8a4271f146101c2578063cd5d2c741461020e578063d820ed421461023557600080fd5b8063a200e15314610188578063a34e3596146101af57600080fd5b806350e9a715116100a757806350e9a7151461012057806359b6b86c1461014e57806359e1777c1461017557600080fd5b806301ffc9a7146100c35780632c0fd74c146100eb575b600080fd5b6100d66100d1366004610c55565b61025c565b60405190151581526020015b60405180910390f35b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100e2565b61013361012e366004610c97565b61026d565b604080518251815260209283015192810192909252016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b610112610183366004610d16565b610433565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101126101bd366004610c97565b6104ce565b6101e97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e2565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b6101127f000000000000000000000000000000000000000000000000000000000000000081565b60006102678261051f565b92915050565b604080518082019091526000808252602082015260006102c286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105b792505050565b90506000600582106102ff576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b90506103c2565b81600403610331576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b81600303610363576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b81600203610395576102f8847f0000000000000000000000000000000000000000000000000000000000000000610d67565b6103bf847f0000000000000000000000000000000000000000000000000000000000000000610d67565b90505b60405180604001604052806103d6836107be565b81526020016104266104218a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c92508b91506108729050565b6107be565b9052979650505050505050565b6000806201518061044c670de0b6b3a764000085610d67565b6104569190610d7e565b9050600061046c670de0b6b3a764000083610d7e565b905084811c6000610485670de0b6b3a764000084610d67565b61048f9085610db9565b90506000670de0b6b3a76400006104a98362010000610d67565b6104b39190610d7e565b905060006104c18285610935565b9998505050505050505050565b600061051661042186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506108729050565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061026757507fffffffff0000000000000000000000000000000000000000000000000000000082167f50e9a715000000000000000000000000000000000000000000000000000000001492915050565b8051600090819081905b808210156107b55760008583815181106105dd576105dd610dcc565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f800000000000000000000000000000000000000000000000000000000000000081101561064057610639600184610dfb565b92506107a2565b7fe0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561069557610639600284610dfb565b7ff0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156106ea57610639600384610dfb565b7ff8000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561073f57610639600484610dfb565b7ffc000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561079457610639600584610dfb565b61079f600684610dfb565b92505b50826107ad81610e0e565b9350506105c1565b50909392505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108509190610e46565b905080610861846305f5e100610d67565b61086b9190610d7e565b9392505050565b60006108816276a70084610dfb565b9250428311156108935750600061086b565b600061089f8442610db9565b905060006108cd7f000000000000000000000000000000000000000000000000000000000000000083610433565b90507f00000000000000000000000000000000000000000000000000000000000000008110610929576109207f000000000000000000000000000000000000000000000000000000000000000082610db9565b9250505061086b565b50600095945050505050565b6000600183161561096857670de0b6b3a764000061095b670de0ad151d09418084610d67565b6109659190610d7e565b91505b600283161561099957670de0b6b3a764000061098c670de0a3769959680084610d67565b6109969190610d7e565b91505b60048316156109ca57670de0b6b3a76400006109bd670de09039a5fa510084610d67565b6109c79190610d7e565b91505b60088316156109fb57670de0b6b3a76400006109ee670de069c00f3e120084610d67565b6109f89190610d7e565b91505b6010831615610a2c57670de0b6b3a7640000610a1f670de01cce21c9440084610d67565b610a299190610d7e565b91505b6020831615610a5d57670de0b6b3a7640000610a50670ddf82ef46ce100084610d67565b610a5a9190610d7e565b91505b6040831615610a8e57670de0b6b3a7640000610a81670dde4f458f8e8d8084610d67565b610a8b9190610d7e565b91505b6080831615610abf57670de0b6b3a7640000610ab2670ddbe84213d5f08084610d67565b610abc9190610d7e565b91505b610100831615610af157670de0b6b3a7640000610ae4670dd71b7aa6df5b8084610d67565b610aee9190610d7e565b91505b610200831615610b2357670de0b6b3a7640000610b16670dcd86e7f28cde0084610d67565b610b209190610d7e565b91505b610400831615610b5557670de0b6b3a7640000610b48670dba71a3084ad68084610d67565b610b529190610d7e565b91505b610800831615610b8757670de0b6b3a7640000610b7a670d94961b13dbde8084610d67565b610b849190610d7e565b91505b611000831615610bb957670de0b6b3a7640000610bac670d4a171c35c9838084610d67565b610bb69190610d7e565b91505b612000831615610beb57670de0b6b3a7640000610bde670cb9da519ccfb70084610d67565b610be89190610d7e565b91505b614000831615610c1d57670de0b6b3a7640000610c10670bab76d59c18d68084610d67565b610c1a9190610d7e565b91505b618000831615610c4f57670de0b6b3a7640000610c426709d025defee4df8084610d67565b610c4c9190610d7e565b91505b50919050565b600060208284031215610c6757600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461086b57600080fd5b60008060008060608587031215610cad57600080fd5b843567ffffffffffffffff80821115610cc557600080fd5b818701915087601f830112610cd957600080fd5b813581811115610ce857600080fd5b886020828501011115610cfa57600080fd5b6020928301999098509187013596604001359550909350505050565b60008060408385031215610d2957600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761026757610267610d38565b600082610db4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561026757610267610d38565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b8082018082111561026757610267610d38565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e3f57610e3f610d38565b5060010190565b600060208284031215610e5857600080fd5b505191905056fea264697066735822122026ee1972789ed12d69c43bb984759c3d84f50065c3e2508d4e865675e467d74564736f6c63430008110033", + "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/goerli/NameWrapper.json b/deployments/goerli/NameWrapper.json new file mode 100644 index 00000000..14d6f850 --- /dev/null +++ b/deployments/goerli/NameWrapper.json @@ -0,0 +1,1806 @@ +{ + "address": "0xC5A419AbB14d69945B3A143326B2d825d505714f", + "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": [ + { + "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": "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": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "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": "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": "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": "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": "node", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isTokenOwnerOrApproved", + "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": [ + { + "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": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "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" + }, + { + "internalType": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + } + ], + "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": "uint32", + "name": "fuses", + "type": "uint32" + } + ], + "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": "bytes32", + "name": "parentNode", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "upgradeContract", + "outputs": [ + { + "internalType": "contract INameWrapperUpgrade", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "address", + "name": "wrappedOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "upgradeETH2LD", + "outputs": [], + "stateMutability": "nonpayable", + "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": "uint32", + "name": "fuses", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "address", + "name": "resolver", + "type": "address" + } + ], + "name": "wrapETH2LD", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x29fdf60491a128bf3cd54ee93c4d7b7019eb965458a57660934fcab9ebd0cce9", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0xC5A419AbB14d69945B3A143326B2d825d505714f", + "transactionIndex": 5, + "gasUsed": "5336080", + "logsBloom": "0x00000000000000000000000000000000000040000000000000800000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000010000000000020000000000000001000800000000000000000000000000000000400000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0efb280a7e1b6292966ce5e934c1d58ffe757be02a1e9b4f2229ab6bdbba95b7", + "transactionHash": "0x29fdf60491a128bf3cd54ee93c4d7b7019eb965458a57660934fcab9ebd0cce9", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7625507, + "transactionHash": "0x29fdf60491a128bf3cd54ee93c4d7b7019eb965458a57660934fcab9ebd0cce9", + "address": "0xC5A419AbB14d69945B3A143326B2d825d505714f", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a303ddc620aa7d1390baccc8a495508b183fab59" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x0efb280a7e1b6292966ce5e934c1d58ffe757be02a1e9b4f2229ab6bdbba95b7" + } + ], + "blockNumber": 7625507, + "cumulativeGasUsed": "5595825", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85", + "0x9DAfDe161D690d9e18f8021c392B0dBCBf0Cf8cB" + ], + "numDeployments": 1, + "solcInputHash": "a5ab15037ea2d912526c4e5696fda13f", + "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\":[{\"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\":\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"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\":\"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\":\"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\":\"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\":\"node\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isTokenOwnerOrApproved\",\"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\":[{\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"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\"},{\"internalType\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"}],\"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\":\"bytes32\",\"name\":\"parentNode\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upgradeContract\",\"outputs\":[{\"internalType\":\"contract INameWrapperUpgrade\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"label\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"wrappedOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"upgradeETH2LD\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"uint32\",\"name\":\"fuses\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"wrapETH2LD\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"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\"}},\"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.\"},\"getData(uint256)\":{\"details\":\"Returns the Name's owner address and fuses\"},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC1155-isApprovedForAll}.\"},\"isTokenOwnerOrApproved(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 approved\"}},\"isWrapped(bytes32)\":{\"details\":\"Both of these checks need to be true to be considered wrapped if checked without this contract\",\"params\":{\"node\":\"Namehash of the name\"},\"returns\":{\"_0\":\"Boolean of whether or not the name is wrapped\"}},\"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\"}},\"registerAndWrapETH2LD(string,address,uint256,address,uint32,uint64)\":{\"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.\",\"expiry\":\"When the fuses will expire\",\"fuses\":\"Initial fuses to set\",\"label\":\"The label to register (Eg, 'foo' for 'foo.eth').\",\"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,uint32,uint64)\":{\"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 fuses will expire\",\"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,uint32)\":{\"params\":{\"fuses\":\"Fuses to burn (cannot burn PARENT_CANNOT_CONTROL)\",\"node\":\"Namehash of the name\"},\"returns\":{\"_0\":\"New 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 fuses will expire\",\"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\":\"expiry date for the domain\",\"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 regsitry\"},\"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(bytes32,string,address,address)\":{\"details\":\"Can be called by the owner or an authorised caller Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names\",\"params\":{\"label\":\"Label as a string of the name to upgrade\",\"parentNode\":\"Namehash of the parent name\",\"resolver\":\"Resolver contract for this name\",\"wrappedOwner\":\"Owner of the name in this contract\"}},\"upgradeETH2LD(string,address,address)\":{\"details\":\"Can be called by the owner of the name in this contract\",\"params\":{\"label\":\"Label as a string of the .eth name to upgrade\",\"wrappedOwner\":\"The owner of the wrapped name\"}},\"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,uint32,uint64,address)\":{\"details\":\"Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar\",\"params\":{\"expiry\":\"When the fuses will expire\",\"fuses\":\"Initial fuses to set\",\"label\":\"Label as a string of the .eth domain to wrap\",\"resolver\":\"Resolver contract address\",\"wrappedOwner\":\"Owner of the name in this contract\"},\"returns\":{\"_0\":\"Normalised expiry of when the fuses expire\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"allFusesBurned(bytes32,uint32)\":{\"notice\":\"Checks all Fuses in the mask are burned for the node\"},\"isTokenOwnerOrApproved(bytes32,address)\":{\"notice\":\"Checks if owner or approved by owner\"},\"isWrapped(bytes32)\":{\"notice\":\"Checks if a name is wrapped or not\"},\"recoverFunds(address,address,uint256)\":{\"notice\":\"Recover ERC20 tokens sent to the contract by mistake.\"},\"renew(uint256,uint256,uint32,uint64)\":{\"notice\":\"Renews a .eth second-level domain.\"},\"setChildFuses(bytes32,bytes32,uint32,uint64)\":{\"notice\":\"Sets fuses of a name that you own the parent of. Can also be called by the owner of a .eth name\"},\"setFuses(bytes32,uint32)\":{\"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(bytes32,string,address,address)\":{\"notice\":\"Upgrades a non .eth domain of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain\"},\"upgradeETH2LD(string,address,address)\":{\"notice\":\"Upgrades a .eth wrapped domain by calling the wrapETH2LD function of the upgradeContract and burning the token of this contract\"},\"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,uint32,uint64,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\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 be 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\":\"0x8e93de94c9062ebc94fb7e2e3929b0781ac6a2b7772e2f7a59045861c93e5be9\",\"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.5.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 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 /**\\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\",\"keccak256\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\\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 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 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 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 /**\\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\",\"keccak256\":\"0x516a22876c1fab47f49b1bc22b4614491cd05338af8bd2e7b382da090a079990\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 `IERC721.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\":\"0xd5fa74b4fb323776fa4a8158800fec9d5ac0fec0d6dd046dd93798632ada265f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"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 iff 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\":\"0x9ac51351ff72d73083aed62b7cdad4c07e9d1eb68401d7fd8457bdd828f2c6fe\"},\"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(address owner, address operator)\\n external\\n view\\n returns (bool);\\n}\\n\",\"keccak256\":\"0xf79be82c1a2eb0a77fba4e0972221912e803309081ca460fd2cf61653e55758a\"},\"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(bytes memory self, uint256 offset)\\n internal\\n pure\\n returns (bytes32)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (bytes32 labelhash, uint256 newIdx)\\n {\\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\":\"0xc0d13fcaccd6c3af927106b2ea48eec83c5d0a18d608bde013a53742ac058526\",\"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 _canTransfer 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\\nerror OperationProhibited(bytes32 node);\\n\\nabstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n mapping(uint256 => uint256) public _tokens;\\n\\n // Mapping from owner to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\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 {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(ERC165, IERC165)\\n returns (bool)\\n {\\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(address account, uint256 id)\\n public\\n view\\n virtual\\n override\\n returns (uint256)\\n {\\n require(\\n account != address(0),\\n \\\"ERC1155: balance query for the zero address\\\"\\n );\\n (address owner, , ) = getData(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(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\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(address operator, bool approved)\\n public\\n virtual\\n override\\n {\\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(address account, address operator)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev Returns the Name's owner address and fuses\\n */\\n function getData(uint256 tokenId)\\n public\\n view\\n returns (\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n )\\n {\\n uint256 t = _tokens[tokenId];\\n owner = address(uint160(t));\\n expiry = uint64(t >> 192);\\n if (block.timestamp > expiry) {\\n fuses = 0;\\n } else {\\n fuses = uint32(t >> 160);\\n }\\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 expiration) = getData(id);\\n\\n if (!_canTransfer(fuses)) {\\n revert OperationProhibited(bytes32(id));\\n }\\n\\n require(\\n amount == 1 && oldOwner == from,\\n \\\"ERC1155: insufficient balance for transfer\\\"\\n );\\n _setData(id, to, fuses, expiration);\\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 _canTransfer(uint32 fuses) internal virtual returns (bool);\\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 if (oldExpiry > expiry) {\\n expiry = oldExpiry;\\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 | oldFuses, 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 owner, uint32 fuses, uint64 expiry) = getData(tokenId);\\n // Fuses and expiry are kept on burn\\n _setData(tokenId, address(0x0), fuses, expiry);\\n emit TransferSingle(msg.sender, owner, 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 if (!_canTransfer(fuses)) {\\n revert OperationProhibited(bytes32(id));\\n }\\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\",\"keccak256\":\"0xbdd7565c4f07da414e7df1059ae10f05b826f42ee451fd6b64f920e3b17d5763\",\"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\\\";\\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 PARENT_CANNOT_CONTROL = 64;\\nuint32 constant CAN_DO_EVERYTHING = 0;\\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, 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 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 uint32 fuses,\\n uint64 _expiry,\\n address resolver\\n ) external returns (uint64 expiry);\\n\\n function registerAndWrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint256 duration,\\n address resolver,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (uint256 registrarExpiry);\\n\\n function renew(\\n uint256 labelHash,\\n uint256 duration,\\n uint32 fuses,\\n uint64 expiry\\n ) external returns (uint256 expires);\\n\\n function unwrap(\\n bytes32 node,\\n bytes32 label,\\n address owner\\n ) external;\\n\\n function unwrapETH2LD(\\n bytes32 label,\\n address newRegistrant,\\n address newController\\n ) external;\\n\\n function setFuses(bytes32 node, uint32 fuses)\\n external\\n 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 isTokenOwnerOrApproved(bytes32 node, address addr)\\n external\\n 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 returns (address owner);\\n\\n function allFusesBurned(bytes32 node, uint32 fuseMask)\\n external\\n view\\n returns (bool);\\n\\n function isWrapped(bytes32 node) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa44868603a1df17a4ebbc25354f49db6e1dd73c46e02c3557151154678848cb6\",\"license\":\"MIT\"},\"contracts/wrapper/INameWrapperUpgrade.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\ninterface INameWrapperUpgrade {\\n function setSubnodeRecord(\\n bytes32 parentNode,\\n string calldata label,\\n address owner,\\n address resolver,\\n uint64 ttl,\\n uint32 fuses,\\n uint64 expiry\\n ) external;\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address resolver\\n ) external;\\n}\\n\",\"keccak256\":\"0x40b2719f8a3c5f037dd7c827fd5e694d0e5485bbbca4e66aa9334e097f3d2854\",\"license\":\"MIT\"},\"contracts/wrapper/NameWrapper.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ~0.8.17;\\n\\nimport {ERC1155Fuse, IERC165, OperationProhibited} 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, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING} from \\\"./INameWrapper.sol\\\";\\nimport {INameWrapperUpgrade} from \\\"./INameWrapperUpgrade.sol\\\";\\nimport {IMetadataService} from \\\"./IMetadataService.sol\\\";\\nimport {ENS} from \\\"../registry/ENS.sol\\\";\\nimport {IBaseRegistrar} from \\\"../ethregistrar/IBaseRegistrar.sol\\\";\\nimport {IERC721Receiver} from \\\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.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 NameNotFound();\\nerror IncompatibleParent();\\nerror IncompatibleName(bytes name);\\nerror IncorrectTokenType();\\nerror LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);\\nerror LabelTooShort();\\nerror LabelTooLong(string label);\\nerror IncorrectTargetOwner(address owner);\\nerror CannotUpgrade();\\n\\ncontract NameWrapper is\\n Ownable,\\n ERC1155Fuse,\\n INameWrapper,\\n Controllable,\\n IERC721Receiver,\\n ERC20Recoverable\\n{\\n using BytesUtils for bytes;\\n ENS public immutable override ens;\\n IBaseRegistrar public immutable override registrar;\\n IMetadataService public override metadataService;\\n mapping(bytes32 => bytes) public override names;\\n\\n bytes32 private constant ETH_NODE =\\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\\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 ) {\\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 */\\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(bytes4 interfaceId)\\n public\\n view\\n virtual\\n override(ERC1155Fuse, IERC165)\\n returns (bool)\\n {\\n return\\n interfaceId == type(INameWrapper).interfaceId ||\\n interfaceId == type(IERC721Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /* ERC1155 */\\n\\n function ownerOf(uint256 id)\\n public\\n view\\n override(ERC1155Fuse, INameWrapper)\\n returns (address owner)\\n {\\n return super.ownerOf(id);\\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(IMetadataService _metadataService)\\n public\\n onlyOwner\\n {\\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(uint256 tokenId) public view override returns (string memory) {\\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(INameWrapperUpgrade _upgradeAddress)\\n public\\n onlyOwner\\n {\\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 approved by the owner of a name\\n * @param node namehash of the name to check\\n */\\n\\n modifier onlyTokenOwner(bytes32 node) {\\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n _;\\n }\\n\\n /**\\n * @notice Checks if owner 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 or approved\\n */\\n\\n function isTokenOwnerOrApproved(bytes32 node, address addr)\\n public\\n view\\n override\\n returns (bool)\\n {\\n address owner = ownerOf(uint256(node));\\n return owner == addr || isApprovedForAll(owner, addr);\\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 fuses Initial fuses to set\\n * @param expiry When the fuses will expire\\n * @param resolver Resolver contract address\\n * @return Normalised expiry of when the fuses expire\\n */\\n\\n function wrapETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n uint32 fuses,\\n uint64 expiry,\\n address resolver\\n ) public override returns (uint64) {\\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 return _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);\\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 fuses Initial fuses to set\\n * @param expiry When the fuses will expire\\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 uint32 fuses,\\n uint64 expiry\\n ) external override onlyController returns (uint256 registrarExpiry) {\\n uint256 tokenId = uint256(keccak256(bytes(label)));\\n registrarExpiry = registrar.register(tokenId, address(this), duration);\\n _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);\\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 uint32 fuses,\\n uint64 expiry\\n ) external override onlyController returns (uint256 expires) {\\n bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));\\n\\n expires = registrar.renew(tokenId, duration);\\n (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n expiry = _normaliseExpiry(expiry, oldExpiry, uint64(expires));\\n\\n _setData(node, owner, oldFuses | fuses | PARENT_CANNOT_CONTROL, expiry);\\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 override {\\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 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 override onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {\\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 override onlyTokenOwner(_makeNode(parentNode, labelhash)) {\\n if (parentNode == ETH_NODE) {\\n revert IncompatibleParent();\\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 fuses Fuses to burn (cannot burn PARENT_CANNOT_CONTROL)\\n * @return New fuses\\n */\\n\\n function setFuses(bytes32 node, uint32 fuses)\\n public\\n onlyTokenOwner(node)\\n operationAllowed(node, CANNOT_BURN_FUSES)\\n returns (uint32)\\n {\\n _checkForParentCannotControl(node, fuses);\\n\\n (address owner, uint32 oldFuses, uint64 expiry) = getData(\\n uint256(node)\\n );\\n\\n fuses |= oldFuses;\\n _setFuses(node, owner, fuses, expiry);\\n return fuses;\\n }\\n\\n /**\\n * @notice Upgrades a .eth wrapped domain by calling the wrapETH2LD function of the upgradeContract\\n * and burning the token of this contract\\n * @dev Can be called by the owner of the name in this contract\\n * @param label Label as a string of the .eth name to upgrade\\n * @param wrappedOwner The owner of the wrapped name\\n */\\n\\n function upgradeETH2LD(\\n string calldata label,\\n address wrappedOwner,\\n address resolver\\n ) public {\\n bytes32 labelhash = keccak256(bytes(label));\\n bytes32 node = _makeNode(ETH_NODE, labelhash);\\n (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);\\n\\n upgradeContract.wrapETH2LD(\\n label,\\n wrappedOwner,\\n fuses,\\n expiry,\\n resolver\\n );\\n }\\n\\n /**\\n * @notice Upgrades 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 or an authorised caller\\n * Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names\\n * @param parentNode Namehash of the parent name\\n * @param label Label as a string of the name to upgrade\\n * @param wrappedOwner Owner of the name in this contract\\n * @param resolver Resolver contract for this name\\n */\\n\\n function upgrade(\\n bytes32 parentNode,\\n string calldata label,\\n address wrappedOwner,\\n address resolver\\n ) public {\\n bytes32 labelhash = keccak256(bytes(label));\\n bytes32 node = _makeNode(parentNode, labelhash);\\n (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);\\n upgradeContract.setSubnodeRecord(\\n parentNode,\\n label,\\n wrappedOwner,\\n resolver,\\n 0,\\n fuses,\\n expiry\\n );\\n }\\n\\n /** \\n /* @notice Sets fuses of a name that you own the parent of. Can also be called by the owner of a .eth 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 fuses Fuses to burn\\n * @param expiry When the fuses will expire\\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 (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\\n uint256(node)\\n );\\n uint64 maxExpiry;\\n (, uint32 parentFuses, uint64 parentExpiry) = getData(\\n uint256(parentNode)\\n );\\n if (parentNode == ETH_NODE) {\\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n // max expiry is set to the expiry on the registrar\\n maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));\\n } else {\\n if (!isTokenOwnerOrApproved(parentNode, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n // max expiry is set to the expiry of the parent\\n maxExpiry = parentExpiry;\\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, 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 fuses will expire\\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 )\\n public\\n onlyTokenOwner(parentNode)\\n canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))\\n returns (bytes32 node)\\n {\\n bytes32 labelhash = keccak256(bytes(label));\\n node = _makeNode(parentNode, labelhash);\\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\\n\\n if (!isWrapped(node)) {\\n ens.setSubnodeOwner(parentNode, labelhash, address(this));\\n _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);\\n } else {\\n _addLabelSetFusesAndTransfer(\\n parentNode,\\n node,\\n label,\\n owner,\\n fuses,\\n expiry\\n );\\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 regsitry\\n * @param fuses initial fuses for the wrapped subdomain\\n * @param expiry expiry date for the domain\\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 )\\n public\\n onlyTokenOwner(parentNode)\\n canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))\\n returns (bytes32 node)\\n {\\n bytes32 labelhash = keccak256(bytes(label));\\n node = _makeNode(parentNode, labelhash);\\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 _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);\\n } else {\\n ens.setSubnodeRecord(\\n parentNode,\\n labelhash,\\n address(this),\\n resolver,\\n ttl\\n );\\n _addLabelSetFusesAndTransfer(\\n parentNode,\\n node,\\n label,\\n owner,\\n fuses,\\n expiry\\n );\\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 override\\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 (address oldOwner, , ) = getData(uint256(node));\\n _transfer(oldOwner, owner, uint256(node), 1, \\\"\\\");\\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(bytes32 node, address resolver)\\n public\\n override\\n onlyTokenOwner(node)\\n operationAllowed(node, CANNOT_SET_RESOLVER)\\n {\\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(bytes32 node, uint64 ttl)\\n public\\n override\\n onlyTokenOwner(node)\\n operationAllowed(node, CANNOT_SET_TTL)\\n {\\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 node Namehash of the name to check\\n * @param labelhash Labelhash of the name to check\\n */\\n\\n modifier canCallSetSubnodeOwner(bytes32 node, bytes32 labelhash) {\\n bytes32 subnode = _makeNode(node, labelhash);\\n address owner = ens.owner(subnode);\\n\\n if (owner == address(0)) {\\n (, uint32 fuses, ) = getData(uint256(node));\\n if (fuses & CANNOT_CREATE_SUBDOMAIN != 0) {\\n revert OperationProhibited(subnode);\\n }\\n } else {\\n (, uint32 subnodeFuses, ) = getData(uint256(subnode));\\n if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {\\n revert OperationProhibited(subnode);\\n }\\n }\\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(bytes32 node, uint32 fuseMask)\\n public\\n view\\n override\\n returns (bool)\\n {\\n (, uint32 fuses, ) = getData(uint256(node));\\n return fuses & fuseMask == fuseMask;\\n }\\n\\n /**\\n * @notice Checks if a name is wrapped or not\\n * @dev Both of these checks need to be true to be considered wrapped if checked without this contract\\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 override returns (bool) {\\n return\\n ownerOf(uint256(node)) != address(0) &&\\n ens.owner(node) == address(this);\\n }\\n\\n function onERC721Received(\\n address to,\\n address,\\n uint256 tokenId,\\n bytes calldata data\\n ) public override 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 uint32 fuses,\\n uint64 expiry,\\n address resolver\\n ) = abi.decode(data, (string, address, uint32, uint64, 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 _wrapETH2LD(label, owner, fuses, expiry, resolver);\\n\\n return IERC721Receiver(to).onERC721Received.selector;\\n }\\n\\n /***** Internal functions */\\n\\n function _canTransfer(uint32 fuses) internal pure override returns (bool) {\\n return fuses & CANNOT_TRANSFER == 0;\\n }\\n\\n function _makeNode(bytes32 node, bytes32 labelhash)\\n private\\n pure\\n returns (bytes32)\\n {\\n return keccak256(abi.encodePacked(node, labelhash));\\n }\\n\\n function _addLabel(string memory label, bytes memory name)\\n internal\\n pure\\n returns (bytes memory ret)\\n {\\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 = ownerOf(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 names[node] = name;\\n _mint(node, wrappedOwner, fuses, expiry);\\n emit NameWrapped(node, name, wrappedOwner, fuses, expiry);\\n }\\n\\n function _addLabelAndWrap(\\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 _prepareUpgrade(bytes32 node)\\n private\\n returns (uint32 fuses, uint64 expiry)\\n {\\n if (address(upgradeContract) == address(0)) {\\n revert CannotUpgrade();\\n }\\n\\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\\n revert Unauthorised(node, msg.sender);\\n }\\n\\n (, fuses, expiry) = getData(uint256(node));\\n\\n // burn token and fuse data\\n _burn(uint256(node));\\n }\\n\\n function _addLabelSetFusesAndTransfer(\\n bytes32 parentNode,\\n bytes32 node,\\n string memory label,\\n address owner,\\n uint32 fuses,\\n uint64 expiry\\n ) internal {\\n address oldOwner = ownerOf(uint256(node));\\n bytes memory name = _addLabel(label, names[parentNode]);\\n if (names[node].length == 0) {\\n names[node] = name;\\n }\\n _setFuses(node, oldOwner, fuses, expiry);\\n _transfer(oldOwner, owner, uint256(node), 1, \\\"\\\");\\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 isBurningPCC = fuses & PARENT_CANNOT_CONTROL ==\\n PARENT_CANNOT_CONTROL;\\n\\n bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;\\n\\n if (isBurningPCC && parentHasNotBurnedCU) {\\n revert OperationProhibited(node);\\n }\\n }\\n\\n function _getETH2LDDataAndNormaliseExpiry(\\n bytes32 node,\\n bytes32 labelhash,\\n uint64 expiry\\n )\\n internal\\n view\\n returns (\\n address owner,\\n uint32 fuses,\\n uint64\\n )\\n {\\n uint64 oldExpiry;\\n (owner, fuses, oldExpiry) = getData(uint256(node));\\n uint64 maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));\\n\\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\\n return (owner, fuses, expiry);\\n }\\n\\n function _normaliseExpiry(\\n uint64 expiry,\\n uint64 oldExpiry,\\n uint64 maxExpiry\\n ) internal 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 returns (uint64) {\\n // Mint a new ERC1155 token with fuses\\n // Set PARENT_CANNOT_REPLACE to reflect wrapper + registrar control over the 2LD\\n bytes32 labelhash = keccak256(bytes(label));\\n bytes32 node = _makeNode(ETH_NODE, labelhash);\\n uint32 oldFuses;\\n\\n (, oldFuses, expiry) = _getETH2LDDataAndNormaliseExpiry(\\n node,\\n labelhash,\\n expiry\\n );\\n\\n _addLabelAndWrap(\\n ETH_NODE,\\n node,\\n label,\\n wrappedOwner,\\n fuses | PARENT_CANNOT_CONTROL,\\n expiry\\n );\\n if (resolver != address(0)) {\\n ens.setResolver(node, resolver);\\n }\\n\\n return expiry;\\n }\\n\\n function _unwrap(bytes32 node, address owner) private {\\n if (owner == address(0x0) || owner == address(this)) {\\n revert IncorrectTargetOwner(owner);\\n }\\n\\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 expiry\\n ) internal {\\n _setData(node, owner, fuses, expiry);\\n emit FusesSet(node, fuses, expiry);\\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 (\\n fuses & ~PARENT_CANNOT_CONTROL != 0 &&\\n fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=\\n (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)\\n ) {\\n revert OperationProhibited(node);\\n }\\n }\\n\\n function _checkForParentCannotControl(bytes32 node, uint32 fuses)\\n internal\\n view\\n {\\n if (fuses & PARENT_CANNOT_CONTROL != 0) {\\n // Only the parent can burn the PARENT_CANNOT_CONTROL fuse.\\n revert Unauthorised(node, msg.sender);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d47225c0bce90879190135c829d51dcf3844b5a2d1b17e52c972d5d88fc1ecd\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200622a3803806200622a8339810160408190526200003491620001ef565b6200003f3362000186565b6001600160a01b0383811660805282811660a052600480546001600160a01b031916918316919091179055600163ffffffbf60a01b03197fafa26c20e8b3d9a2853d642cfe1021dae26242ffedfac91c97aab212c1a4b93b8190557fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4955604080518082019091526001815260006020808301829052908052600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc90620001099082620002e8565b50604080518082019091526005808252626cae8d60e31b6020808401919091527f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae600052527fd99130487705d6970718a0cee91984b61956f8a1db3482bba7e6bf0131adb01f906200017c9082620002e8565b50505050620003b4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620001ec57600080fd5b50565b6000806000606084860312156200020557600080fd5b83516200021281620001d6565b60208501519093506200022581620001d6565b60408501519092506200023881620001d6565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200026e57607f821691505b6020821081036200028f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002e357600081815260208120601f850160051c81016020861015620002be5750805b601f850160051c820191505b81811015620002df57828155600101620002ca565b5050505b505050565b81516001600160401b0381111562000304576200030462000243565b6200031c8162000315845462000259565b8462000295565b602080601f8311600181146200035457600084156200033b5750858301515b600019600386901b1c1916600185901b178555620002df565b600085815260208120601f198616915b82811015620003855788860151825594840194600190910190840162000364565b5085821015620003a45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a051615d7e620004ac6000396000818161047201528181610ab601528181610bad0152818161165b0152818161188a01528181611ced01528181611e2a015281816120cd015281816122490152818161336d0152818161343401528181613556015281816135e501526145250152600081816104bf01528181610a3c01528181610d9101528181610f06015281816110a20152818161116d0152818161216b015281816122e7015281816124ad015281816126460152818161282f01528181612cd901528181612da001528181612e8201528181612f14015281816136f4015281816139420152613ff40152615d7e6000f3fe608060405234801561001057600080fd5b50600436106102e85760003560e01c80638b4dfa7511610191578063e0dba60f116100e3578063ee7eba7811610097578063f44779b911610071578063f44779b914610717578063f9547a9e1461072a578063fd0cd0d91461075657600080fd5b8063ee7eba78146106de578063f242432a146106f1578063f2fde38b1461070457600080fd5b8063e985e9c5116100c8578063e985e9c51461066f578063eb8ae530146106ab578063ed70554d146106be57600080fd5b8063e0dba60f14610649578063e72bf00f1461065c57600080fd5b8063b6bcad2611610145578063cf4088231161011f578063cf40882314610600578063d8c9921a14610613578063da8c229e1461062657600080fd5b8063b6bcad26146105b2578063c20a2eb0146105c5578063c658e086146105ed57600080fd5b80639f56dac6116101765780639f56dac614610579578063a22cb4651461058c578063adf4960a1461059f57600080fd5b80638b4dfa75146105555780638da5cb5b1461056857600080fd5b806324c1af441161024a57806347d2e9fe116101fe5780635d3590d5116101d85780635d3590d5146105275780636352211e1461053a578063715018a61461054d57600080fd5b806347d2e9fe146104e15780634e1273f4146104f4578063530954671461051457600080fd5b80632eb2c2d61161022f5780632eb2c2d61461049457806333c69ea9146104a75780633f15457f146104ba57600080fd5b806324c1af441461045a5780632b20e3971461046d57600080fd5b8063150b7a02116102a15780631896f70a116102865780631896f70a146104095780631f4e15041461041c57806320c38e2b1461044757600080fd5b8063150b7a02146103b25780631534e177146103f657600080fd5b806301ffc9a7116102d257806301ffc9a71461035a5780630e89341c1461037d57806314ab90381461039d57600080fd5b8062fdd58e146102ed5780630178fe3f14610313575b600080fd5b6103006102fb366004614ba3565b610769565b6040519081526020015b60405180910390f35b610326610321366004614bcf565b61082a565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161030a565b61036d610368366004614c16565b610861565b604051901515815260200161030a565b61039061038b366004614bcf565b610903565b60405161030a9190614c8a565b6103b06103ab366004614cba565b610990565b005b6103c56103c0366004614d2f565b610aa9565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161030a565b6103b0610404366004614da2565b610c51565b6103b0610417366004614dbf565b610ce5565b60065461042f906001600160a01b031681565b6040516001600160a01b03909116815260200161030a565b610390610455366004614bcf565b610dc0565b610300610468366004614ee3565b610e5a565b61042f7f000000000000000000000000000000000000000000000000000000000000000081565b6103b06104a2366004615016565b6111e8565b6103b06104b53660046150c4565b611586565b61042f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006104ef3660046150c4565b61177f565b61050761050236600461510a565b61193e565b60405161030a9190615208565b60045461042f906001600160a01b031681565b6103b061053536600461521b565b611a7c565b61042f610548366004614bcf565b611b68565b6103b0611b73565b6103b061056336600461525c565b611bd9565b6000546001600160a01b031661042f565b61030061058736600461529e565b611d4f565b6103b061059a366004615331565b611ef3565b61036d6105ad36600461535f565b611ffb565b6103b06105c0366004614da2565b612020565b6105d86105d336600461535f565b612346565b60405163ffffffff909116815260200161030a565b6103006105fb366004615382565b6123f1565b6103b061060e366004615401565b61276d565b6103b0610621366004615439565b6128c8565b61036d610634366004614da2565b60036020526000908152604090205460ff1681565b6103b0610657366004615331565b6129aa565b6103b061066a366004615467565b612a82565b61036d61067d3660046154cf565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6103b06106b9366004615467565b612b93565b6103006106cc366004614bcf565b60016020526000908152604090205481565b6103b06106ec3660046154fd565b612fbb565b6103b06106ff366004615571565b6130b1565b6103b0610712366004614da2565b6131e6565b61036d610725366004614dbf565b6132c5565b61073d6107383660046155da565b613320565b60405167ffffffffffffffff909116815260200161030a565b61036d610764366004614bcf565b61369d565b60006001600160a01b0383166107ec5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60006107f78361082a565b50509050836001600160a01b0316816001600160a01b03160361081e576001915050610824565b60009150505b92915050565b6000818152600160205260408120549060c082901c82428210156108515760009250610859565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe9e4b6e30000000000000000000000000000000000000000000000000000000014806108f457507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b8061082457506108248261376f565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108249190810190615664565b8161099b81336132c5565b6109c15760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b82601060006109cf8361082a565b5091505063ffffffff82821616156109fd5760405163a2a7201360e01b8152600481018490526024016107e3565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b0d576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610b1f878901896156e6565b84516020860120949950929750909550935091508990808214610b78576040517fc65c3ccc00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016107e3565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610bf957600080fd5b505af1158015610c0d573d6000803e3d6000fd5b50505050610c1e8787878787613852565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b6000546001600160a01b03163314610cab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610cf081336132c5565b610d165760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8260086000610d248361082a565b5091505063ffffffff8282161615610d525760405163a2a7201360e01b8152600481018490526024016107e3565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610a6f565b60056020526000908152604090208054610dd99061575e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e059061575e565b8015610e525780601f10610e2757610100808354040283529160200191610e52565b820191906000526020600020905b815481529060010190602001808311610e3557829003601f168201915b505050505081565b600087610e6781336132c5565b610e8d5760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8888805190602001206000610ec98383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015610f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7191906157b1565b90506001600160a01b038116610fbb576000610f8c8561082a565b509150506020811615610fb55760405163a2a7201360e01b8152600481018490526024016107e3565b50610ff1565b6000610fc68361082a565b509150506040811615610fef5760405163a2a7201360e01b8152600481018490526024016107e3565b505b8b5160208d01206110298e82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506110378e888b8b6139ac565b97506110428761369d565b611111576040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156110e657600080fd5b505af11580156110fa573d6000803e3d6000fd5b5050505061110c8e888f8f8d8d6139f2565b6111d7565b6040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156111b157600080fd5b505af11580156111c5573d6000803e3d6000fd5b505050506111d78e888f8f8d8d613aac565b505050505050979650505050505050565b815183511461125f5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b0384166112db5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b03851633148061131557506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6113875760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016107e3565b60005b83518110156115195760008482815181106113a7576113a76157ce565b6020026020010151905060008483815181106113c5576113c56157ce565b6020026020010151905060008060006113dd8561082a565b9250925092506113ee826004161590565b61140e5760405163a2a7201360e01b8152600481018690526024016107e3565b83600114801561142f57508a6001600160a01b0316836001600160a01b0316145b6114a15760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107e3565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790555050505050806115129061582c565b905061138a565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611569929190615864565b60405180910390a461157f338686868686613b49565b5050505050565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806115bb8461082a565b91945092509050600080806115cf8b61082a565b9093509150507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528b016116d55761160687336132c5565b61162c5760405163168ab55d60e31b8152600481018890523360248201526044016107e3565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156116aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ce9190615892565b9250611709565b6116df8b336132c5565b6117055760405163168ab55d60e31b8152600481018890523360248201526044016107e3565b8092505b611714878a84613d55565b61171f888585613d8b565b9750604085161580159061174157508463ffffffff1689861763ffffffff1614155b156117625760405163a2a7201360e01b8152600481018890526024016107e3565b9784179761177287878b8b613dd5565b5050505050505050505050565b3360009081526003602052604081205460ff166118045760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016107e3565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301889052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af11580156118db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ff9190615892565b91506000808061190e8461082a565b92509250925061191f868287613d8b565b9550611932848460408a86171789613e31565b50505050949350505050565b606081518351146119b75760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016107e3565b6000835167ffffffffffffffff8111156119d3576119d3614def565b6040519080825280602002602001820160405280156119fc578160200160208202803683370190505b50905060005b8451811015611a7457611a47858281518110611a2057611a206157ce565b6020026020010151858381518110611a3a57611a3a6157ce565b6020026020010151610769565b828281518110611a5957611a596157ce565b6020908102919091010152611a6d8161582c565b9050611a02565b509392505050565b6000546001600160a01b03163314611ad65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6291906158ab565b50505050565b600061082482613ea2565b6000546001600160a01b03163314611bcd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b611bd76000613eb8565b565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611c2d81336132c5565b611c535760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611ca8905b83613f20565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015611d3157600080fd5b505af1158015611d45573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611dd45760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016107e3565b60008888604051611de69291906158c8565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9f9190615892565b9150611ee689898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b925088915087905089613852565b5050979650505050505050565b6001600160a01b0382163303611f715760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016107e3565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806120078461082a565b50841663ffffffff908116908516149250505092915050565b6000546001600160a01b0316331461207a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6006546001600160a01b0316156121cc576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561211357600080fd5b505af1158015612127573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b1580156121b357600080fd5b505af11580156121c7573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515612343576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561228f57600080fd5b505af11580156122a3573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561232f57600080fd5b505af115801561157f573d6000803e3d6000fd5b50565b60008261235381336132c5565b6123795760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b83600260006123878361082a565b5091505063ffffffff82821616156123b55760405163a2a7201360e01b8152600481018490526024016107e3565b6123bf878761408b565b600080806123cc8a61082a565b92509250925081891798506123e38a848b84613dd5565b509698975050505050505050565b6000866123fe81336132c5565b6124245760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8787876040516124359291906158c8565b604051809103902060006124708383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251891906157b1565b90506001600160a01b0381166125625760006125338561082a565b50915050602081161561255c5760405163a2a7201360e01b8152600481018490526024016107e3565b50612598565b600061256d8361082a565b5091505060408116156125965760405163a2a7201360e01b8152600481018490526024016107e3565b505b60008b8b6040516125aa9291906158c8565b604051809103902090506125e58d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506125f38d888b8b6139ac565b97506125fe8761369d565b61270b576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306ab5923906064016020604051808303816000875af115801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190615892565b506127068d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d6139f2565b61275d565b61275d8d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613aac565b5050505050509695505050505050565b8361277881336132c5565b61279e5760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b84601c60006127ac8361082a565b5091505063ffffffff82821616156127da5760405163a2a7201360e01b8152600481018490526024016107e3565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b15801561287357600080fd5b505af1158015612887573d6000803e3d6000fd5b5050505060006128998960001c61082a565b505090506128bd81898b60001c6001604051806020016040528060008152506140ba565b505050505050505050565b604080516020808201869052818301859052825180830384018152606090920190925280519101206128fa81336132c5565b6129205760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612979576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051602080820187905281830186905282518083038401815260609092019092528051910120611b6290611ca2565b6000546001600160a01b03163314612a045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b60008484604051612a949291906158c8565b60405190819003902090506000612af27f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612b0083614268565b6006546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612b57908b908b908b90889088908d90600401615903565b600060405180830381600087803b158015612b7157600080fd5b505af1158015612b85573d6000803e3d6000fd5b505050505050505050505050565b600080612bda600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506142fd9050565b915091506000612c238288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143b49050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528201612ca7576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015612d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d4c91906157b1565b90506001600160a01b0381163314801590612e0d57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015612de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e0b91906158ab565b155b15612e345760405163168ab55d60e31b8152600481018390523360248201526044016107e3565b6001600160a01b03861615612edf576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015612ec657600080fd5b505af1158015612eda573d6000803e3d6000fd5b505050505b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b158015612f6057600080fd5b505af1158015612f74573d6000803e3d6000fd5b505050506128bd828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d93509150819050614473565b60008484604051612fcd9291906158c8565b60405180910390209050600061300a8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060008061301883614268565b6006546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af4490613074908c908c908c908c908c906000908b908b90600401615959565b600060405180830381600087803b15801561308e57600080fd5b505af11580156130a2573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b03841661312d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b03851633148061316757506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6131d95760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016107e3565b61157f85858585856140ba565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6001600160a01b0381166132bc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107e3565b61234381613eb8565b6000806132d184611b68565b9050826001600160a01b0316816001600160a01b0316148061331857506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b60008087876040516133339291906158c8565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156133bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133e091906157b1565b90506001600160a01b03811633148015906134a157506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa15801561347b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061349f91906158ab565b155b1561351157604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a4016107e3565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561359a57600080fd5b505af11580156135ae573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b15801561363357600080fd5b505af1158015613647573d6000803e3d6000fd5b5050505061369089898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a915089905088613852565b9998505050505050505050565b6000806136a983611b68565b6001600160a01b03161415801561082457506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561373b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061375f91906157b1565b6001600160a01b03161492915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a2600000000000000000000000000000000000000000000000000000000148061380257507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061082457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610824565b84516020860120600090816138ae7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060006138bd8284886144dd565b975091506138f490507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae838b8b60408c178b6139f2565b6001600160a01b0385161561399f576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b15801561398657600080fd5b505af115801561399a573d6000803e3d6000fd5b505050505b5093979650505050505050565b6000806139b88561082a565b925050506000806139cb8860001c61082a565b92509250506139db878784613d55565b6139e6858483613d8b565b98975050505050505050565b60008681526005602052604081208054613a94918791613a119061575e565b80601f0160208091040260200160405190810160405280929190818152602001828054613a3d9061575e565b8015613a8a5780601f10613a5f57610100808354040283529160200191613a8a565b820191906000526020600020905b815481529060010190602001808311613a6d57829003601f168201915b50505050506145b5565b9050613aa38682868686614473565b50505050505050565b6000613ab786611b68565b90506000613add86600560008b81526020019081526020016000208054613a119061575e565b6000888152600560205260409020805491925090613afa9061575e565b9050600003613b1d576000878152600560205260409020613b1b8282615a07565b505b613b2987838686613dd5565b611d4582868960001c6001604051806020016040528060008152506140ba565b6001600160a01b0384163b15613d4d576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613ba69089908990889088908890600401615b03565b6020604051808303816000875af1925050508015613be1575060408051601f3d908101601f19168201909252613bde91810190615b55565b60015b613c9657613bed615b72565b806308c379a003613c265750613c01615b8e565b80613c0c5750613c28565b8060405162461bcd60e51b81526004016107e39190614c8a565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016107e3565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613aa35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107e3565b505050505050565b6040828116146001821615818015613d6a5750805b1561157f5760405163a2a7201360e01b8152600481018690526024016107e3565b60008167ffffffffffffffff168467ffffffffffffffff161115613dad578193505b8267ffffffffffffffff168467ffffffffffffffff161015613dcd578293505b509192915050565b613de184848484613e31565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b613e3b848361465e565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b16179055611b62565b600080613eae8361082a565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381161580613f3e57506001600160a01b03811630145b15613f80576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016107e3565b613f8b826001611ffb565b15613fac5760405163a2a7201360e01b8152600481018390526024016107e3565b613fb582614697565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b15801561403857600080fd5b505af115801561404c573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612a76565b60408116156140b65760405163168ab55d60e31b8152600481018390523360248201526044016107e3565b5050565b60008060006140c88661082a565b9250925092506140d9826004161590565b6140f95760405163a2a7201360e01b8152600481018790526024016107e3565b84600114801561411a5750876001600160a01b0316836001600160a01b0316145b61418c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107e3565b866001600160a01b0316836001600160a01b0316036141ad5750505061157f565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611d45338989898989614752565b60065460009081906001600160a01b03166142af576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142b983336132c5565b6142df5760405163168ab55d60e31b8152600481018490523360248201526044016107e3565b6142e88361082a565b90935091506142f8905083614697565b915091565b600080835183106143505760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016107e3565b6000848481518110614364576143646157ce565b016020015160f81c905080156143905761438985614383866001615c36565b836148ad565b9250614395565b600092505b61439f8185615c36565b6143aa906001615c36565b9150509250929050565b60008060006143c385856142fd565b90925090508161443557600185516143db9190615c49565b84146144295760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016107e3565b50600091506108249050565b61443f85826143b4565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b600085815260056020526040902061448b8582615a07565b50614498858484846148d1565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516144ce9493929190615c5c565b60405180910390a25050505050565b60008080806144eb8761082a565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015614574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145989190615892565b90506145a5868383613d8b565b9550859250505093509350939050565b60606001835110156145f3576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561463157826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016107e39190614c8a565b8251838360405160200161464793929190615ca4565b604051602081830303815290604052905092915050565b63ffffffbf8116158015906146765750604181811614155b156140b65760405163a2a7201360e01b8152600481018390526024016107e3565b60008060006146a58461082a565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b6001600160a01b0384163b15613d4d576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906147af9089908990889088908890600401615d05565b6020604051808303816000875af19250505080156147ea575060408051601f3d908101601f191682019092526147e791810190615b55565b60015b6147f657613bed615b72565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613aa35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107e3565b82516000906148bc8385615c36565b11156148c757600080fd5b5091016020012090565b6148db848361465e565b60006148e685611b68565b90506001600160a01b038116156149375761490085614697565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b61157f85858585836000808061494c8461082a565b9250925092508467ffffffffffffffff168167ffffffffffffffff161115614972578094505b6001600160a01b038316156149c95760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e0060448201526064016107e3565b6001600160a01b038716614a455760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016107e3565b306001600160a01b03881603614ac35760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e747261637400000000000000000000000060648201526084016107e3565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611d453360008987600160405180602001604052806000815250614752565b6001600160a01b038116811461234357600080fd5b60008060408385031215614bb657600080fd5b8235614bc181614b8e565b946020939093013593505050565b600060208284031215614be157600080fd5b5035919050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461234357600080fd5b600060208284031215614c2857600080fd5b8135614c3381614be8565b9392505050565b60005b83811015614c55578181015183820152602001614c3d565b50506000910152565b60008151808452614c76816020860160208601614c3a565b601f01601f19169290920160200192915050565b602081526000614c336020830184614c5e565b803567ffffffffffffffff81168114614cb557600080fd5b919050565b60008060408385031215614ccd57600080fd5b82359150614cdd60208401614c9d565b90509250929050565b60008083601f840112614cf857600080fd5b50813567ffffffffffffffff811115614d1057600080fd5b602083019150836020828501011115614d2857600080fd5b9250929050565b600080600080600060808688031215614d4757600080fd5b8535614d5281614b8e565b94506020860135614d6281614b8e565b935060408601359250606086013567ffffffffffffffff811115614d8557600080fd5b614d9188828901614ce6565b969995985093965092949392505050565b600060208284031215614db457600080fd5b8135614c3381614b8e565b60008060408385031215614dd257600080fd5b823591506020830135614de481614b8e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614e4457614e44614def565b6040525050565b600067ffffffffffffffff821115614e6557614e65614def565b50601f01601f191660200190565b600082601f830112614e8457600080fd5b8135614e8f81614e4b565b604051614e9c8282614e1e565b828152856020848701011115614eb157600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614cb557600080fd5b600080600080600080600060e0888a031215614efe57600080fd5b87359650602088013567ffffffffffffffff811115614f1c57600080fd5b614f288a828b01614e73565b9650506040880135614f3981614b8e565b94506060880135614f4981614b8e565b9350614f5760808901614c9d565b9250614f6560a08901614ecf565b9150614f7360c08901614c9d565b905092959891949750929550565b600067ffffffffffffffff821115614f9b57614f9b614def565b5060051b60200190565b600082601f830112614fb657600080fd5b81356020614fc382614f81565b604051614fd08282614e1e565b83815260059390931b8501820192828101915086841115614ff057600080fd5b8286015b8481101561500b5780358352918301918301614ff4565b509695505050505050565b600080600080600060a0868803121561502e57600080fd5b853561503981614b8e565b9450602086013561504981614b8e565b9350604086013567ffffffffffffffff8082111561506657600080fd5b61507289838a01614fa5565b9450606088013591508082111561508857600080fd5b61509489838a01614fa5565b935060808801359150808211156150aa57600080fd5b506150b788828901614e73565b9150509295509295909350565b600080600080608085870312156150da57600080fd5b84359350602085013592506150f160408601614ecf565b91506150ff60608601614c9d565b905092959194509250565b6000806040838503121561511d57600080fd5b823567ffffffffffffffff8082111561513557600080fd5b818501915085601f83011261514957600080fd5b8135602061515682614f81565b6040516151638282614e1e565b83815260059390931b850182019282810191508984111561518357600080fd5b948201945b838610156151aa57853561519b81614b8e565b82529482019490820190615188565b965050860135925050808211156151c057600080fd5b506143aa85828601614fa5565b600081518084526020808501945080840160005b838110156151fd578151875295820195908201906001016151e1565b509495945050505050565b602081526000614c3360208301846151cd565b60008060006060848603121561523057600080fd5b833561523b81614b8e565b9250602084013561524b81614b8e565b929592945050506040919091013590565b60008060006060848603121561527157600080fd5b83359250602084013561528381614b8e565b9150604084013561529381614b8e565b809150509250925092565b600080600080600080600060c0888a0312156152b957600080fd5b873567ffffffffffffffff8111156152d057600080fd5b6152dc8a828b01614ce6565b90985096505060208801356152f081614b8e565b945060408801359350606088013561530781614b8e565b925061531560808901614ecf565b9150614f7360a08901614c9d565b801515811461234357600080fd5b6000806040838503121561534457600080fd5b823561534f81614b8e565b91506020830135614de481615323565b6000806040838503121561537257600080fd5b82359150614cdd60208401614ecf565b60008060008060008060a0878903121561539b57600080fd5b86359550602087013567ffffffffffffffff8111156153b957600080fd5b6153c589828a01614ce6565b90965094505060408701356153d981614b8e565b92506153e760608801614ecf565b91506153f560808801614c9d565b90509295509295509295565b6000806000806080858703121561541757600080fd5b84359350602085013561542981614b8e565b925060408501356150f181614b8e565b60008060006060848603121561544e57600080fd5b8335925060208401359150604084013561529381614b8e565b6000806000806060858703121561547d57600080fd5b843567ffffffffffffffff81111561549457600080fd5b6154a087828801614ce6565b90955093505060208501356154b481614b8e565b915060408501356154c481614b8e565b939692955090935050565b600080604083850312156154e257600080fd5b82356154ed81614b8e565b91506020830135614de481614b8e565b60008060008060006080868803121561551557600080fd5b85359450602086013567ffffffffffffffff81111561553357600080fd5b61553f88828901614ce6565b909550935050604086013561555381614b8e565b9150606086013561556381614b8e565b809150509295509295909350565b600080600080600060a0868803121561558957600080fd5b853561559481614b8e565b945060208601356155a481614b8e565b93506040860135925060608601359150608086013567ffffffffffffffff8111156155ce57600080fd5b6150b788828901614e73565b60008060008060008060a087890312156155f357600080fd5b863567ffffffffffffffff81111561560a57600080fd5b61561689828a01614ce6565b909750955050602087013561562a81614b8e565b935061563860408801614ecf565b925061564660608801614c9d565b9150608087013561565681614b8e565b809150509295509295509295565b60006020828403121561567657600080fd5b815167ffffffffffffffff81111561568d57600080fd5b8201601f8101841361569e57600080fd5b80516156a981614e4b565b6040516156b68282614e1e565b8281528660208486010111156156cb57600080fd5b6156dc836020830160208701614c3a565b9695505050505050565b600080600080600060a086880312156156fe57600080fd5b853567ffffffffffffffff81111561571557600080fd5b61572188828901614e73565b955050602086013561573281614b8e565b935061574060408701614ecf565b925061574e60608701614c9d565b9150608086013561556381614b8e565b600181811c9082168061577257607f821691505b6020821081036157ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000602082840312156157c357600080fd5b8151614c3381614b8e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361585d5761585d6157fd565b5060010190565b60408152600061587760408301856151cd565b828103602084015261588981856151cd565b95945050505050565b6000602082840312156158a457600080fd5b5051919050565b6000602082840312156158bd57600080fd5b8151614c3381615323565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60a08152600061591760a08301888a6158d8565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b88815260e06020820152600061597360e08301898b6158d8565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b601f821115615a0257600081815260208120601f850160051c810160208610156159e35750805b601f850160051c820191505b81811015613d4d578281556001016159ef565b505050565b815167ffffffffffffffff811115615a2157615a21614def565b615a3581615a2f845461575e565b846159bc565b602080601f831160018114615a885760008415615a525750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613d4d565b600085815260208120601f198616915b82811015615ab757888601518255948401946001909101908401615a98565b5085821015615af357878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615b2f60a08301866151cd565b8281036060840152615b4181866151cd565b905082810360808401526139e68185614c5e565b600060208284031215615b6757600080fd5b8151614c3381614be8565b600060033d1115615b8b5760046000803e5060005160e01c5b90565b600060443d1015615b9c5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615bea57505050505090565b8285019150815181811115615c025750505050505090565b843d8701016020828501011115615c1c5750505050505090565b615c2b60208286010187614e1e565b509095945050505050565b80820180821115610824576108246157fd565b81810381811115610824576108246157fd565b608081526000615c6f6080830187614c5e565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615ce1816001850160208801614c3a565b835190830190615cf8816001840160208801614c3a565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615d3d60a0830184614c5e565b97965050505050505056fea2646970667358221220d501c0ce4da154894875391fd82fe62b10183e672a6d3f599c937a7c411c120b64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102e85760003560e01c80638b4dfa7511610191578063e0dba60f116100e3578063ee7eba7811610097578063f44779b911610071578063f44779b914610717578063f9547a9e1461072a578063fd0cd0d91461075657600080fd5b8063ee7eba78146106de578063f242432a146106f1578063f2fde38b1461070457600080fd5b8063e985e9c5116100c8578063e985e9c51461066f578063eb8ae530146106ab578063ed70554d146106be57600080fd5b8063e0dba60f14610649578063e72bf00f1461065c57600080fd5b8063b6bcad2611610145578063cf4088231161011f578063cf40882314610600578063d8c9921a14610613578063da8c229e1461062657600080fd5b8063b6bcad26146105b2578063c20a2eb0146105c5578063c658e086146105ed57600080fd5b80639f56dac6116101765780639f56dac614610579578063a22cb4651461058c578063adf4960a1461059f57600080fd5b80638b4dfa75146105555780638da5cb5b1461056857600080fd5b806324c1af441161024a57806347d2e9fe116101fe5780635d3590d5116101d85780635d3590d5146105275780636352211e1461053a578063715018a61461054d57600080fd5b806347d2e9fe146104e15780634e1273f4146104f4578063530954671461051457600080fd5b80632eb2c2d61161022f5780632eb2c2d61461049457806333c69ea9146104a75780633f15457f146104ba57600080fd5b806324c1af441461045a5780632b20e3971461046d57600080fd5b8063150b7a02116102a15780631896f70a116102865780631896f70a146104095780631f4e15041461041c57806320c38e2b1461044757600080fd5b8063150b7a02146103b25780631534e177146103f657600080fd5b806301ffc9a7116102d257806301ffc9a71461035a5780630e89341c1461037d57806314ab90381461039d57600080fd5b8062fdd58e146102ed5780630178fe3f14610313575b600080fd5b6103006102fb366004614ba3565b610769565b6040519081526020015b60405180910390f35b610326610321366004614bcf565b61082a565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161030a565b61036d610368366004614c16565b610861565b604051901515815260200161030a565b61039061038b366004614bcf565b610903565b60405161030a9190614c8a565b6103b06103ab366004614cba565b610990565b005b6103c56103c0366004614d2f565b610aa9565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161030a565b6103b0610404366004614da2565b610c51565b6103b0610417366004614dbf565b610ce5565b60065461042f906001600160a01b031681565b6040516001600160a01b03909116815260200161030a565b610390610455366004614bcf565b610dc0565b610300610468366004614ee3565b610e5a565b61042f7f000000000000000000000000000000000000000000000000000000000000000081565b6103b06104a2366004615016565b6111e8565b6103b06104b53660046150c4565b611586565b61042f7f000000000000000000000000000000000000000000000000000000000000000081565b6103006104ef3660046150c4565b61177f565b61050761050236600461510a565b61193e565b60405161030a9190615208565b60045461042f906001600160a01b031681565b6103b061053536600461521b565b611a7c565b61042f610548366004614bcf565b611b68565b6103b0611b73565b6103b061056336600461525c565b611bd9565b6000546001600160a01b031661042f565b61030061058736600461529e565b611d4f565b6103b061059a366004615331565b611ef3565b61036d6105ad36600461535f565b611ffb565b6103b06105c0366004614da2565b612020565b6105d86105d336600461535f565b612346565b60405163ffffffff909116815260200161030a565b6103006105fb366004615382565b6123f1565b6103b061060e366004615401565b61276d565b6103b0610621366004615439565b6128c8565b61036d610634366004614da2565b60036020526000908152604090205460ff1681565b6103b0610657366004615331565b6129aa565b6103b061066a366004615467565b612a82565b61036d61067d3660046154cf565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6103b06106b9366004615467565b612b93565b6103006106cc366004614bcf565b60016020526000908152604090205481565b6103b06106ec3660046154fd565b612fbb565b6103b06106ff366004615571565b6130b1565b6103b0610712366004614da2565b6131e6565b61036d610725366004614dbf565b6132c5565b61073d6107383660046155da565b613320565b60405167ffffffffffffffff909116815260200161030a565b61036d610764366004614bcf565b61369d565b60006001600160a01b0383166107ec5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60006107f78361082a565b50509050836001600160a01b0316816001600160a01b03160361081e576001915050610824565b60009150505b92915050565b6000818152600160205260408120549060c082901c82428210156108515760009250610859565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fe9e4b6e30000000000000000000000000000000000000000000000000000000014806108f457507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b8061082457506108248261376f565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108249190810190615664565b8161099b81336132c5565b6109c15760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b82601060006109cf8361082a565b5091505063ffffffff82821616156109fd5760405163a2a7201360e01b8152600481018490526024016107e3565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610a8957600080fd5b505af1158015610a9d573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b0d576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610b1f878901896156e6565b84516020860120949950929750909550935091508990808214610b78576040517fc65c3ccc00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016107e3565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610bf957600080fd5b505af1158015610c0d573d6000803e3d6000fd5b50505050610c1e8787878787613852565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b6000546001600160a01b03163314610cab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610cf081336132c5565b610d165760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8260086000610d248361082a565b5091505063ffffffff8282161615610d525760405163a2a7201360e01b8152600481018490526024016107e3565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610a6f565b60056020526000908152604090208054610dd99061575e565b80601f0160208091040260200160405190810160405280929190818152602001828054610e059061575e565b8015610e525780601f10610e2757610100808354040283529160200191610e52565b820191906000526020600020905b815481529060010190602001808311610e3557829003601f168201915b505050505081565b600087610e6781336132c5565b610e8d5760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8888805190602001206000610ec98383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015610f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7191906157b1565b90506001600160a01b038116610fbb576000610f8c8561082a565b509150506020811615610fb55760405163a2a7201360e01b8152600481018490526024016107e3565b50610ff1565b6000610fc68361082a565b509150506040811615610fef5760405163a2a7201360e01b8152600481018490526024016107e3565b505b8b5160208d01206110298e82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506110378e888b8b6139ac565b97506110428761369d565b611111576040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156110e657600080fd5b505af11580156110fa573d6000803e3d6000fd5b5050505061110c8e888f8f8d8d6139f2565b6111d7565b6040517f5ef2c7f0000000000000000000000000000000000000000000000000000000008152600481018f9052602481018290523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156111b157600080fd5b505af11580156111c5573d6000803e3d6000fd5b505050506111d78e888f8f8d8d613aac565b505050505050979650505050505050565b815183511461125f5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b0384166112db5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b03851633148061131557506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6113875760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016107e3565b60005b83518110156115195760008482815181106113a7576113a76157ce565b6020026020010151905060008483815181106113c5576113c56157ce565b6020026020010151905060008060006113dd8561082a565b9250925092506113ee826004161590565b61140e5760405163a2a7201360e01b8152600481018690526024016107e3565b83600114801561142f57508a6001600160a01b0316836001600160a01b0316145b6114a15760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107e3565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790555050505050806115129061582c565b905061138a565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611569929190615864565b60405180910390a461157f338686868686613b49565b5050505050565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806115bb8461082a565b91945092509050600080806115cf8b61082a565b9093509150507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528b016116d55761160687336132c5565b61162c5760405163168ab55d60e31b8152600481018890523360248201526044016107e3565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156116aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ce9190615892565b9250611709565b6116df8b336132c5565b6117055760405163168ab55d60e31b8152600481018890523360248201526044016107e3565b8092505b611714878a84613d55565b61171f888585613d8b565b9750604085161580159061174157508463ffffffff1689861763ffffffff1614155b156117625760405163a2a7201360e01b8152600481018890526024016107e3565b9784179761177287878b8b613dd5565b5050505050505050505050565b3360009081526003602052604081205460ff166118045760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016107e3565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301889052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af11580156118db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ff9190615892565b91506000808061190e8461082a565b92509250925061191f868287613d8b565b9550611932848460408a86171789613e31565b50505050949350505050565b606081518351146119b75760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016107e3565b6000835167ffffffffffffffff8111156119d3576119d3614def565b6040519080825280602002602001820160405280156119fc578160200160208202803683370190505b50905060005b8451811015611a7457611a47858281518110611a2057611a206157ce565b6020026020010151858381518110611a3a57611a3a6157ce565b6020026020010151610769565b828281518110611a5957611a596157ce565b6020908102919091010152611a6d8161582c565b9050611a02565b509392505050565b6000546001600160a01b03163314611ad65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6291906158ab565b50505050565b600061082482613ea2565b6000546001600160a01b03163314611bcd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b611bd76000613eb8565b565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611c2d81336132c5565b611c535760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611ca8905b83613f20565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b158015611d3157600080fd5b505af1158015611d45573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611dd45760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c657200000000000000000000000000000000000000000000000060648201526084016107e3565b60008888604051611de69291906158c8565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9f9190615892565b9150611ee689898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b925088915087905089613852565b5050979650505050505050565b6001600160a01b0382163303611f715760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016107e3565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000806120078461082a565b50841663ffffffff908116908516149250505092915050565b6000546001600160a01b0316331461207a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6006546001600160a01b0316156121cc576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561211357600080fd5b505af1158015612127573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b1580156121b357600080fd5b505af11580156121c7573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515612343576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561228f57600080fd5b505af11580156122a3573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561232f57600080fd5b505af115801561157f573d6000803e3d6000fd5b50565b60008261235381336132c5565b6123795760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b83600260006123878361082a565b5091505063ffffffff82821616156123b55760405163a2a7201360e01b8152600481018490526024016107e3565b6123bf878761408b565b600080806123cc8a61082a565b92509250925081891798506123e38a848b84613dd5565b509698975050505050505050565b6000866123fe81336132c5565b6124245760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b8787876040516124359291906158c8565b604051809103902060006124708383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251891906157b1565b90506001600160a01b0381166125625760006125338561082a565b50915050602081161561255c5760405163a2a7201360e01b8152600481018490526024016107e3565b50612598565b600061256d8361082a565b5091505060408116156125965760405163a2a7201360e01b8152600481018490526024016107e3565b505b60008b8b6040516125aa9291906158c8565b604051809103902090506125e58d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b96506125f38d888b8b6139ac565b97506125fe8761369d565b61270b576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306ab5923906064016020604051808303816000875af115801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190615892565b506127068d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d6139f2565b61275d565b61275d8d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613aac565b5050505050509695505050505050565b8361277881336132c5565b61279e5760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b84601c60006127ac8361082a565b5091505063ffffffff82821616156127da5760405163a2a7201360e01b8152600481018490526024016107e3565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b15801561287357600080fd5b505af1158015612887573d6000803e3d6000fd5b5050505060006128998960001c61082a565b505090506128bd81898b60001c6001604051806020016040528060008152506140ba565b505050505050505050565b604080516020808201869052818301859052825180830384018152606090920190925280519101206128fa81336132c5565b6129205760405163168ab55d60e31b8152600481018290523360248201526044016107e3565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612979576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051602080820187905281830186905282518083038401815260609092019092528051910120611b6290611ca2565b6000546001600160a01b03163314612a045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b60008484604051612a949291906158c8565b60405190819003902090506000612af27f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612b0083614268565b6006546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612b57908b908b908b90889088908d90600401615903565b600060405180830381600087803b158015612b7157600080fd5b505af1158015612b85573d6000803e3d6000fd5b505050505050505050505050565b600080612bda600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506142fd9050565b915091506000612c238288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143b49050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528201612ca7576040517f615a470300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015612d28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d4c91906157b1565b90506001600160a01b0381163314801590612e0d57506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015612de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e0b91906158ab565b155b15612e345760405163168ab55d60e31b8152600481018390523360248201526044016107e3565b6001600160a01b03861615612edf576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015612ec657600080fd5b505af1158015612eda573d6000803e3d6000fd5b505050505b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b158015612f6057600080fd5b505af1158015612f74573d6000803e3d6000fd5b505050506128bd828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d93509150819050614473565b60008484604051612fcd9291906158c8565b60405180910390209050600061300a8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060008061301883614268565b6006546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af4490613074908c908c908c908c908c906000908b908b90600401615959565b600060405180830381600087803b15801561308e57600080fd5b505af11580156130a2573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b03841661312d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107e3565b6001600160a01b03851633148061316757506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6131d95760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016107e3565b61157f85858585856140ba565b6000546001600160a01b031633146132405760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e3565b6001600160a01b0381166132bc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107e3565b61234381613eb8565b6000806132d184611b68565b9050826001600160a01b0316816001600160a01b0316148061331857506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b60008087876040516133339291906158c8565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa1580156133bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133e091906157b1565b90506001600160a01b03811633148015906134a157506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa15801561347b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061349f91906158ab565b155b1561351157604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a4016107e3565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561359a57600080fd5b505af11580156135ae573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b15801561363357600080fd5b505af1158015613647573d6000803e3d6000fd5b5050505061369089898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a915089905088613852565b9998505050505050505050565b6000806136a983611b68565b6001600160a01b03161415801561082457506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa15801561373b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061375f91906157b1565b6001600160a01b03161492915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a2600000000000000000000000000000000000000000000000000000000148061380257507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061082457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610824565b84516020860120600090816138ae7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b905060006138bd8284886144dd565b975091506138f490507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae838b8b60408c178b6139f2565b6001600160a01b0385161561399f576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b15801561398657600080fd5b505af115801561399a573d6000803e3d6000fd5b505050505b5093979650505050505050565b6000806139b88561082a565b925050506000806139cb8860001c61082a565b92509250506139db878784613d55565b6139e6858483613d8b565b98975050505050505050565b60008681526005602052604081208054613a94918791613a119061575e565b80601f0160208091040260200160405190810160405280929190818152602001828054613a3d9061575e565b8015613a8a5780601f10613a5f57610100808354040283529160200191613a8a565b820191906000526020600020905b815481529060010190602001808311613a6d57829003601f168201915b50505050506145b5565b9050613aa38682868686614473565b50505050505050565b6000613ab786611b68565b90506000613add86600560008b81526020019081526020016000208054613a119061575e565b6000888152600560205260409020805491925090613afa9061575e565b9050600003613b1d576000878152600560205260409020613b1b8282615a07565b505b613b2987838686613dd5565b611d4582868960001c6001604051806020016040528060008152506140ba565b6001600160a01b0384163b15613d4d576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c8190613ba69089908990889088908890600401615b03565b6020604051808303816000875af1925050508015613be1575060408051601f3d908101601f19168201909252613bde91810190615b55565b60015b613c9657613bed615b72565b806308c379a003613c265750613c01615b8e565b80613c0c5750613c28565b8060405162461bcd60e51b81526004016107e39190614c8a565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016107e3565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014613aa35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107e3565b505050505050565b6040828116146001821615818015613d6a5750805b1561157f5760405163a2a7201360e01b8152600481018690526024016107e3565b60008167ffffffffffffffff168467ffffffffffffffff161115613dad578193505b8267ffffffffffffffff168467ffffffffffffffff161015613dcd578293505b509192915050565b613de184848484613e31565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b613e3b848361465e565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b16179055611b62565b600080613eae8361082a565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381161580613f3e57506001600160a01b03811630145b15613f80576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016107e3565b613f8b826001611ffb565b15613fac5760405163a2a7201360e01b8152600481018390526024016107e3565b613fb582614697565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b15801561403857600080fd5b505af115801561404c573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612a76565b60408116156140b65760405163168ab55d60e31b8152600481018390523360248201526044016107e3565b5050565b60008060006140c88661082a565b9250925092506140d9826004161590565b6140f95760405163a2a7201360e01b8152600481018790526024016107e3565b84600114801561411a5750876001600160a01b0316836001600160a01b0316145b61418c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107e3565b866001600160a01b0316836001600160a01b0316036141ad5750505061157f565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611d45338989898989614752565b60065460009081906001600160a01b03166142af576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142b983336132c5565b6142df5760405163168ab55d60e31b8152600481018490523360248201526044016107e3565b6142e88361082a565b90935091506142f8905083614697565b915091565b600080835183106143505760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016107e3565b6000848481518110614364576143646157ce565b016020015160f81c905080156143905761438985614383866001615c36565b836148ad565b9250614395565b600092505b61439f8185615c36565b6143aa906001615c36565b9150509250929050565b60008060006143c385856142fd565b90925090508161443557600185516143db9190615c49565b84146144295760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016107e3565b50600091506108249050565b61443f85826143b4565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b600085815260056020526040902061448b8582615a07565b50614498858484846148d1565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516144ce9493929190615c5c565b60405180910390a25050505050565b60008080806144eb8761082a565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015614574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145989190615892565b90506145a5868383613d8b565b9550859250505093509350939050565b60606001835110156145f3576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561463157826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016107e39190614c8a565b8251838360405160200161464793929190615ca4565b604051602081830303815290604052905092915050565b63ffffffbf8116158015906146765750604181811614155b156140b65760405163a2a7201360e01b8152600481018390526024016107e3565b60008060006146a58461082a565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b6001600160a01b0384163b15613d4d576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906147af9089908990889088908890600401615d05565b6020604051808303816000875af19250505080156147ea575060408051601f3d908101601f191682019092526147e791810190615b55565b60015b6147f657613bed615b72565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014613aa35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107e3565b82516000906148bc8385615c36565b11156148c757600080fd5b5091016020012090565b6148db848361465e565b60006148e685611b68565b90506001600160a01b038116156149375761490085614697565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b61157f85858585836000808061494c8461082a565b9250925092508467ffffffffffffffff168167ffffffffffffffff161115614972578094505b6001600160a01b038316156149c95760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e0060448201526064016107e3565b6001600160a01b038716614a455760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016107e3565b306001600160a01b03881603614ac35760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e747261637400000000000000000000000060648201526084016107e3565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611d453360008987600160405180602001604052806000815250614752565b6001600160a01b038116811461234357600080fd5b60008060408385031215614bb657600080fd5b8235614bc181614b8e565b946020939093013593505050565b600060208284031215614be157600080fd5b5035919050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461234357600080fd5b600060208284031215614c2857600080fd5b8135614c3381614be8565b9392505050565b60005b83811015614c55578181015183820152602001614c3d565b50506000910152565b60008151808452614c76816020860160208601614c3a565b601f01601f19169290920160200192915050565b602081526000614c336020830184614c5e565b803567ffffffffffffffff81168114614cb557600080fd5b919050565b60008060408385031215614ccd57600080fd5b82359150614cdd60208401614c9d565b90509250929050565b60008083601f840112614cf857600080fd5b50813567ffffffffffffffff811115614d1057600080fd5b602083019150836020828501011115614d2857600080fd5b9250929050565b600080600080600060808688031215614d4757600080fd5b8535614d5281614b8e565b94506020860135614d6281614b8e565b935060408601359250606086013567ffffffffffffffff811115614d8557600080fd5b614d9188828901614ce6565b969995985093965092949392505050565b600060208284031215614db457600080fd5b8135614c3381614b8e565b60008060408385031215614dd257600080fd5b823591506020830135614de481614b8e565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715614e4457614e44614def565b6040525050565b600067ffffffffffffffff821115614e6557614e65614def565b50601f01601f191660200190565b600082601f830112614e8457600080fd5b8135614e8f81614e4b565b604051614e9c8282614e1e565b828152856020848701011115614eb157600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614cb557600080fd5b600080600080600080600060e0888a031215614efe57600080fd5b87359650602088013567ffffffffffffffff811115614f1c57600080fd5b614f288a828b01614e73565b9650506040880135614f3981614b8e565b94506060880135614f4981614b8e565b9350614f5760808901614c9d565b9250614f6560a08901614ecf565b9150614f7360c08901614c9d565b905092959891949750929550565b600067ffffffffffffffff821115614f9b57614f9b614def565b5060051b60200190565b600082601f830112614fb657600080fd5b81356020614fc382614f81565b604051614fd08282614e1e565b83815260059390931b8501820192828101915086841115614ff057600080fd5b8286015b8481101561500b5780358352918301918301614ff4565b509695505050505050565b600080600080600060a0868803121561502e57600080fd5b853561503981614b8e565b9450602086013561504981614b8e565b9350604086013567ffffffffffffffff8082111561506657600080fd5b61507289838a01614fa5565b9450606088013591508082111561508857600080fd5b61509489838a01614fa5565b935060808801359150808211156150aa57600080fd5b506150b788828901614e73565b9150509295509295909350565b600080600080608085870312156150da57600080fd5b84359350602085013592506150f160408601614ecf565b91506150ff60608601614c9d565b905092959194509250565b6000806040838503121561511d57600080fd5b823567ffffffffffffffff8082111561513557600080fd5b818501915085601f83011261514957600080fd5b8135602061515682614f81565b6040516151638282614e1e565b83815260059390931b850182019282810191508984111561518357600080fd5b948201945b838610156151aa57853561519b81614b8e565b82529482019490820190615188565b965050860135925050808211156151c057600080fd5b506143aa85828601614fa5565b600081518084526020808501945080840160005b838110156151fd578151875295820195908201906001016151e1565b509495945050505050565b602081526000614c3360208301846151cd565b60008060006060848603121561523057600080fd5b833561523b81614b8e565b9250602084013561524b81614b8e565b929592945050506040919091013590565b60008060006060848603121561527157600080fd5b83359250602084013561528381614b8e565b9150604084013561529381614b8e565b809150509250925092565b600080600080600080600060c0888a0312156152b957600080fd5b873567ffffffffffffffff8111156152d057600080fd5b6152dc8a828b01614ce6565b90985096505060208801356152f081614b8e565b945060408801359350606088013561530781614b8e565b925061531560808901614ecf565b9150614f7360a08901614c9d565b801515811461234357600080fd5b6000806040838503121561534457600080fd5b823561534f81614b8e565b91506020830135614de481615323565b6000806040838503121561537257600080fd5b82359150614cdd60208401614ecf565b60008060008060008060a0878903121561539b57600080fd5b86359550602087013567ffffffffffffffff8111156153b957600080fd5b6153c589828a01614ce6565b90965094505060408701356153d981614b8e565b92506153e760608801614ecf565b91506153f560808801614c9d565b90509295509295509295565b6000806000806080858703121561541757600080fd5b84359350602085013561542981614b8e565b925060408501356150f181614b8e565b60008060006060848603121561544e57600080fd5b8335925060208401359150604084013561529381614b8e565b6000806000806060858703121561547d57600080fd5b843567ffffffffffffffff81111561549457600080fd5b6154a087828801614ce6565b90955093505060208501356154b481614b8e565b915060408501356154c481614b8e565b939692955090935050565b600080604083850312156154e257600080fd5b82356154ed81614b8e565b91506020830135614de481614b8e565b60008060008060006080868803121561551557600080fd5b85359450602086013567ffffffffffffffff81111561553357600080fd5b61553f88828901614ce6565b909550935050604086013561555381614b8e565b9150606086013561556381614b8e565b809150509295509295909350565b600080600080600060a0868803121561558957600080fd5b853561559481614b8e565b945060208601356155a481614b8e565b93506040860135925060608601359150608086013567ffffffffffffffff8111156155ce57600080fd5b6150b788828901614e73565b60008060008060008060a087890312156155f357600080fd5b863567ffffffffffffffff81111561560a57600080fd5b61561689828a01614ce6565b909750955050602087013561562a81614b8e565b935061563860408801614ecf565b925061564660608801614c9d565b9150608087013561565681614b8e565b809150509295509295509295565b60006020828403121561567657600080fd5b815167ffffffffffffffff81111561568d57600080fd5b8201601f8101841361569e57600080fd5b80516156a981614e4b565b6040516156b68282614e1e565b8281528660208486010111156156cb57600080fd5b6156dc836020830160208701614c3a565b9695505050505050565b600080600080600060a086880312156156fe57600080fd5b853567ffffffffffffffff81111561571557600080fd5b61572188828901614e73565b955050602086013561573281614b8e565b935061574060408701614ecf565b925061574e60608701614c9d565b9150608086013561556381614b8e565b600181811c9082168061577257607f821691505b6020821081036157ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000602082840312156157c357600080fd5b8151614c3381614b8e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361585d5761585d6157fd565b5060010190565b60408152600061587760408301856151cd565b828103602084015261588981856151cd565b95945050505050565b6000602082840312156158a457600080fd5b5051919050565b6000602082840312156158bd57600080fd5b8151614c3381615323565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b60a08152600061591760a08301888a6158d8565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b88815260e06020820152600061597360e08301898b6158d8565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b601f821115615a0257600081815260208120601f850160051c810160208610156159e35750805b601f850160051c820191505b81811015613d4d578281556001016159ef565b505050565b815167ffffffffffffffff811115615a2157615a21614def565b615a3581615a2f845461575e565b846159bc565b602080601f831160018114615a885760008415615a525750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613d4d565b600085815260208120601f198616915b82811015615ab757888601518255948401946001909101908401615a98565b5085821015615af357878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b60006001600160a01b03808816835280871660208401525060a06040830152615b2f60a08301866151cd565b8281036060840152615b4181866151cd565b905082810360808401526139e68185614c5e565b600060208284031215615b6757600080fd5b8151614c3381614be8565b600060033d1115615b8b5760046000803e5060005160e01c5b90565b600060443d1015615b9c5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715615bea57505050505090565b8285019150815181811115615c025750505050505090565b843d8701016020828501011115615c1c5750505050505090565b615c2b60208286010187614e1e565b509095945050505050565b80820180821115610824576108246157fd565b81810381811115610824576108246157fd565b608081526000615c6f6080830187614c5e565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615ce1816001850160208801614c3a565b835190830190615cf8816001840160208801614c3a565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615d3d60a0830184614c5e565b97965050505050505056fea2646970667358221220d501c0ce4da154894875391fd82fe62b10183e672a6d3f599c937a7c411c120b64736f6c63430008110033", + "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" + } + }, + "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." + }, + "getData(uint256)": { + "details": "Returns the Name's owner address and fuses" + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC1155-isApprovedForAll}." + }, + "isTokenOwnerOrApproved(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 approved" + } + }, + "isWrapped(bytes32)": { + "details": "Both of these checks need to be true to be considered wrapped if checked without this contract", + "params": { + "node": "Namehash of the name" + }, + "returns": { + "_0": "Boolean of whether or not the name is wrapped" + } + }, + "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" + } + }, + "registerAndWrapETH2LD(string,address,uint256,address,uint32,uint64)": { + "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.", + "expiry": "When the fuses will expire", + "fuses": "Initial fuses to set", + "label": "The label to register (Eg, 'foo' for 'foo.eth').", + "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,uint32,uint64)": { + "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 fuses will expire", + "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,uint32)": { + "params": { + "fuses": "Fuses to burn (cannot burn PARENT_CANNOT_CONTROL)", + "node": "Namehash of the name" + }, + "returns": { + "_0": "New 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 fuses will expire", + "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": "expiry date for the domain", + "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 regsitry" + }, + "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(bytes32,string,address,address)": { + "details": "Can be called by the owner or an authorised caller Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names", + "params": { + "label": "Label as a string of the name to upgrade", + "parentNode": "Namehash of the parent name", + "resolver": "Resolver contract for this name", + "wrappedOwner": "Owner of the name in this contract" + } + }, + "upgradeETH2LD(string,address,address)": { + "details": "Can be called by the owner of the name in this contract", + "params": { + "label": "Label as a string of the .eth name to upgrade", + "wrappedOwner": "The owner of the wrapped name" + } + }, + "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,uint32,uint64,address)": { + "details": "Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar", + "params": { + "expiry": "When the fuses will expire", + "fuses": "Initial fuses to set", + "label": "Label as a string of the .eth domain to wrap", + "resolver": "Resolver contract address", + "wrappedOwner": "Owner of the name in this contract" + }, + "returns": { + "_0": "Normalised expiry of when the fuses expire" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "allFusesBurned(bytes32,uint32)": { + "notice": "Checks all Fuses in the mask are burned for the node" + }, + "isTokenOwnerOrApproved(bytes32,address)": { + "notice": "Checks if owner or approved by owner" + }, + "isWrapped(bytes32)": { + "notice": "Checks if a name is wrapped or not" + }, + "recoverFunds(address,address,uint256)": { + "notice": "Recover ERC20 tokens sent to the contract by mistake." + }, + "renew(uint256,uint256,uint32,uint64)": { + "notice": "Renews a .eth second-level domain." + }, + "setChildFuses(bytes32,bytes32,uint32,uint64)": { + "notice": "Sets fuses of a name that you own the parent of. Can also be called by the owner of a .eth name" + }, + "setFuses(bytes32,uint32)": { + "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(bytes32,string,address,address)": { + "notice": "Upgrades a non .eth domain of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain" + }, + "upgradeETH2LD(string,address,address)": { + "notice": "Upgrades a .eth wrapped domain by calling the wrapETH2LD function of the upgradeContract and burning the token of this contract" + }, + "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,uint32,uint64,address)": { + "notice": "Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 545, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 16780, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_tokens", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 16786, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "_operatorApprovals", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 16716, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "controllers", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 18037, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "metadataService", + "offset": 0, + "slot": "4", + "type": "t_contract(IMetadataService)17642" + }, + { + "astId": 18042, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "names", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_bytes32,t_bytes_storage)" + }, + { + "astId": 18051, + "contract": "contracts/wrapper/NameWrapper.sol:NameWrapper", + "label": "upgradeContract", + "offset": 0, + "slot": "6", + "type": "t_contract(INameWrapperUpgrade)17942" + } + ], + "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)17642": { + "encoding": "inplace", + "label": "contract IMetadataService", + "numberOfBytes": "20" + }, + "t_contract(INameWrapperUpgrade)17942": { + "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_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/goerli/PublicResolver.json b/deployments/goerli/PublicResolver.json new file mode 100644 index 00000000..4226da5e --- /dev/null +++ b/deployments/goerli/PublicResolver.json @@ -0,0 +1,1464 @@ +{ + "address": "0x121304143ea8101E69335F309e2062d299A234B5", + "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": 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": 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" + }, + { + "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": "clearDNSZone", + "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": "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": "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": "0xdb075605c38cb0f039fad1b9d78e442afec80c743795c473edf21765d1180138", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0x121304143ea8101E69335F309e2062d299A234B5", + "transactionIndex": 6, + "gasUsed": "2643328", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2a7ddad29314fdb8d9eec05c3328b3cdf7d9006b0353daeab0ba2bab1da1c27b", + "transactionHash": "0xdb075605c38cb0f039fad1b9d78e442afec80c743795c473edf21765d1180138", + "logs": [], + "blockNumber": 7625520, + "cumulativeGasUsed": "3590863", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "0xC5A419AbB14d69945B3A143326B2d825d505714f", + "0x5913678e207e39F848D0E69Ccd6df46A9c5031FA", + "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48" + ], + "numDeployments": 1, + "solcInputHash": "a5ab15037ea2d912526c4e5696fda13f", + "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\":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\":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\"},{\"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\":\"clearDNSZone\",\"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\":\"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\":\"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.\"}},\"clearDNSZone(bytes32)\":{\"params\":{\"node\":\"the namehash of the node for which to clear the zone\"}},\"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.\"}},\"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.\"},\"clearDNSZone(bytes32)\":{\"notice\":\"Clear all information for a DNS zone.\"},\"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\":10000},\"remappings\":[]},\"sources\":{\"@ensdomains/buffer/contracts/Buffer.sol\":{\"content\":\"pragma 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 writing 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 mstore(0x40, add(32, add(ptr, capacity)))\\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 function max(uint a, uint b) private pure returns(uint) {\\n if (a > b) {\\n return a;\\n }\\n return b;\\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 Writes 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 off The start offset to write 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 write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n if (off + len > buf.capacity) {\\n resize(buf, max(buf.capacity, len + off) * 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(add(len, off), buflen) {\\n mstore(bufptr, add(len, off))\\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 * @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 return write(buf, buf.buf.length, data, len);\\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 write(buf, buf.buf.length, data, data.length);\\n }\\n\\n /**\\n * @dev Writes 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 off The offset to write the byte at.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function writeUint8(buffer memory buf, uint off, uint8 data) internal pure returns(buffer memory) {\\n if (off >= buf.capacity) {\\n resize(buf, buf.capacity * 2);\\n }\\n\\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 // 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 eq(off, buflen) {\\n mstore(bufptr, add(buflen, 1))\\n }\\n }\\n return buf;\\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 return writeUint8(buf, buf.buf.length, data);\\n }\\n\\n /**\\n * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param off The offset to write at.\\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 write(buffer memory buf, uint off, bytes32 data, uint len) private pure returns(buffer memory) {\\n if (len + off > buf.capacity) {\\n resize(buf, (len + off) * 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) + off + len\\n let dest := add(add(bufptr, off), len)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(add(off, len), mload(bufptr)) {\\n mstore(bufptr, add(off, len))\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Writes a bytes20 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 off The offset to write at.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) {\\n return write(buf, off, bytes32(data), 20);\\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 write(buf, buf.buf.length, 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 write(buf, buf.buf.length, data, 32);\\n }\\n\\n /**\\n * @dev Writes an integer 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 off The offset to write at.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function writeInt(buffer memory buf, uint off, uint data, uint len) private pure returns(buffer memory) {\\n if (len + off > buf.capacity) {\\n resize(buf, (len + off) * 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 + off + sizeof(buffer length) + len\\n let dest := add(add(bufptr, off), len)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(add(off, len), mload(bufptr)) {\\n mstore(bufptr, add(off, len))\\n }\\n }\\n return buf;\\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 * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n return writeInt(buf, buf.buf.length, data, len);\\n }\\n}\\n\",\"keccak256\":\"0x18e42be1a3e4f7b4442d7ab0b524af5e09163503439954faf0ab3792cce91caa\"},\"@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 /*\\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(bytes memory self, bytes memory other)\\n internal\\n pure\\n returns (int256)\\n {\\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 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 > 32) {\\n mask = type(uint256).max;\\n } else {\\n mask = ~(2**(8 * (32 - shortest + idx)) - 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(bytes memory self, bytes memory other)\\n internal\\n pure\\n returns (bool)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (uint8 ret)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (uint16 ret)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (uint32 ret)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (bytes32 ret)\\n {\\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(bytes memory self, uint256 idx)\\n internal\\n pure\\n returns (bytes20 ret)\\n {\\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(\\n uint256 dest,\\n uint256 src,\\n uint256 len\\n ) 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\":\"0xbb12e0c376de4b977f5b43a85b8b28d951c16362a58e35d061d7543f16a923a9\"},\"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(bytes memory self, uint256 offset)\\n internal\\n pure\\n returns (uint256)\\n {\\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(bytes memory self, uint256 offset)\\n internal\\n pure\\n returns (bytes memory ret)\\n {\\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(bytes memory self, uint256 offset)\\n internal\\n pure\\n returns (uint256)\\n {\\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(bytes memory data)\\n internal\\n pure\\n returns (SignedSet memory self)\\n {\\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(SignedSet memory rrset)\\n internal\\n pure\\n returns (RRIterator memory)\\n {\\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(bytes memory self, uint256 offset)\\n internal\\n pure\\n returns (RRIterator memory ret)\\n {\\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(RRIterator memory iter)\\n internal\\n pure\\n returns (bytes memory)\\n {\\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 compareNames(bytes memory self, bytes memory other)\\n internal\\n pure\\n returns (int256)\\n {\\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(uint32 i1, uint32 i2)\\n internal\\n pure\\n returns (bool)\\n {\\n return int32(i1) - int32(i2) >= 0;\\n }\\n\\n function progress(bytes memory body, uint256 off)\\n internal\\n pure\\n returns (uint256)\\n {\\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\":\"0xc40cbcdbc625038ecec82017337ada164c9778069136c0ade9f0ab07aaa6f188\"},\"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(address owner, address operator)\\n external\\n view\\n returns (bool);\\n}\\n\",\"keccak256\":\"0xf79be82c1a2eb0a77fba4e0972221912e803309081ca460fd2cf61653e55758a\"},\"contracts/resolvers/IMulticallable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\ninterface IMulticallable {\\n function multicall(bytes[] calldata data)\\n external\\n returns (bytes[] memory results);\\n\\n function multicallWithNodeCheck(bytes32, bytes[] calldata data)\\n external\\n returns (bytes[] memory results);\\n}\\n\",\"keccak256\":\"0x78b9070106d539e070dde613caaa03522143ab55c206a2efd5664c9da783741a\",\"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(bytes32 nodehash, bytes[] calldata data)\\n internal\\n returns (bytes[] memory results)\\n {\\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(bytes32 nodehash, bytes[] calldata data)\\n external\\n returns (bytes[] memory results)\\n {\\n return _multicall(nodehash, data);\\n }\\n\\n function multicall(bytes[] calldata data)\\n public\\n override\\n returns (bytes[] memory results)\\n {\\n return _multicall(bytes32(0), data);\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IMulticallable).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x0232b14c50b5c8bef0777fa8c130228a6a2c10b27f9be08760d40a44fd8823e9\",\"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\\\";\\n\\ninterface INameWrapper {\\n function ownerOf(uint256 id) external view returns (address);\\n}\\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{\\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 // 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 constructor(\\n ENS _ens,\\n INameWrapper wrapperAddress,\\n address _trustedETHController,\\n address _trustedReverseRegistrar\\n ) {\\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(address account, address operator)\\n public\\n view\\n returns (bool)\\n {\\n return _operatorApprovals[account][operator];\\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 owner == msg.sender || isApprovedForAll(owner, msg.sender);\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\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\":\"0x95e776158dbaaaa58c3918787aa4e6bb22df44c6873b57129ab7e2ddcc2b6927\",\"license\":\"MIT\"},\"contracts/resolvers/ResolverBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/ERC165.sol\\\";\\n\\nabstract contract ResolverBase is ERC165 {\\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\\n\\n modifier authorised(bytes32 node) {\\n require(isAuthorised(node));\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xc749aecc4b1ea253d7ba60d130014954dd0dd327c085b1863f8bb7ad3e32f2e3\",\"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(bytes32 => mapping(uint256 => bytes)) 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 abis[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(bytes32 node, uint256 contentTypes)\\n external\\n view\\n virtual\\n override\\n returns (uint256, bytes memory)\\n {\\n mapping(uint256 => bytes) storage abiset = abis[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(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IABIResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x4ff497128885130779cbb42a9031459dabda76c0cda411025cbd09ccb8468f88\",\"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(bytes32 => mapping(uint256 => bytes)) _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(bytes32 node, address a)\\n external\\n virtual\\n authorised(node)\\n {\\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(bytes32 node)\\n public\\n view\\n virtual\\n override\\n returns (address payable)\\n {\\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 _addresses[node][coinType] = a;\\n }\\n\\n function addr(bytes32 node, uint256 coinType)\\n public\\n view\\n virtual\\n override\\n returns (bytes memory)\\n {\\n return _addresses[node][coinType];\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IAddrResolver).interfaceId ||\\n interfaceID == type(IAddressResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n\\n function bytesToAddress(bytes memory b)\\n internal\\n pure\\n returns (address payable a)\\n {\\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\":\"0x1fa0a928fb105abad9477fdd9917a28f362a817ba3105438f25ee0bd5c1548b6\",\"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(bytes32 => bytes) 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(bytes32 node, bytes calldata hash)\\n external\\n virtual\\n authorised(node)\\n {\\n hashes[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(bytes32 node)\\n external\\n view\\n virtual\\n override\\n returns (bytes memory)\\n {\\n return hashes[node];\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IContentHashResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xf3db2af9dbdec368df3874518c23ce9194ce272f548ad168c1d8b60e2c0a4371\",\"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(bytes32 => bytes) private zonehashes;\\n\\n // Version the mapping for each zone. This allows users who have lost\\n // track of their entries to effectively delete an entire zone by bumping\\n // the version number.\\n // node => version\\n mapping(bytes32 => uint256) private versions;\\n\\n // The records themselves. Stored as binary RRSETs\\n // node => version => name => resource => data\\n mapping(bytes32 => mapping(uint256 => mapping(bytes32 => mapping(uint16 => bytes))))\\n private 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(bytes32 => mapping(uint256 => mapping(bytes32 => uint16)))\\n private 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(bytes32 node, bytes calldata data)\\n external\\n virtual\\n authorised(node)\\n {\\n uint16 resource = 0;\\n uint256 offset = 0;\\n bytes memory name;\\n bytes memory value;\\n bytes32 nameHash;\\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 );\\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 );\\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 records[node][versions[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(bytes32 node, bytes32 name)\\n public\\n view\\n virtual\\n returns (bool)\\n {\\n return (nameEntriesCount[node][versions[node]][name] != 0);\\n }\\n\\n /**\\n * Clear all information for a DNS zone.\\n * @param node the namehash of the node for which to clear the zone\\n */\\n function clearDNSZone(bytes32 node) public virtual authorised(node) {\\n versions[node]++;\\n emit DNSZoneCleared(node);\\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(bytes32 node, bytes calldata hash)\\n external\\n virtual\\n authorised(node)\\n {\\n bytes memory oldhash = zonehashes[node];\\n zonehashes[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(bytes32 node)\\n external\\n view\\n virtual\\n override\\n returns (bytes memory)\\n {\\n return zonehashes[node];\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\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 ) private {\\n uint256 version = versions[node];\\n bytes32 nameHash = keccak256(name);\\n bytes memory rrData = data.substring(offset, size);\\n if (deleteRecord) {\\n if (records[node][version][nameHash][resource].length != 0) {\\n nameEntriesCount[node][version][nameHash]--;\\n }\\n delete (records[node][version][nameHash][resource]);\\n emit DNSRecordDeleted(node, name, resource);\\n } else {\\n if (records[node][version][nameHash][resource].length == 0) {\\n nameEntriesCount[node][version][nameHash]++;\\n }\\n records[node][version][nameHash][resource] = rrData;\\n emit DNSRecordChanged(node, name, resource, rrData);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa067664296b51b243fde015601b96a0bfb1d8c1e2007095f3ec3f49ab0c3f07f\",\"license\":\"MIT\"},\"contracts/resolvers/profiles/IABIResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4;\\n\\nimport \\\"./IABIResolver.sol\\\";\\nimport \\\"../ResolverBase.sol\\\";\\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(bytes32 node, uint256 contentTypes)\\n external\\n view\\n returns (uint256, bytes memory);\\n}\\n\",\"keccak256\":\"0xc6db25d9b07ea925c64bb777f00ba557e99fbccd4c30c20e5a1b5cd8c159dcbf\",\"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(bytes32 node, uint256 coinType)\\n external\\n view\\n returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x37221203e063dee5aa2a067a6ab3401e9cca41cce5b15230994b6ea377f05ed5\",\"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 // DNSZoneCleared is emitted whenever a given node's zone information is cleared.\\n event DNSZoneCleared(bytes32 indexed node);\\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\":\"0x78cfc99568f9b092692d825b7c8f29ccc02c057e0ef2707ce037a1b4381c7fc2\",\"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(bytes32 node, bytes4 interfaceID)\\n external\\n view\\n returns (address);\\n}\\n\",\"keccak256\":\"0x6d75d6010016684030e13711b3bc1a4e1a784c7398937f1b7c2b2f328f962c2b\",\"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(bytes32 node, string calldata key)\\n external\\n view\\n returns (string memory);\\n}\\n\",\"keccak256\":\"0xcc5eada60de63f42f47a4bbc8a5d2bed4cd1394646197a08da7957c6fd90ba5d\",\"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(bytes32 => mapping(bytes4 => address)) 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 interfaces[node][interfaceID] = 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(bytes32 node, bytes4 interfaceID)\\n external\\n view\\n virtual\\n override\\n returns (address)\\n {\\n address implementer = interfaces[node][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(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IInterfaceResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x74df0149113dc18c40ca94d7645e5277225460ec5fde399db13b2a173564e95b\",\"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(bytes32 => string) 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(bytes32 node, string calldata newName)\\n external\\n virtual\\n authorised(node)\\n {\\n names[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(bytes32 node)\\n external\\n view\\n virtual\\n override\\n returns (string memory)\\n {\\n return names[node];\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(INameResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xa396d5b4f8be2d5da56cf30d7a3ee16d55f1f179c17c348dc61b27da0c7418da\",\"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(bytes32 => PublicKey) 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 pubkeys[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(bytes32 node)\\n external\\n view\\n virtual\\n override\\n returns (bytes32 x, bytes32 y)\\n {\\n return (pubkeys[node].x, pubkeys[node].y);\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(IPubkeyResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0xd4cfb76a794b96a7ea20d536ef0baa0516a0e678bfd46c60a9c48469271c3eea\",\"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(bytes32 => mapping(string => string)) 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 texts[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(bytes32 node, string calldata key)\\n external\\n view\\n virtual\\n override\\n returns (string memory)\\n {\\n return texts[node][key];\\n }\\n\\n function supportsInterface(bytes4 interfaceID)\\n public\\n view\\n virtual\\n override\\n returns (bool)\\n {\\n return\\n interfaceID == type(ITextResolver).interfaceId ||\\n super.supportsInterface(interfaceID);\\n }\\n}\\n\",\"keccak256\":\"0x2247f2ff145fffcc066ccc5dab0d1d031da73b712c3edf8a42478c9575bb9a97\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101006040523480156200001257600080fd5b506040516200302938038062003029833981016040819052620000359162000071565b6001600160a01b0393841660805291831660a052821660c0521660e052620000d9565b6001600160a01b03811681146200006e57600080fd5b50565b600080600080608085870312156200008857600080fd5b8451620000958162000058565b6020860151909450620000a88162000058565b6040860151909350620000bb8162000058565b6060860151909250620000ce8162000058565b939692955090935050565b60805160a05160c05160e051612f0f6200011a60003960006115840152600061154501526000818161166901526116e9015260006115e50152612f0f6000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c806377372213116100f9578063c869023311610097578063e32954eb11610071578063e32954eb1461042e578063e59d895d14610441578063e985e9c514610454578063f1cb7e061461049d57600080fd5b8063c8690233146103cb578063ce3decdc14610408578063d5fa2b001461041b57600080fd5b8063a8fa5682116100d3578063a8fa568214610372578063ac9650d814610385578063ad5780af146103a5578063bc1c58d1146103b857600080fd5b806377372213146103395780638b95dd711461034c578063a22cb4651461035f57600080fd5b8063304e6ade1161016657806359d1d43c1161014057806359d1d43c146102e05780635c98042b14610300578063623195b014610313578063691f34311461032657600080fd5b8063304e6ade1461027a5780633b3b57de1461028d5780634cbf6ba4146102a057600080fd5b8063124a319c11610197578063124a319c1461020e5780632203ab561461024657806329cd62ea1461026757600080fd5b806301ffc9a7146101be5780630af179d7146101e657806310f13a8c146101fb575b600080fd5b6101d16101cc3660046123da565b6104b0565b60405190151581526020015b60405180910390f35b6101f96101f4366004612437565b6104c1565b005b6101f9610209366004612483565b6106af565b61022161021c3660046124fd565b610761565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101dd565b610259610254366004612529565b610aa2565b6040516101dd92919061259b565b6101f96102753660046125b4565b610bbd565b6101f9610288366004612437565b610c3d565b61022161029b3660046125e0565b610c9c565b6101d16102ae366004612529565b600091825260066020908152604080842060048352818520548552825280842092845291905290205461ffff16151590565b6102f36102ee366004612437565b610cce565b6040516101dd91906125f9565b6102f361030e3660046125e0565b610d93565b6101f961032136600461260c565b610e35565b6102f36103343660046125e0565b610eb6565b6101f9610347366004612437565b610ed3565b6101f961035a36600461268e565b610f32565b6101f961036d366004612774565b611005565b6102f36103803660046127b2565b611146565b610398610393366004612837565b611189565b6040516101dd9190612879565b6101f96103b33660046125e0565b611197565b6102f36103c63660046125e0565b6111f8565b6103f36103d93660046125e0565b600090815260096020526040902080546001909101549091565b604080519283526020830191909152016101dd565b6101f9610416366004612437565b611215565b6101f96104293660046128f9565b611321565b61039861043c36600461291e565b611348565b6101f961044f36600461295d565b61135d565b6101d1610462366004612992565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600b6020908152604080832093909416825291909152205460ff1690565b6102f36104ab366004612529565b611427565b60006104bb826114d5565b92915050565b826104cb8161152b565b6104d457600080fd5b60008060608060008061052160008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506117c49050565b90505b8051516020820151101561064a578561ffff16600003610589578060400151955061054e81611825565b93508360405160200161056191906129c0565b60405160208183030381529060405280519060200120915061058281611846565b925061063c565b600061059482611825565b9050816040015161ffff168761ffff161415806105b857506105b68582611862565b155b1561063a576106138b86898d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518c915061060b908290612a0b565b8a5115611880565b81604001519650816020015195508094508480519060200120925061063782611846565b93505b505b61064581611abf565b610524565b508251156106a4576106a48984878b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b925061069c91508290508e612a0b565b885115611880565b505050505050505050565b846106b98161152b565b6106c257600080fd5b8282600a600089815260200190815260200160002087876040516106e7929190612a1e565b90815260200160405180910390209182610702929190612acf565b508484604051610713929190612a1e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516107519493929190612bba565b60405180910390a3505050505050565b60008281526007602090815260408083207fffffffff000000000000000000000000000000000000000000000000000000008516845290915281205473ffffffffffffffffffffffffffffffffffffffff1680156107c05790506104bb565b60006107cb85610c9c565b905073ffffffffffffffffffffffffffffffffffffffff81166107f3576000925050506104bb565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000006024820152600090819073ffffffffffffffffffffffffffffffffffffffff84169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790525161089f91906129c0565b600060405180830381855afa9150503d80600081146108da576040519150601f19603f3d011682016040523d82523d6000602084013e6108df565b606091505b50915091508115806108f2575060208151105b80610934575080601f8151811061090b5761090b612bec565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109465760009450505050506104bb565b6040517fffffffff000000000000000000000000000000000000000000000000000000008716602482015273ffffffffffffffffffffffffffffffffffffffff84169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052516109ef91906129c0565b600060405180830381855afa9150503d8060008114610a2a576040519150601f19603f3d011682016040523d82523d6000602084013e610a2f565b606091505b509092509050811580610a43575060208151105b80610a85575080601f81518110610a5c57610a5c612bec565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610a975760009450505050506104bb565b509095945050505050565b600082815260208190526040812060609060015b848111610b9d5780851615801590610ae6575060008181526020839052604081208054610ae290612a2e565b9050115b15610b955780826000838152602001908152602001600020808054610b0a90612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3690612a2e565b8015610b835780601f10610b5857610100808354040283529160200191610b83565b820191906000526020600020905b815481529060010190602001808311610b6657829003601f168201915b50505050509050935093505050610bb6565b60011b610ab6565b5060006040518060200160405280600081525092509250505b9250929050565b82610bc78161152b565b610bd057600080fd5b60408051808201825284815260208082018581526000888152600983528490209251835551600190920191909155815185815290810184905285917f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4691015b60405180910390a250505050565b82610c478161152b565b610c5057600080fd5b6000848152600260205260409020610c69838583612acf565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610c2f929190612c1b565b600080610caa83603c611427565b90508051600003610cbe5750600092915050565b610cc781611ba7565b9392505050565b6060600a60008581526020019081526020016000208383604051610cf3929190612a1e565b90815260200160405180910390208054610d0c90612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3890612a2e565b8015610d855780601f10610d5a57610100808354040283529160200191610d85565b820191906000526020600020905b815481529060010190602001808311610d6857829003601f168201915b505050505090509392505050565b6000818152600360205260409020805460609190610db090612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ddc90612a2e565b8015610e295780601f10610dfe57610100808354040283529160200191610e29565b820191906000526020600020905b815481529060010190602001808311610e0c57829003601f168201915b50505050509050919050565b83610e3f8161152b565b610e4857600080fd5b83610e54600182612a0b565b1615610e5f57600080fd5b6000858152602081815260408083208784529091529020610e81838583612acf565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b6000818152600860205260409020805460609190610db090612a2e565b82610edd8161152b565b610ee657600080fd5b6000848152600860205260409020610eff838583612acf565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610c2f929190612c1b565b82610f3c8161152b565b610f4557600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af7528484604051610f7792919061259b565b60405180910390a2603c8303610fdb57837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2610fb284611ba7565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25b60008481526001602090815260408083208684529091529020610ffe8382612c2f565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff821633036110af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336000818152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000838152600560209081526040808320600483528184205484528252808320858452825280832061ffff851684529091529020805460609190610d0c90612a2e565b6060610cc760008484611bcf565b806111a18161152b565b6111aa57600080fd5b60008281526004602052604081208054916111c483612cef565b909155505060405182907fb757169b8492ca2f1c6619d9d76ce22803035c3b1d5f6930dffe7b127c1a198390600090a25050565b6000818152600260205260409020805460609190610db090612a2e565b8261121f8161152b565b61122857600080fd5b6000848152600360205260408120805461124190612a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461126d90612a2e565b80156112ba5780601f1061128f576101008083540402835291602001916112ba565b820191906000526020600020905b81548152906001019060200180831161129d57829003601f168201915b50505060008881526003602052604090209293506112dd91508590508683612acf565b50847f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f8582868660405161131293929190612d09565b60405180910390a25050505050565b8161132b8161152b565b61133457600080fd5b61134383603c61035a85611dc2565b505050565b6060611355848484611bcf565b949350505050565b826113678161152b565b61137057600080fd5b60008481526007602090815260408083207fffffffff0000000000000000000000000000000000000000000000000000000087168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b6000828152600160209081526040808320848452909152902080546060919061144f90612a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461147b90612a2e565b80156114c85780601f1061149d576101008083540402835291602001916114c8565b820191906000526020600020905b8154815290600101906020018083116114ab57829003601f168201915b5050505050905092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f59d1d43c0000000000000000000000000000000000000000000000000000000014806104bb57506104bb82611dfb565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614806115a657503373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016145b156115b357506001919050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302571be390602401602060405180830381865afa158015611641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116659190612d39565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361176c576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015611745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117699190612d39565b90505b73ffffffffffffffffffffffffffffffffffffffff8116331480610cc7575073ffffffffffffffffffffffffffffffffffffffff81166000908152600b6020908152604080832033845290915290205460ff16610cc7565b6118126040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526104bb81611abf565b602081015181516060916104bb9161183d9082611e51565b84519190611eab565b60a081015160c08201516060916104bb9161183d908290612a0b565b600081518351148015610cc75750610cc78360008460008751611f22565b600087815260046020908152604082205488519189019190912090916118a7878787611eab565b905083156119b05760008a81526005602090815260408083208684528252808320858452825280832061ffff8c168452909152902080546118e790612a2e565b15905061193b5760008a815260066020908152604080832086845282528083208584529091528120805461ffff169161191f83612d56565b91906101000a81548161ffff021916908361ffff160217905550505b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c16845290915281206119719161234f565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a6040516119a3929190612d74565b60405180910390a2611ab3565b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c168452909152902080546119e890612a2e565b9050600003611a3e5760008a815260066020908152604080832086845282528083208584529091528120805461ffff1691611a2283612d9a565b91906101000a81548161ffff021916908361ffff160217905550505b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c1684529091529020611a758282612c2f565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a84604051611aaa93929190612dbb565b60405180910390a25b50505050505050505050565b60c08101516020820181905281515111611ad65750565b6000611aea82600001518360200151611e51565b8260200151611af99190612dea565b8251909150611b089082611f45565b61ffff166040830152611b1c600282612dea565b8251909150611b2b9082611f45565b61ffff166060830152611b3f600282612dea565b8251909150611b4e9082611f6d565b63ffffffff166080830152611b64600482612dea565b8251909150600090611b769083611f45565b61ffff169050611b87600283612dea565b60a084018190529150611b9a8183612dea565b60c0909301929092525050565b60008151601414611bb757600080fd5b50602001516c01000000000000000000000000900490565b60608167ffffffffffffffff811115611bea57611bea61265f565b604051908082528060200260200182016040528015611c1d57816020015b6060815260200190600190039081611c085790505b50905060005b82811015611dba578415611d02576000848483818110611c4557611c45612bec565b9050602002810190611c579190612dfd565b611c6691602491600491612e62565b611c6f91612e8c565b9050858114611d00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f6d756c746963616c6c3a20416c6c207265636f726473206d757374206861766560448201527f2061206d61746368696e67206e616d656861736800000000000000000000000060648201526084016110a6565b505b60008030868685818110611d1857611d18612bec565b9050602002810190611d2a9190612dfd565b604051611d38929190612a1e565b600060405180830381855af49150503d8060008114611d73576040519150601f19603f3d011682016040523d82523d6000602084013e611d78565b606091505b509150915081611d8757600080fd5b80848481518110611d9a57611d9a612bec565b602002602001018190525050508080611db290612cef565b915050611c23565b509392505050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fc86902330000000000000000000000000000000000000000000000000000000014806104bb57506104bb82611f97565b6000815b83518110611e6557611e65612eaa565b6000611e718583611fed565b60ff169050611e81816001612dea565b611e8b9083612dea565b915080600003611e9b5750611ea1565b50611e55565b6113558382612a0b565b8251606090611eba8385612dea565b1115611ec557600080fd5b60008267ffffffffffffffff811115611ee057611ee061265f565b6040519080825280601f01601f191660200182016040528015611f0a576020820181803683370190505b50905060208082019086860101610a97828287612011565b6000611f2f848484612067565b611f3a878785612067565b149695505050505050565b8151600090611f55836002612dea565b1115611f6057600080fd5b50016002015161ffff1690565b8151600090611f7d836004612dea565b1115611f8857600080fd5b50016004015163ffffffff1690565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f691f34310000000000000000000000000000000000000000000000000000000014806104bb57506104bb8261208b565b600082828151811061200157612001612bec565b016020015160f81c905092915050565b602081106120495781518352612028602084612dea565b9250612035602083612dea565b9150612042602082612a0b565b9050612011565b905182516020929092036101000a6000190180199091169116179052565b82516000906120768385612dea565b111561208157600080fd5b5091016020012090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f124a319c0000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167fa8fa568200000000000000000000000000000000000000000000000000000000148061216f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5c98042b00000000000000000000000000000000000000000000000000000000145b806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167fbc1c58d10000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f3b3b57de00000000000000000000000000000000000000000000000000000000148061225d57507fffffffff0000000000000000000000000000000000000000000000000000000082167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f2203ab560000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f4fbf04330000000000000000000000000000000000000000000000000000000014806104bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104bb565b50805461235b90612a2e565b6000825580601f1061236b575050565b601f016020900490600052602060002090810190612389919061238c565b50565b5b808211156123a1576000815560010161238d565b5090565b80357fffffffff00000000000000000000000000000000000000000000000000000000811681146123d557600080fd5b919050565b6000602082840312156123ec57600080fd5b610cc7826123a5565b60008083601f84011261240757600080fd5b50813567ffffffffffffffff81111561241f57600080fd5b602083019150836020828501011115610bb657600080fd5b60008060006040848603121561244c57600080fd5b83359250602084013567ffffffffffffffff81111561246a57600080fd5b612476868287016123f5565b9497909650939450505050565b60008060008060006060868803121561249b57600080fd5b85359450602086013567ffffffffffffffff808211156124ba57600080fd5b6124c689838a016123f5565b909650945060408801359150808211156124df57600080fd5b506124ec888289016123f5565b969995985093965092949392505050565b6000806040838503121561251057600080fd5b82359150612520602084016123a5565b90509250929050565b6000806040838503121561253c57600080fd5b50508035926020909101359150565b60005b8381101561256657818101518382015260200161254e565b50506000910152565b6000815180845261258781602086016020860161254b565b601f01601f19169290920160200192915050565b828152604060208201526000611355604083018461256f565b6000806000606084860312156125c957600080fd5b505081359360208301359350604090920135919050565b6000602082840312156125f257600080fd5b5035919050565b602081526000610cc7602083018461256f565b6000806000806060858703121561262257600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561264757600080fd5b612653878288016123f5565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156126a357600080fd5b8335925060208401359150604084013567ffffffffffffffff808211156126c957600080fd5b818601915086601f8301126126dd57600080fd5b8135818111156126ef576126ef61265f565b604051601f8201601f19908116603f011681019083821181831017156127175761271761265f565b8160405282815289602084870101111561273057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461238957600080fd5b6000806040838503121561278757600080fd5b823561279281612752565b9150602083013580151581146127a757600080fd5b809150509250929050565b6000806000606084860312156127c757600080fd5b8335925060208401359150604084013561ffff811681146127e757600080fd5b809150509250925092565b60008083601f84011261280457600080fd5b50813567ffffffffffffffff81111561281c57600080fd5b6020830191508360208260051b8501011115610bb657600080fd5b6000806020838503121561284a57600080fd5b823567ffffffffffffffff81111561286157600080fd5b61286d858286016127f2565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156128ec577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526128da85835161256f565b945092850192908501906001016128a0565b5092979650505050505050565b6000806040838503121561290c57600080fd5b8235915060208301356127a781612752565b60008060006040848603121561293357600080fd5b83359250602084013567ffffffffffffffff81111561295157600080fd5b612476868287016127f2565b60008060006060848603121561297257600080fd5b83359250612982602085016123a5565b915060408401356127e781612752565b600080604083850312156129a557600080fd5b82356129b081612752565b915060208301356127a781612752565b600082516129d281846020870161254b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156104bb576104bb6129dc565b8183823760009101908152919050565b600181811c90821680612a4257607f821691505b602082108103612a7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561134357600081815260208120601f850160051c81016020861015612aa85750805b601f850160051c820191505b81811015612ac757828155600101612ab4565b505050505050565b67ffffffffffffffff831115612ae757612ae761265f565b612afb83612af58354612a2e565b83612a81565b6000601f841160018114612b2f5760008515612b175750838201355b600019600387901b1c1916600186901b178355610ffe565b600083815260209020601f19861690835b82811015612b605786850135825560209485019460019092019101612b40565b5086821015612b7d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b604081526000612bce604083018688612b8f565b8281036020840152612be1818587612b8f565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602081526000611355602083018486612b8f565b815167ffffffffffffffff811115612c4957612c4961265f565b612c5d81612c578454612a2e565b84612a81565b602080601f831160018114612c925760008415612c7a5750858301515b600019600386901b1c1916600185901b178555612ac7565b600085815260208120601f198616915b82811015612cc157888601518255948401946001909101908401612ca2565b5085821015612cdf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006000198203612d0257612d026129dc565b5060010190565b604081526000612d1c604083018661256f565b8281036020840152612d2f818587612b8f565b9695505050505050565b600060208284031215612d4b57600080fd5b8151610cc781612752565b600061ffff821680612d6a57612d6a6129dc565b6000190192915050565b604081526000612d87604083018561256f565b905061ffff831660208301529392505050565b600061ffff808316818103612db157612db16129dc565b6001019392505050565b606081526000612dce606083018661256f565b61ffff851660208401528281036040840152612d2f818561256f565b808201808211156104bb576104bb6129dc565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612e3257600080fd5b83018035915067ffffffffffffffff821115612e4d57600080fd5b602001915036819003821315610bb657600080fd5b60008085851115612e7257600080fd5b83861115612e7f57600080fd5b5050820193919092039150565b803560208310156104bb57600019602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea2646970667358221220cd2eac1d906d678e6df226d22fbf07af8e7f47c73c1241959d33cbd438731ee364736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101b95760003560e01c806377372213116100f9578063c869023311610097578063e32954eb11610071578063e32954eb1461042e578063e59d895d14610441578063e985e9c514610454578063f1cb7e061461049d57600080fd5b8063c8690233146103cb578063ce3decdc14610408578063d5fa2b001461041b57600080fd5b8063a8fa5682116100d3578063a8fa568214610372578063ac9650d814610385578063ad5780af146103a5578063bc1c58d1146103b857600080fd5b806377372213146103395780638b95dd711461034c578063a22cb4651461035f57600080fd5b8063304e6ade1161016657806359d1d43c1161014057806359d1d43c146102e05780635c98042b14610300578063623195b014610313578063691f34311461032657600080fd5b8063304e6ade1461027a5780633b3b57de1461028d5780634cbf6ba4146102a057600080fd5b8063124a319c11610197578063124a319c1461020e5780632203ab561461024657806329cd62ea1461026757600080fd5b806301ffc9a7146101be5780630af179d7146101e657806310f13a8c146101fb575b600080fd5b6101d16101cc3660046123da565b6104b0565b60405190151581526020015b60405180910390f35b6101f96101f4366004612437565b6104c1565b005b6101f9610209366004612483565b6106af565b61022161021c3660046124fd565b610761565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101dd565b610259610254366004612529565b610aa2565b6040516101dd92919061259b565b6101f96102753660046125b4565b610bbd565b6101f9610288366004612437565b610c3d565b61022161029b3660046125e0565b610c9c565b6101d16102ae366004612529565b600091825260066020908152604080842060048352818520548552825280842092845291905290205461ffff16151590565b6102f36102ee366004612437565b610cce565b6040516101dd91906125f9565b6102f361030e3660046125e0565b610d93565b6101f961032136600461260c565b610e35565b6102f36103343660046125e0565b610eb6565b6101f9610347366004612437565b610ed3565b6101f961035a36600461268e565b610f32565b6101f961036d366004612774565b611005565b6102f36103803660046127b2565b611146565b610398610393366004612837565b611189565b6040516101dd9190612879565b6101f96103b33660046125e0565b611197565b6102f36103c63660046125e0565b6111f8565b6103f36103d93660046125e0565b600090815260096020526040902080546001909101549091565b604080519283526020830191909152016101dd565b6101f9610416366004612437565b611215565b6101f96104293660046128f9565b611321565b61039861043c36600461291e565b611348565b6101f961044f36600461295d565b61135d565b6101d1610462366004612992565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152600b6020908152604080832093909416825291909152205460ff1690565b6102f36104ab366004612529565b611427565b60006104bb826114d5565b92915050565b826104cb8161152b565b6104d457600080fd5b60008060608060008061052160008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506117c49050565b90505b8051516020820151101561064a578561ffff16600003610589578060400151955061054e81611825565b93508360405160200161056191906129c0565b60405160208183030381529060405280519060200120915061058281611846565b925061063c565b600061059482611825565b9050816040015161ffff168761ffff161415806105b857506105b68582611862565b155b1561063a576106138b86898d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505060208801518c915061060b908290612a0b565b8a5115611880565b81604001519650816020015195508094508480519060200120925061063782611846565b93505b505b61064581611abf565b610524565b508251156106a4576106a48984878b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b925061069c91508290508e612a0b565b885115611880565b505050505050505050565b846106b98161152b565b6106c257600080fd5b8282600a600089815260200190815260200160002087876040516106e7929190612a1e565b90815260200160405180910390209182610702929190612acf565b508484604051610713929190612a1e565b6040518091039020867f448bc014f1536726cf8d54ff3d6481ed3cbc683c2591ca204274009afa09b1a1878787876040516107519493929190612bba565b60405180910390a3505050505050565b60008281526007602090815260408083207fffffffff000000000000000000000000000000000000000000000000000000008516845290915281205473ffffffffffffffffffffffffffffffffffffffff1680156107c05790506104bb565b60006107cb85610c9c565b905073ffffffffffffffffffffffffffffffffffffffff81166107f3576000925050506104bb565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000006024820152600090819073ffffffffffffffffffffffffffffffffffffffff84169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790525161089f91906129c0565b600060405180830381855afa9150503d80600081146108da576040519150601f19603f3d011682016040523d82523d6000602084013e6108df565b606091505b50915091508115806108f2575060208151105b80610934575080601f8151811061090b5761090b612bec565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b156109465760009450505050506104bb565b6040517fffffffff000000000000000000000000000000000000000000000000000000008716602482015273ffffffffffffffffffffffffffffffffffffffff84169060440160408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052516109ef91906129c0565b600060405180830381855afa9150503d8060008114610a2a576040519150601f19603f3d011682016040523d82523d6000602084013e610a2f565b606091505b509092509050811580610a43575060208151105b80610a85575080601f81518110610a5c57610a5c612bec565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016155b15610a975760009450505050506104bb565b509095945050505050565b600082815260208190526040812060609060015b848111610b9d5780851615801590610ae6575060008181526020839052604081208054610ae290612a2e565b9050115b15610b955780826000838152602001908152602001600020808054610b0a90612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3690612a2e565b8015610b835780601f10610b5857610100808354040283529160200191610b83565b820191906000526020600020905b815481529060010190602001808311610b6657829003601f168201915b50505050509050935093505050610bb6565b60011b610ab6565b5060006040518060200160405280600081525092509250505b9250929050565b82610bc78161152b565b610bd057600080fd5b60408051808201825284815260208082018581526000888152600983528490209251835551600190920191909155815185815290810184905285917f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e4691015b60405180910390a250505050565b82610c478161152b565b610c5057600080fd5b6000848152600260205260409020610c69838583612acf565b50837fe379c1624ed7e714cc0937528a32359d69d5281337765313dba4e081b72d75788484604051610c2f929190612c1b565b600080610caa83603c611427565b90508051600003610cbe5750600092915050565b610cc781611ba7565b9392505050565b6060600a60008581526020019081526020016000208383604051610cf3929190612a1e565b90815260200160405180910390208054610d0c90612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3890612a2e565b8015610d855780601f10610d5a57610100808354040283529160200191610d85565b820191906000526020600020905b815481529060010190602001808311610d6857829003601f168201915b505050505090509392505050565b6000818152600360205260409020805460609190610db090612a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ddc90612a2e565b8015610e295780601f10610dfe57610100808354040283529160200191610e29565b820191906000526020600020905b815481529060010190602001808311610e0c57829003601f168201915b50505050509050919050565b83610e3f8161152b565b610e4857600080fd5b83610e54600182612a0b565b1615610e5f57600080fd5b6000858152602081815260408083208784529091529020610e81838583612acf565b50604051849086907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a35050505050565b6000818152600860205260409020805460609190610db090612a2e565b82610edd8161152b565b610ee657600080fd5b6000848152600860205260409020610eff838583612acf565b50837fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78484604051610c2f929190612c1b565b82610f3c8161152b565b610f4557600080fd5b837f65412581168e88a1e60c6459d7f44ae83ad0832e670826c05a4e2476b57af7528484604051610f7792919061259b565b60405180910390a2603c8303610fdb57837f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2610fb284611ba7565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25b60008481526001602090815260408083208684529091529020610ffe8382612c2f565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff821633036110af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336000818152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000838152600560209081526040808320600483528184205484528252808320858452825280832061ffff851684529091529020805460609190610d0c90612a2e565b6060610cc760008484611bcf565b806111a18161152b565b6111aa57600080fd5b60008281526004602052604081208054916111c483612cef565b909155505060405182907fb757169b8492ca2f1c6619d9d76ce22803035c3b1d5f6930dffe7b127c1a198390600090a25050565b6000818152600260205260409020805460609190610db090612a2e565b8261121f8161152b565b61122857600080fd5b6000848152600360205260408120805461124190612a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461126d90612a2e565b80156112ba5780601f1061128f576101008083540402835291602001916112ba565b820191906000526020600020905b81548152906001019060200180831161129d57829003601f168201915b50505060008881526003602052604090209293506112dd91508590508683612acf565b50847f8f15ed4b723ef428f250961da8315675b507046737e19319fc1a4d81bfe87f8582868660405161131293929190612d09565b60405180910390a25050505050565b8161132b8161152b565b61133457600080fd5b61134383603c61035a85611dc2565b505050565b6060611355848484611bcf565b949350505050565b826113678161152b565b61137057600080fd5b60008481526007602090815260408083207fffffffff0000000000000000000000000000000000000000000000000000000087168085529083529281902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155905190815286917f7c69f06bea0bdef565b709e93a147836b0063ba2dd89f02d0b7e8d931e6a6daa910160405180910390a350505050565b6000828152600160209081526040808320848452909152902080546060919061144f90612a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461147b90612a2e565b80156114c85780601f1061149d576101008083540402835291602001916114c8565b820191906000526020600020905b8154815290600101906020018083116114ab57829003601f168201915b5050505050905092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f59d1d43c0000000000000000000000000000000000000000000000000000000014806104bb57506104bb82611dfb565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614806115a657503373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016145b156115b357506001919050565b6040517f02571be3000000000000000000000000000000000000000000000000000000008152600481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302571be390602401602060405180830381865afa158015611641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116659190612d39565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361176c576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015611745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117699190612d39565b90505b73ffffffffffffffffffffffffffffffffffffffff8116331480610cc7575073ffffffffffffffffffffffffffffffffffffffff81166000908152600b6020908152604080832033845290915290205460ff16610cc7565b6118126040518060e001604052806060815260200160008152602001600061ffff168152602001600061ffff168152602001600063ffffffff16815260200160008152602001600081525090565b82815260c081018290526104bb81611abf565b602081015181516060916104bb9161183d9082611e51565b84519190611eab565b60a081015160c08201516060916104bb9161183d908290612a0b565b600081518351148015610cc75750610cc78360008460008751611f22565b600087815260046020908152604082205488519189019190912090916118a7878787611eab565b905083156119b05760008a81526005602090815260408083208684528252808320858452825280832061ffff8c168452909152902080546118e790612a2e565b15905061193b5760008a815260066020908152604080832086845282528083208584529091528120805461ffff169161191f83612d56565b91906101000a81548161ffff021916908361ffff160217905550505b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c16845290915281206119719161234f565b897f03528ed0c2a3ebc993b12ce3c16bb382f9c7d88ef7d8a1bf290eaf35955a12078a8a6040516119a3929190612d74565b60405180910390a2611ab3565b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c168452909152902080546119e890612a2e565b9050600003611a3e5760008a815260066020908152604080832086845282528083208584529091528120805461ffff1691611a2283612d9a565b91906101000a81548161ffff021916908361ffff160217905550505b60008a81526005602090815260408083208684528252808320858452825280832061ffff8c1684529091529020611a758282612c2f565b50897f52a608b3303a48862d07a73d82fa221318c0027fbbcfb1b2329bface3f19ff2b8a8a84604051611aaa93929190612dbb565b60405180910390a25b50505050505050505050565b60c08101516020820181905281515111611ad65750565b6000611aea82600001518360200151611e51565b8260200151611af99190612dea565b8251909150611b089082611f45565b61ffff166040830152611b1c600282612dea565b8251909150611b2b9082611f45565b61ffff166060830152611b3f600282612dea565b8251909150611b4e9082611f6d565b63ffffffff166080830152611b64600482612dea565b8251909150600090611b769083611f45565b61ffff169050611b87600283612dea565b60a084018190529150611b9a8183612dea565b60c0909301929092525050565b60008151601414611bb757600080fd5b50602001516c01000000000000000000000000900490565b60608167ffffffffffffffff811115611bea57611bea61265f565b604051908082528060200260200182016040528015611c1d57816020015b6060815260200190600190039081611c085790505b50905060005b82811015611dba578415611d02576000848483818110611c4557611c45612bec565b9050602002810190611c579190612dfd565b611c6691602491600491612e62565b611c6f91612e8c565b9050858114611d00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f6d756c746963616c6c3a20416c6c207265636f726473206d757374206861766560448201527f2061206d61746368696e67206e616d656861736800000000000000000000000060648201526084016110a6565b505b60008030868685818110611d1857611d18612bec565b9050602002810190611d2a9190612dfd565b604051611d38929190612a1e565b600060405180830381855af49150503d8060008114611d73576040519150601f19603f3d011682016040523d82523d6000602084013e611d78565b606091505b509150915081611d8757600080fd5b80848481518110611d9a57611d9a612bec565b602002602001018190525050508080611db290612cef565b915050611c23565b509392505050565b6040805160148082528183019092526060916020820181803683375050506c010000000000000000000000009290920260208301525090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fc86902330000000000000000000000000000000000000000000000000000000014806104bb57506104bb82611f97565b6000815b83518110611e6557611e65612eaa565b6000611e718583611fed565b60ff169050611e81816001612dea565b611e8b9083612dea565b915080600003611e9b5750611ea1565b50611e55565b6113558382612a0b565b8251606090611eba8385612dea565b1115611ec557600080fd5b60008267ffffffffffffffff811115611ee057611ee061265f565b6040519080825280601f01601f191660200182016040528015611f0a576020820181803683370190505b50905060208082019086860101610a97828287612011565b6000611f2f848484612067565b611f3a878785612067565b149695505050505050565b8151600090611f55836002612dea565b1115611f6057600080fd5b50016002015161ffff1690565b8151600090611f7d836004612dea565b1115611f8857600080fd5b50016004015163ffffffff1690565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f691f34310000000000000000000000000000000000000000000000000000000014806104bb57506104bb8261208b565b600082828151811061200157612001612bec565b016020015160f81c905092915050565b602081106120495781518352612028602084612dea565b9250612035602083612dea565b9150612042602082612a0b565b9050612011565b905182516020929092036101000a6000190180199091169116179052565b82516000906120768385612dea565b111561208157600080fd5b5091016020012090565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f124a319c0000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167fa8fa568200000000000000000000000000000000000000000000000000000000148061216f57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5c98042b00000000000000000000000000000000000000000000000000000000145b806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167fbc1c58d10000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f3b3b57de00000000000000000000000000000000000000000000000000000000148061225d57507fffffffff0000000000000000000000000000000000000000000000000000000082167ff1cb7e0600000000000000000000000000000000000000000000000000000000145b806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f2203ab560000000000000000000000000000000000000000000000000000000014806104bb57506104bb8260007fffffffff0000000000000000000000000000000000000000000000000000000082167f4fbf04330000000000000000000000000000000000000000000000000000000014806104bb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104bb565b50805461235b90612a2e565b6000825580601f1061236b575050565b601f016020900490600052602060002090810190612389919061238c565b50565b5b808211156123a1576000815560010161238d565b5090565b80357fffffffff00000000000000000000000000000000000000000000000000000000811681146123d557600080fd5b919050565b6000602082840312156123ec57600080fd5b610cc7826123a5565b60008083601f84011261240757600080fd5b50813567ffffffffffffffff81111561241f57600080fd5b602083019150836020828501011115610bb657600080fd5b60008060006040848603121561244c57600080fd5b83359250602084013567ffffffffffffffff81111561246a57600080fd5b612476868287016123f5565b9497909650939450505050565b60008060008060006060868803121561249b57600080fd5b85359450602086013567ffffffffffffffff808211156124ba57600080fd5b6124c689838a016123f5565b909650945060408801359150808211156124df57600080fd5b506124ec888289016123f5565b969995985093965092949392505050565b6000806040838503121561251057600080fd5b82359150612520602084016123a5565b90509250929050565b6000806040838503121561253c57600080fd5b50508035926020909101359150565b60005b8381101561256657818101518382015260200161254e565b50506000910152565b6000815180845261258781602086016020860161254b565b601f01601f19169290920160200192915050565b828152604060208201526000611355604083018461256f565b6000806000606084860312156125c957600080fd5b505081359360208301359350604090920135919050565b6000602082840312156125f257600080fd5b5035919050565b602081526000610cc7602083018461256f565b6000806000806060858703121561262257600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561264757600080fd5b612653878288016123f5565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156126a357600080fd5b8335925060208401359150604084013567ffffffffffffffff808211156126c957600080fd5b818601915086601f8301126126dd57600080fd5b8135818111156126ef576126ef61265f565b604051601f8201601f19908116603f011681019083821181831017156127175761271761265f565b8160405282815289602084870101111561273057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461238957600080fd5b6000806040838503121561278757600080fd5b823561279281612752565b9150602083013580151581146127a757600080fd5b809150509250929050565b6000806000606084860312156127c757600080fd5b8335925060208401359150604084013561ffff811681146127e757600080fd5b809150509250925092565b60008083601f84011261280457600080fd5b50813567ffffffffffffffff81111561281c57600080fd5b6020830191508360208260051b8501011115610bb657600080fd5b6000806020838503121561284a57600080fd5b823567ffffffffffffffff81111561286157600080fd5b61286d858286016127f2565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156128ec577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526128da85835161256f565b945092850192908501906001016128a0565b5092979650505050505050565b6000806040838503121561290c57600080fd5b8235915060208301356127a781612752565b60008060006040848603121561293357600080fd5b83359250602084013567ffffffffffffffff81111561295157600080fd5b612476868287016127f2565b60008060006060848603121561297257600080fd5b83359250612982602085016123a5565b915060408401356127e781612752565b600080604083850312156129a557600080fd5b82356129b081612752565b915060208301356127a781612752565b600082516129d281846020870161254b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156104bb576104bb6129dc565b8183823760009101908152919050565b600181811c90821680612a4257607f821691505b602082108103612a7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561134357600081815260208120601f850160051c81016020861015612aa85750805b601f850160051c820191505b81811015612ac757828155600101612ab4565b505050505050565b67ffffffffffffffff831115612ae757612ae761265f565b612afb83612af58354612a2e565b83612a81565b6000601f841160018114612b2f5760008515612b175750838201355b600019600387901b1c1916600186901b178355610ffe565b600083815260209020601f19861690835b82811015612b605786850135825560209485019460019092019101612b40565b5086821015612b7d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b604081526000612bce604083018688612b8f565b8281036020840152612be1818587612b8f565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602081526000611355602083018486612b8f565b815167ffffffffffffffff811115612c4957612c4961265f565b612c5d81612c578454612a2e565b84612a81565b602080601f831160018114612c925760008415612c7a5750858301515b600019600386901b1c1916600185901b178555612ac7565b600085815260208120601f198616915b82811015612cc157888601518255948401946001909101908401612ca2565b5085821015612cdf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006000198203612d0257612d026129dc565b5060010190565b604081526000612d1c604083018661256f565b8281036020840152612d2f818587612b8f565b9695505050505050565b600060208284031215612d4b57600080fd5b8151610cc781612752565b600061ffff821680612d6a57612d6a6129dc565b6000190192915050565b604081526000612d87604083018561256f565b905061ffff831660208301529392505050565b600061ffff808316818103612db157612db16129dc565b6001019392505050565b606081526000612dce606083018661256f565b61ffff851660208401528281036040840152612d2f818561256f565b808201808211156104bb576104bb6129dc565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612e3257600080fd5b83018035915067ffffffffffffffff821115612e4d57600080fd5b602001915036819003821315610bb657600080fd5b60008085851115612e7257600080fd5b83861115612e7f57600080fd5b5050820193919092039150565b803560208310156104bb57600019602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea2646970667358221220cd2eac1d906d678e6df226d22fbf07af8e7f47c73c1241959d33cbd438731ee364736f6c63430008110033", + "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." + } + }, + "clearDNSZone(bytes32)": { + "params": { + "node": "the namehash of the node for which to clear the zone" + } + }, + "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." + } + }, + "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." + }, + "clearDNSZone(bytes32)": { + "notice": "Clear all information for a DNS zone." + }, + "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": 13984, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "abis", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))" + }, + { + "astId": 14128, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "_addresses", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_mapping(t_uint256,t_bytes_storage))" + }, + { + "astId": 14309, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "hashes", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_bytes32,t_bytes_storage)" + }, + { + "astId": 14389, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "zonehashes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_bytes_storage)" + }, + { + "astId": 14393, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "versions", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 14403, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "records", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_bytes32,t_mapping(t_uint256,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))" + }, + { + "astId": 14411, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "nameEntriesCount", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_bytes32,t_mapping(t_uint256,t_mapping(t_bytes32,t_uint16)))" + }, + { + "astId": 15094, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "interfaces", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_bytes32,t_mapping(t_bytes4,t_address))" + }, + { + "astId": 15276, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "names", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_bytes32,t_string_storage)" + }, + { + "astId": 15353, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "pubkeys", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_bytes32,t_struct(PublicKey)15348_storage)" + }, + { + "astId": 15440, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "texts", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_bytes32,t_mapping(t_string_memory_ptr,t_string_storage))" + }, + { + "astId": 13608, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "_operatorApprovals", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_address,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_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_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_mapping(t_uint256,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint256 => mapping(bytes32 => mapping(uint16 => bytes))))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))" + }, + "t_mapping(t_bytes32,t_mapping(t_uint256,t_mapping(t_bytes32,t_uint16)))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(uint256 => mapping(bytes32 => uint16)))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_mapping(t_bytes32,t_uint16))" + }, + "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)15348_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct PubkeyResolver.PublicKey)", + "numberOfBytes": "32", + "value": "t_struct(PublicKey)15348_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_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "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_uint256,t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage)))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(bytes32 => mapping(uint16 => bytes)))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_mapping(t_uint16,t_bytes_storage))" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_uint16))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(bytes32 => uint16))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_uint16)" + }, + "t_string_memory_ptr": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(PublicKey)15348_storage": { + "encoding": "inplace", + "label": "struct PubkeyResolver.PublicKey", + "members": [ + { + "astId": 15345, + "contract": "contracts/resolvers/PublicResolver.sol:PublicResolver", + "label": "x", + "offset": 0, + "slot": "0", + "type": "t_bytes32" + }, + { + "astId": 15347, + "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" + } + } + } +} \ No newline at end of file diff --git a/deployments/goerli/ReverseRegistrar.json b/deployments/goerli/ReverseRegistrar.json index ce0c4f26..f8b231db 100644 --- a/deployments/goerli/ReverseRegistrar.json +++ b/deployments/goerli/ReverseRegistrar.json @@ -1,157 +1,530 @@ { - "address": "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c", - "transactionHash": "0x2e583067c5afd4e317f8c0c61c54432551848ecd3b99794b20cb81e55eae08df", - "abi": [ - { - "inputs": [ - { - "internalType": "contract ENS", - "name": "ensAddr", - "type": "address" - }, - { - "internalType": "contract Resolver", - "name": "resolverAddr", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "constant": true, - "inputs": [], - "name": "ADDR_REVERSE_NODE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "resolver", - "type": "address" - } - ], - "name": "claimWithResolver", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "defaultResolver", - "outputs": [ - { - "internalType": "contract Resolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "ens", - "outputs": [ - { - "internalType": "contract ENS", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "node", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setName", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ] + "address": "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48", + "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": "0x46f44f52692b21b3b3e8e285c2060c969cb3ab7cde1b99dbd1be511ab06bcc8d", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48", + "transactionIndex": 45, + "gasUsed": "1054932", + "logsBloom": "0x00000000000000000000000000000000000040000000000000800000000000000000000000000000000000000000010000000000000010004000000000000000100000000000000000000000000000000001000000000000000000000000010000000000020000000000000000100800000000000000000000000000000000400000010000000000000000000000000004000000000000000000000000000000000000000000040000000000000000000000000000000000008000040000000000000000000000000000000000005000000004000000000000000000000020000000000000000000000000000100000000000000001000000000000008000000", + "blockHash": "0x8834f7721462d451c49c87db7e5e8ee7eb8e61c4689a680b84cf724a273fe1c0", + "transactionHash": "0x46f44f52692b21b3b3e8e285c2060c969cb3ab7cde1b99dbd1be511ab06bcc8d", + "logs": [ + { + "transactionIndex": 45, + "blockNumber": 7625500, + "transactionHash": "0x46f44f52692b21b3b3e8e285c2060c969cb3ab7cde1b99dbd1be511ab06bcc8d", + "address": "0xD5610A08E370051a01fdfe4bB3ddf5270af1aA48", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a303ddc620aa7d1390baccc8a495508b183fab59" + ], + "data": "0x", + "logIndex": 96, + "blockHash": "0x8834f7721462d451c49c87db7e5e8ee7eb8e61c4689a680b84cf724a273fe1c0" + }, + { + "transactionIndex": 45, + "blockNumber": 7625500, + "transactionHash": "0x46f44f52692b21b3b3e8e285c2060c969cb3ab7cde1b99dbd1be511ab06bcc8d", + "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", + "topics": [ + "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", + "0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2", + "0x8ff84f22fbcd6dc74d6325309e35589f374539c0ee9147ae9a7b238ef9998f38" + ], + "data": "0x000000000000000000000000a303ddc620aa7d1390baccc8a495508b183fab59", + "logIndex": 97, + "blockHash": "0x8834f7721462d451c49c87db7e5e8ee7eb8e61c4689a680b84cf724a273fe1c0" + } + ], + "blockNumber": 7625500, + "cumulativeGasUsed": "8759132", + "status": 1, + "byzantium": true + }, + "args": [ + "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" + ], + "numDeployments": 2, + "solcInputHash": "a5ab15037ea2d912526c4e5696fda13f", + "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/registry/ReverseRegistrar.sol\":\"ReverseRegistrar\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"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(address owner, address operator)\\n external\\n view\\n returns (bool);\\n}\\n\",\"keccak256\":\"0xf79be82c1a2eb0a77fba4e0972221912e803309081ca460fd2cf61653e55758a\"},\"contracts/registry/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(address owner, address resolver)\\n external\\n 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\":\"0xd6ba83973ffbab31dec17a716af3bb5703844d16dceb5078583fb2c509f8bcc2\"},\"contracts/registry/ReverseRegistrar.sol\":{\"content\":\"pragma solidity >=0.8.4;\\n\\nimport \\\"./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(address owner, address resolver)\\n public\\n override\\n returns (bytes32)\\n {\\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\":\"0x4430930561750d2de1163f7b7ba22ae003a7684394371e90a04374859a2337cf\"},\"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": "0x60a06040523480156200001157600080fd5b50604051620012f1380380620012f18339810160408190526200003491620001c4565b6200003f336200015b565b6001600160a01b03811660808190526040516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152600091906302571be390602401602060405180830381865afa158015620000ac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000d29190620001c4565b90506001600160a01b038116156200015357604051630f41a04d60e11b81523360048201526001600160a01b03821690631e83409a906024016020604051808303816000875af11580156200012b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001519190620001eb565b505b505062000205565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620001c157600080fd5b50565b600060208284031215620001d757600080fd5b8151620001e481620001ab565b9392505050565b600060208284031215620001fe57600080fd5b5051919050565b6080516110c26200022f6000396000818161012d0152818161033e015261058901526110c26000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c66485b211610066578063c66485b214610208578063da8c229e1461021b578063e0dba60f1461024e578063f2fde38b1461026157600080fd5b80638da5cb5b146101c4578063bffbe61c146101e2578063c47f0027146101f557600080fd5b806365669631116100c85780636566963114610174578063715018a6146101875780637a806d6b14610191578063828eab0e146101a457600080fd5b80630f5a5466146100ef5780631e83409a146101155780633f15457f14610128575b600080fd5b6101026100fd366004610d75565b610274565b6040519081526020015b60405180910390f35b610102610123366004610dae565b610288565b61014f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010c565b610102610182366004610dcb565b6102b7565b61018f6105f0565b005b61010261019f366004610ef0565b61067d565b60025461014f9073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1661014f565b6101026101f0366004610dae565b61071e565b610102610203366004610f65565b610779565b61018f610216366004610dae565b6107a3565b61023e610229366004610dae565b60016020526000908152604090205460ff1681565b604051901515815260200161010c565b61018f61025c366004610fb0565b610936565b61018f61026f366004610dae565b610a41565b60006102813384846102b7565b9392505050565b6002546000906102b1903390849073ffffffffffffffffffffffffffffffffffffffff166102b7565b92915050565b60008373ffffffffffffffffffffffffffffffffffffffff81163314806102ed57503360009081526001602052604090205460ff165b806103a957506040517fe985e9c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a99190610fde565b806103b857506103b881610b71565b61046f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605b60248201527f526576657273655265676973747261723a2043616c6c6572206973206e6f742060448201527f6120636f6e74726f6c6c6572206f7220617574686f726973656420627920616460648201527f6472657373206f7220746865206164647265737320697473656c660000000000608482015260a4015b60405180910390fd5b600061047a86610c22565b604080517f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26020808301919091528183018490528251808303840181526060909201928390528151910120919250819073ffffffffffffffffffffffffffffffffffffffff8916907f6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e9290600090a36040517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260048201526024810183905273ffffffffffffffffffffffffffffffffffffffff87811660448301528681166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156105cd57600080fd5b505af11580156105e1573d6000803e3d6000fd5b50929998505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b61067b6000610cde565b565b60008061068b8686866102b7565b6040517f7737221300000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8516906377372213906106e29084908790600401610ffb565b600060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b509298975050505050505050565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e261074a83610c22565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050919050565b6002546000906102b1903390819073ffffffffffffffffffffffffffffffffffffffff168561067d565b60005473ffffffffffffffffffffffffffffffffffffffff163314610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff81166108c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f526576657273655265676973747261723a205265736f6c76657220616464726560448201527f7373206d757374206e6f742062652030000000000000000000000000000000006064820152608401610466565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517feae17a84d9eb83d8c8eb317f9e7d64857bc363fa51674d996c023f4340c577cf90600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ac2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff8116610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610466565b610b6e81610cde565b50565b60008173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610bf8575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610bf59181019061106f565b60015b610c0457506000919050565b73ffffffffffffffffffffffffffffffffffffffff16331492915050565b600060285b8015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600f84161a81536010909204917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600f84161a8153601083049250610c27565b50506028600020919050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b6e57600080fd5b60008060408385031215610d8857600080fd5b8235610d9381610d53565b91506020830135610da381610d53565b809150509250929050565b600060208284031215610dc057600080fd5b813561028181610d53565b600080600060608486031215610de057600080fd5b8335610deb81610d53565b92506020840135610dfb81610d53565b91506040840135610e0b81610d53565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610e5657600080fd5b813567ffffffffffffffff80821115610e7157610e71610e16565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610eb757610eb7610e16565b81604052838152866020858801011115610ed057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215610f0657600080fd5b8435610f1181610d53565b93506020850135610f2181610d53565b92506040850135610f3181610d53565b9150606085013567ffffffffffffffff811115610f4d57600080fd5b610f5987828801610e45565b91505092959194509250565b600060208284031215610f7757600080fd5b813567ffffffffffffffff811115610f8e57600080fd5b610f9a84828501610e45565b949350505050565b8015158114610b6e57600080fd5b60008060408385031215610fc357600080fd5b8235610fce81610d53565b91506020830135610da381610fa2565b600060208284031215610ff057600080fd5b815161028181610fa2565b82815260006020604081840152835180604085015260005b8181101561102f57858101830151858201606001528201611013565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509392505050565b60006020828403121561108157600080fd5b815161028181610d5356fea264697066735822122030f8ee7d282ef64d328e7804deeb2da69cb552c7cd254f7f899b8afc6a03042664736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c66485b211610066578063c66485b214610208578063da8c229e1461021b578063e0dba60f1461024e578063f2fde38b1461026157600080fd5b80638da5cb5b146101c4578063bffbe61c146101e2578063c47f0027146101f557600080fd5b806365669631116100c85780636566963114610174578063715018a6146101875780637a806d6b14610191578063828eab0e146101a457600080fd5b80630f5a5466146100ef5780631e83409a146101155780633f15457f14610128575b600080fd5b6101026100fd366004610d75565b610274565b6040519081526020015b60405180910390f35b610102610123366004610dae565b610288565b61014f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010c565b610102610182366004610dcb565b6102b7565b61018f6105f0565b005b61010261019f366004610ef0565b61067d565b60025461014f9073ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1661014f565b6101026101f0366004610dae565b61071e565b610102610203366004610f65565b610779565b61018f610216366004610dae565b6107a3565b61023e610229366004610dae565b60016020526000908152604090205460ff1681565b604051901515815260200161010c565b61018f61025c366004610fb0565b610936565b61018f61026f366004610dae565b610a41565b60006102813384846102b7565b9392505050565b6002546000906102b1903390849073ffffffffffffffffffffffffffffffffffffffff166102b7565b92915050565b60008373ffffffffffffffffffffffffffffffffffffffff81163314806102ed57503360009081526001602052604090205460ff165b806103a957506040517fe985e9c500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a99190610fde565b806103b857506103b881610b71565b61046f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605b60248201527f526576657273655265676973747261723a2043616c6c6572206973206e6f742060448201527f6120636f6e74726f6c6c6572206f7220617574686f726973656420627920616460648201527f6472657373206f7220746865206164647265737320697473656c660000000000608482015260a4015b60405180910390fd5b600061047a86610c22565b604080517f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26020808301919091528183018490528251808303840181526060909201928390528151910120919250819073ffffffffffffffffffffffffffffffffffffffff8916907f6ada868dd3058cf77a48a74489fd7963688e5464b2b0fa957ace976243270e9290600090a36040517f5ef2c7f00000000000000000000000000000000000000000000000000000000081527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260048201526024810183905273ffffffffffffffffffffffffffffffffffffffff87811660448301528681166064830152600060848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156105cd57600080fd5b505af11580156105e1573d6000803e3d6000fd5b50929998505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b61067b6000610cde565b565b60008061068b8686866102b7565b6040517f7737221300000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff8516906377372213906106e29084908790600401610ffb565b600060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b509298975050505050505050565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e261074a83610c22565b604080516020810193909352820152606001604051602081830303815290604052805190602001209050919050565b6002546000906102b1903390819073ffffffffffffffffffffffffffffffffffffffff168561067d565b60005473ffffffffffffffffffffffffffffffffffffffff163314610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff81166108c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f526576657273655265676973747261723a205265736f6c76657220616464726560448201527f7373206d757374206e6f742062652030000000000000000000000000000000006064820152608401610466565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517feae17a84d9eb83d8c8eb317f9e7d64857bc363fa51674d996c023f4340c577cf90600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff821660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87910160405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ac2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b73ffffffffffffffffffffffffffffffffffffffff8116610b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610466565b610b6e81610cde565b50565b60008173ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610bf8575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610bf59181019061106f565b60015b610c0457506000919050565b73ffffffffffffffffffffffffffffffffffffffff16331492915050565b600060285b8015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600f84161a81536010909204917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600f84161a8153601083049250610c27565b50506028600020919050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b6e57600080fd5b60008060408385031215610d8857600080fd5b8235610d9381610d53565b91506020830135610da381610d53565b809150509250929050565b600060208284031215610dc057600080fd5b813561028181610d53565b600080600060608486031215610de057600080fd5b8335610deb81610d53565b92506020840135610dfb81610d53565b91506040840135610e0b81610d53565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610e5657600080fd5b813567ffffffffffffffff80821115610e7157610e71610e16565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610eb757610eb7610e16565b81604052838152866020858801011115610ed057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215610f0657600080fd5b8435610f1181610d53565b93506020850135610f2181610d53565b92506040850135610f3181610d53565b9150606085013567ffffffffffffffff811115610f4d57600080fd5b610f5987828801610e45565b91505092959194509250565b600060208284031215610f7757600080fd5b813567ffffffffffffffff811115610f8e57600080fd5b610f9a84828501610e45565b949350505050565b8015158114610b6e57600080fd5b60008060408385031215610fc357600080fd5b8235610fce81610d53565b91506020830135610da381610fa2565b600060208284031215610ff057600080fd5b815161028181610fa2565b82815260006020604081840152835180604085015260005b8181101561102f57858101830151858201606001528201611013565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116850101925050509392505050565b60006020828403121561108157600080fd5b815161028181610d5356fea264697066735822122030f8ee7d282ef64d328e7804deeb2da69cb552c7cd254f7f899b8afc6a03042664736f6c63430008110033", + "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": 545, + "contract": "contracts/registry/ReverseRegistrar.sol:ReverseRegistrar", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 15518, + "contract": "contracts/registry/ReverseRegistrar.sol:ReverseRegistrar", + "label": "controllers", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 12919, + "contract": "contracts/registry/ReverseRegistrar.sol:ReverseRegistrar", + "label": "defaultResolver", + "offset": 0, + "slot": "2", + "type": "t_contract(NameResolver)12901" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(NameResolver)12901": { + "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/goerli/StaticMetadataService.json b/deployments/goerli/StaticMetadataService.json new file mode 100644 index 00000000..3ff17525 --- /dev/null +++ b/deployments/goerli/StaticMetadataService.json @@ -0,0 +1,88 @@ +{ + "address": "0x9DAfDe161D690d9e18f8021c392B0dBCBf0Cf8cB", + "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": "0x89c816ce7274d1eceed7a81c8bfa9166dc45703d8d218408d9dcff322bd394ae", + "receipt": { + "to": null, + "from": "0xa303ddC620aa7d1390BACcc8A495508B183fab59", + "contractAddress": "0x9DAfDe161D690d9e18f8021c392B0dBCBf0Cf8cB", + "transactionIndex": 19, + "gasUsed": "240222", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x584a27a1ef1ccda1f6555f6feac6c6aa0b526a3a499eed267fd1466ea53e5ba1", + "transactionHash": "0x89c816ce7274d1eceed7a81c8bfa9166dc45703d8d218408d9dcff322bd394ae", + "logs": [], + "blockNumber": 7625505, + "cumulativeGasUsed": "5522874", + "status": 1, + "byzantium": true + }, + "args": [ + "ens-metadata-service.appspot.com/name/0x{id}" + ], + "numDeployments": 1, + "solcInputHash": "2d8cd8af817b3996918016eaf0684f54", + "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\":10000},\"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": "0x608060405234801561001057600080fd5b5060405161047338038061047383398101604081905261002f91610058565b600061003b82826101aa565b5050610269565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561006b57600080fd5b82516001600160401b038082111561008257600080fd5b818501915085601f83011261009657600080fd5b8151818111156100a8576100a8610042565b604051601f8201601f19908116603f011681019083821181831017156100d0576100d0610042565b8160405282815288868487010111156100e857600080fd5b600093505b8284101561010a57848401860151818501870152928501926100ed565b600086848301015280965050505050505092915050565b600181811c9082168061013557607f821691505b60208210810361015557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156101a557600081815260208120601f850160051c810160208610156101825750805b601f850160051c820191505b818110156101a15782815560010161018e565b5050505b505050565b81516001600160401b038111156101c3576101c3610042565b6101d7816101d18454610121565b8461015b565b602080601f83116001811461020c57600084156101f45750858301515b600019600386901b1c1916600185901b1785556101a1565b600085815260208120601f198616915b8281101561023b5788860151825594840194600190910190840161021c565b50858210156102595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6101fb806102786000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80630e89341c14610030575b600080fd5b61004361003e3660046100ed565b610059565b6040516100509190610106565b60405180910390f35b60606000805461006890610172565b80601f016020809104026020016040519081016040528092919081815260200182805461009490610172565b80156100e15780601f106100b6576101008083540402835291602001916100e1565b820191906000526020600020905b8154815290600101906020018083116100c457829003601f168201915b50505050509050919050565b6000602082840312156100ff57600080fd5b5035919050565b600060208083528351808285015260005b8181101561013357858101830151858201604001528201610117565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600181811c9082168061018657607f821691505b6020821081036101bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea2646970667358221220f100acc2f2e385cccbfeea195abeed40ba79f3672462763da96786a66c7a987a64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80630e89341c14610030575b600080fd5b61004361003e3660046100ed565b610059565b6040516100509190610106565b60405180910390f35b60606000805461006890610172565b80601f016020809104026020016040519081016040528092919081815260200182805461009490610172565b80156100e15780601f106100b6576101008083540402835291602001916100e1565b820191906000526020600020905b8154815290600101906020018083116100c457829003601f168201915b50505050509050919050565b6000602082840312156100ff57600080fd5b5035919050565b600060208083528351808285015260005b8181101561013357858101830151858201604001528201610117565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b600181811c9082168061018657607f821691505b6020821081036101bf577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b5091905056fea2646970667358221220f100acc2f2e385cccbfeea195abeed40ba79f3672462763da96786a66c7a987a64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3, + "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/goerli/solcInputs/2d8cd8af817b3996918016eaf0684f54.json b/deployments/goerli/solcInputs/2d8cd8af817b3996918016eaf0684f54.json new file mode 100644 index 00000000..88e1d051 --- /dev/null +++ b/deployments/goerli/solcInputs/2d8cd8af817b3996918016eaf0684f54.json @@ -0,0 +1,35 @@ +{ + "language": "Solidity", + "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" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "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/goerli/solcInputs/9ab134ee99f7410d077d71824d3e2f84.json b/deployments/goerli/solcInputs/9ab134ee99f7410d077d71824d3e2f84.json new file mode 100644 index 00000000..ba123bd1 --- /dev/null +++ b/deployments/goerli/solcInputs/9ab134ee99f7410d077d71824d3e2f84.json @@ -0,0 +1,35 @@ +{ + "language": "Solidity", + "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" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "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/goerli/solcInputs/a5ab15037ea2d912526c4e5696fda13f.json b/deployments/goerli/solcInputs/a5ab15037ea2d912526c4e5696fda13f.json new file mode 100644 index 00000000..1d0607c6 --- /dev/null +++ b/deployments/goerli/solcInputs/a5ab15037ea2d912526c4e5696fda13f.json @@ -0,0 +1,362 @@ +{ + "language": "Solidity", + "sources": { + "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 \"@ensdomains/buffer/contracts/Buffer.sol\";\n\nlibrary DNSClaimChecker {\n using BytesUtils 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(bytes memory name, bytes memory data)\n internal\n pure\n returns (address, bool)\n {\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 bool found;\n address addr;\n (addr, found) = parseRR(data, iter.rdataOffset);\n if (found) {\n return (addr, true);\n }\n }\n\n return (address(0x0), false);\n }\n\n function parseRR(bytes memory rdata, uint256 idx)\n internal\n pure\n returns (address, bool)\n {\n while (idx < rdata.length) {\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 if (len < 44) return (address(0x0), false);\n return hexToAddress(str, idx + 4);\n }\n\n function hexToAddress(bytes memory str, uint256 idx)\n internal\n pure\n returns (address, bool)\n {\n if (str.length - idx < 40) return (address(0x0), false);\n uint256 ret = 0;\n for (uint256 i = idx; i < idx + 40; i++) {\n ret <<= 4;\n uint256 x = str.readUint8(i);\n if (x >= 48 && x < 58) {\n ret |= x - 48;\n } else if (x >= 65 && x < 71) {\n ret |= x - 55;\n } else if (x >= 97 && x < 103) {\n ret |= x - 87;\n } else {\n return (address(0x0), false);\n }\n }\n return (address(uint160(ret)), true);\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(RRSetWithSignature[] memory input)\n external\n view\n virtual\n returns (bytes memory rrs, uint32 inception);\n\n function verifyRRSet(RRSetWithSignature[] memory input, uint256 now)\n public\n view\n virtual\n returns (bytes memory rrs, uint32 inception);\n}\n" + }, + "contracts/dnssec-oracle/BytesUtils.sol": { + "content": "pragma solidity ^0.8.4;\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 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(bytes memory self, bytes memory other)\n internal\n pure\n returns (int256)\n {\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 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 > 32) {\n mask = type(uint256).max;\n } else {\n mask = ~(2**(8 * (32 - shortest + idx)) - 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(bytes memory self, bytes memory other)\n internal\n pure\n returns (bool)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (uint8 ret)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (uint16 ret)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (uint32 ret)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (bytes32 ret)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (bytes20 ret)\n {\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(\n uint256 dest,\n uint256 src,\n uint256 len\n ) 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/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(bytes memory self, uint256 offset)\n internal\n pure\n returns (uint256)\n {\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(bytes memory self, uint256 offset)\n internal\n pure\n returns (bytes memory ret)\n {\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(bytes memory self, uint256 offset)\n internal\n pure\n returns (uint256)\n {\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(bytes memory data)\n internal\n pure\n returns (SignedSet memory self)\n {\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(SignedSet memory rrset)\n internal\n pure\n returns (RRIterator memory)\n {\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(bytes memory self, uint256 offset)\n internal\n pure\n returns (RRIterator memory ret)\n {\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(RRIterator memory iter)\n internal\n pure\n returns (bytes memory)\n {\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 compareNames(bytes memory self, bytes memory other)\n internal\n pure\n returns (int256)\n {\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(uint32 i1, uint32 i2)\n internal\n pure\n returns (bool)\n {\n return int32(i1) - int32(i2) >= 0;\n }\n\n function progress(bytes memory body, uint256 off)\n internal\n pure\n returns (uint256)\n {\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" + }, + "@ensdomains/buffer/contracts/Buffer.sol": { + "content": "pragma 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 writing 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 mstore(0x40, add(32, add(ptr, capacity)))\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 function max(uint a, uint b) private pure returns(uint) {\n if (a > b) {\n return a;\n }\n return b;\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 Writes 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 off The start offset to write 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 write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n if (off + len > buf.capacity) {\n resize(buf, max(buf.capacity, len + off) * 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(add(len, off), buflen) {\n mstore(bufptr, add(len, off))\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 * @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 return write(buf, buf.buf.length, data, len);\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 write(buf, buf.buf.length, data, data.length);\n }\n\n /**\n * @dev Writes 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 off The offset to write the byte at.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function writeUint8(buffer memory buf, uint off, uint8 data) internal pure returns(buffer memory) {\n if (off >= buf.capacity) {\n resize(buf, buf.capacity * 2);\n }\n\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 // 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 eq(off, buflen) {\n mstore(bufptr, add(buflen, 1))\n }\n }\n return buf;\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 return writeUint8(buf, buf.buf.length, data);\n }\n\n /**\n * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param off The offset to write at.\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 write(buffer memory buf, uint off, bytes32 data, uint len) private pure returns(buffer memory) {\n if (len + off > buf.capacity) {\n resize(buf, (len + off) * 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) + off + len\n let dest := add(add(bufptr, off), len)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(add(off, len), mload(bufptr)) {\n mstore(bufptr, add(off, len))\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Writes a bytes20 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 off The offset to write at.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) {\n return write(buf, off, bytes32(data), 20);\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 write(buf, buf.buf.length, 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 write(buf, buf.buf.length, data, 32);\n }\n\n /**\n * @dev Writes an integer 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 off The offset to write at.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer, for chaining.\n */\n function writeInt(buffer memory buf, uint off, uint data, uint len) private pure returns(buffer memory) {\n if (len + off > buf.capacity) {\n resize(buf, (len + off) * 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 + off + sizeof(buffer length) + len\n let dest := add(add(bufptr, off), len)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(add(off, len), mload(bufptr)) {\n mstore(bufptr, add(off, len))\n }\n }\n return buf;\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 * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n return writeInt(buf, buf.buf.length, data, 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 */\n// TODO: Record inception time of any claimed name, so old proofs can't be used to revert changes to a name.\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 // A mapping of the most recent signatures seen for each claimed domain.\n mapping(bytes32 => uint32) public inceptions;\n\n error NoOwnerRecordFound();\n error StaleProof();\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 NewOracle(address oracle);\n event NewPublicSuffixList(address suffixes);\n\n constructor(\n DNSSEC _dnssec,\n PublicSuffixList _suffixes,\n ENS _ens\n ) {\n oracle = _dnssec;\n emit NewOracle(address(oracle));\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 require(\n msg.sender == owner,\n \"Only owner can call proveAndClaimWithResolver\"\n );\n if (addr != address(0)) {\n require(\n resolver != address(0),\n \"Cannot set addr if resolver is not set\"\n );\n // Set ourselves as the owner so we can set a record on the resolver\n ens.setSubnodeRecord(\n rootNode,\n labelHash,\n address(this),\n resolver,\n 0\n );\n bytes32 node = keccak256(abi.encodePacked(rootNode, labelHash));\n // Set the resolver record\n AddrResolver(resolver).setAddr(node, addr);\n // Transfer the record to the owner\n ens.setOwner(node, owner);\n } else {\n ens.setSubnodeRecord(rootNode, labelHash, owner, resolver, 0);\n }\n }\n\n function supportsInterface(bytes4 interfaceID)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IDNSRegistrar).interfaceId;\n }\n\n function _claim(bytes memory name, DNSSEC.RRSetWithSignature[] memory input)\n internal\n returns (\n bytes32 parentNode,\n bytes32 labelHash,\n address addr\n )\n {\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 // Parent name must be in the public suffix list.\n bytes memory parentName = name.substring(\n labelLen + 1,\n name.length - labelLen - 1\n );\n require(\n suffixes.isPublicSuffix(parentName),\n \"Parent name must be a public suffix\"\n );\n\n // Make sure the parent name is enabled\n parentNode = enableNode(parentName, 0);\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 (addr, ) = DNSClaimChecker.getOwnerAddress(name, data);\n\n emit Claim(node, addr, name, inception);\n }\n\n function enableNode(bytes memory domain, uint256 offset)\n internal\n returns (bytes32 node)\n {\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 require(\n owner == address(0) || owner == address(this),\n \"Cannot enable a name owned by someone else\"\n );\n if (owner != address(this)) {\n if (parentNode == bytes32(0)) {\n Root root = Root(ens.owner(bytes32(0)));\n root.setSubnodeOwner(label, address(this));\n } else {\n ens.setSubnodeOwner(parentNode, label, address(this));\n }\n }\n return node;\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" + }, + "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(bytes32 node, address owner)\n public\n virtual\n override\n authorised(node)\n {\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(bytes32 node, address resolver)\n public\n virtual\n override\n authorised(node)\n {\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(bytes32 node, uint64 ttl)\n public\n virtual\n override\n authorised(node)\n {\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(address operator, bool approved)\n external\n virtual\n override\n {\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(bytes32 node)\n public\n view\n virtual\n override\n returns (address)\n {\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(bytes32 node)\n public\n view\n virtual\n override\n returns (address)\n {\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(bytes32 node)\n public\n view\n virtual\n override\n returns (bool)\n {\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(address owner, address operator)\n external\n view\n virtual\n override\n returns (bool)\n {\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/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(bytes32 label, address owner)\n external\n onlyController\n {\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(bytes4 interfaceID)\n external\n pure\n returns (bool)\n {\n return interfaceID == INTERFACE_META_ID;\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(bytes32 => mapping(uint256 => bytes)) _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(bytes32 node, address a)\n external\n virtual\n authorised(node)\n {\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(bytes32 node)\n public\n view\n virtual\n override\n returns (address payable)\n {\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 _addresses[node][coinType] = a;\n }\n\n function addr(bytes32 node, uint256 coinType)\n public\n view\n virtual\n override\n returns (bytes memory)\n {\n return _addresses[node][coinType];\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(IAddrResolver).interfaceId ||\n interfaceID == type(IAddressResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n\n function bytesToAddress(bytes memory b)\n internal\n pure\n returns (address payable a)\n {\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/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/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/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(address owner, address operator)\n external\n view\n returns (bool);\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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 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 called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\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" + }, + "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" + }, + "@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" + }, + "contracts/resolvers/ResolverBase.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\nabstract contract ResolverBase is ERC165 {\n function isAuthorised(bytes32 node) internal view virtual returns (bool);\n\n modifier authorised(bytes32 node) {\n require(isAuthorised(node));\n _;\n }\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/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(bytes32 node, uint256 coinType)\n external\n view\n returns (bytes memory);\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" + }, + "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 */\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(RRSetWithSignature[] memory input)\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(RRSetWithSignature[] memory input, uint256 now)\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(RRUtils.SignedSet memory rrset, uint16 typecovered)\n internal\n pure\n returns (bytes memory name)\n {\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 (\n rrset.signerName.length > name.length ||\n !rrset.signerName.equals(\n 0,\n name,\n name.length - rrset.signerName.length\n )\n ) {\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 return\n algorithms[dnskey.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 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 }\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/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/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(bytes calldata data, bytes calldata hash)\n external\n pure\n virtual\n returns (bool);\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(hex'016201610000'.labelCount(0) == 2, \"labelCount('b.a.') == 2\");\n require(hex'066574686c61620378797a00'.labelCount(6 +1) == 1, \"nameLength('(bthlab).xyz.') == 6\");\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 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(RRUtils.RRIterator memory iter = rrs.iterateRRs(0); !iter.done(); iter.next()) {\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(keccak256(iter.name()) == keccak256(names[i]), \"Name matches\");\n require(keccak256(iter.rdata()) == keccak256(rdatas[i]), \"Rdata matches\");\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\n require(hex'0301616100'.compareNames(hex'0302616200') < 0, \"label lengths are correctly checked\");\n require(a_b_c.compareNames(c) > 0, \"one name has a difference of >1 label to with the same root name\");\n require(a_b_c.compareNames(d) < 0, \"one name has a difference of >1 label to with different root name\");\n require(a_b_c.compareNames(a_d_c) < 0, \"two names start the same but have differences in later labels\");\n require(a_b_c.compareNames(b_a_c) > 0, \"the first label sorts later, but the first label sorts earlier\");\n require(ab_c_d.compareNames(a_c_d) > 0, \"two names where the first label on one is a prefix of the first label on the other\");\n require(a_b_c.compareNames(b_b_c) < 0, \"two names where the first label on one is a prefix of the first label on the other\");\n require(xyz.compareNames(ethLabXyz) < 0, \"xyz comes before ethLab.xyz\");\n require(bthLabXyz.compareNames(ethLabXyz) < 0, \"bthLab.xyz comes before ethLab.xyz\");\n require(bthLabXyz.compareNames(bthLabXyz) == 0, \"bthLab.xyz and bthLab.xyz are the same\");\n require(ethLabXyz.compareNames(bthLabXyz) > 0, \"ethLab.xyz comes after bethLab.xyz\");\n require(bthLabXyz.compareNames(xyz) > 0, \"bthLab.xyz comes after xyz\");\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(RRUtils.serialNumberGte(0x11111111, 0xAAAAAAAA), \"0x11111111 >= 0xAAAAAAAA\");\n require(RRUtils.serialNumberGte(1, 1), \"1 >= 1\");\n }\n\n function testKeyTag() public view {\n require(hex'0101030803010001a80020a95566ba42e886bb804cda84e47ef56dbd7aec612615552cec906d2116d0ef207028c51554144dfeafe7c7cb8f005dd18234133ac0710a81182ce1fd14ad2283bc83435f9df2f6313251931a176df0da51e54f42e604860dfb359580250f559cc543c4ffd51cbe3de8cfd06719237f9fc47ee729da06835fa452e825e9a18ebc2ecbcf563474652c33cf56a9033bcdf5d973121797ec8089041b6e03a1b72d0a735b984e03687309332324f27c2dba85e9db15e83a0143382e974b0621c18e625ecec907577d9e7bade95241a81ebbe8a901d4d3276e40b114c0a2e6fc38d19c2e6aab02644b2813f575fc21601e0dee49cd9ee96a43103e524d62873d'.computeKeytag() == 19036, \"Invalid keytag\");\n require(hex'010003050440000003ba2fa05a75e173bede89eb71831ab14035f2408ad09df4d8dc8f8f72e8f13506feaddf7b04cb14958b82966e3420562302c4002bc4fd088432e160519bb14dae82443850c1423e06085710b5caf070d46b7ba7e481414f6a5fe225fdca984c959091645d0cf1c9a1a313d7e7fb7ba60b967b71a65f8cef2c3768e11b081c8fcf'.computeKeytag() == 21693, \"Invalid keytag (2)\");\n require(hex'0100030503010001bfa54c38d909fabb0f937d70d775ba0df4c0badb09707d995249406950407a621c794c68b186b15dbf8f9f9ea231e9f96414ccda4eceb50b17a9ac6c4bd4b95da04849e96ee791578b703bc9ae184fb1794bac792a0787f693a40f19f523ee6dbd3599dbaaa9a50437926ecf6438845d1d49448962524f2a1a7a36b3a0a1eca3'.computeKeytag() == 33630);\n require(hex'0101030803010001acffb409bcc939f831f7a1e5ec88f7a59255ec53040be432027390a4ce896d6f9086f3c5e177fbfe118163aaec7af1462c47945944c4e2c026be5e98bbcded25978272e1e3e079c5094d573f0e83c92f02b32d3513b1550b826929c80dd0f92cac966d17769fd5867b647c3f38029abdc48152eb8f207159ecc5d232c7c1537c79f4b7ac28ff11682f21681bf6d6aba555032bf6f9f036beb2aaa5b3778d6eebfba6bf9ea191be4ab0caea759e2f773a1f9029c73ecb8d5735b9321db085f1b8e2d8038fe2941992548cee0d67dd4547e11dd63af9c9fc1c5466fb684cf009d7197c2cf79e792ab501e6a8a1ca519af2cb9b5f6367e94c0d47502451357be1b5'.computeKeytag() == 20326, \"Invalid keytag (3)\");\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(\"\".keccak(0, 0) == bytes32(0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470), \"Incorrect hash of empty string\");\n require(\"foo\".keccak(0, 3) == bytes32(0x41b1a0649752af1b28b3dc29a1556eee781e4a4c3a1f7f53f90fa834de098c4d), \"Incorrect hash of 'foo'\");\n require(\"foo\".keccak(0, 0) == bytes32(0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470), \"Incorrect hash of empty string\");\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(\"hello\".equals(1, \"ello\") == true, \"Substring to string equality\");\n require(\"hello\".equals(1, \"jello\", 1, 4) == true, \"Substring to substring equality\");\n require(\"zhello\".equals(1, \"abchello\", 3) == true, \"Compare different value with multiple length\");\n }\n\n function testComparePartial() public pure {\n require(\"xax\".compare(1, 1, \"xxbxx\", 2, 1) < 0 == true, \"Compare same length\");\n require(\"xax\".compare(1, 1, \"xxabxx\", 2, 2) < 0 == true, \"Compare different length\");\n require(\"xax\".compare(1, 1, \"xxaxx\", 2, 1) == 0 == true, \"Compare same with different offset\");\n }\n\n function testCompare() public pure {\n require(\"a\".compare(\"a\") == 0 == true, \"Compare equal\");\n require(\"a\".compare(\"b\") < 0 == true, \"Compare different value with same length\");\n require(\"b\".compare(\"a\") > 0 == true, \"Compare different value with same length\");\n require(\"aa\".compare(\"ab\") < 0 == true, \"Compare different value with multiple length\");\n require(\"a\".compare(\"aa\") < 0 == true, \"Compare different value with different length\");\n require(\"aa\".compare(\"a\") > 0 == true, \"Compare different value with different length\");\n bytes memory longChar = \"1234567890123456789012345678901234\";\n require(longChar.compare(longChar) == 0 == true, \"Compares more than 32 bytes char\");\n bytes memory otherLongChar = \"2234567890123456789012345678901234\";\n require(longChar.compare(otherLongChar) < 0 == true, \"Compare long char with difference at start\");\n }\n\n function testSubstring() public pure {\n require(keccak256(bytes(\"hello\".substring(0, 0))) == keccak256(bytes(\"\")), \"Copy 0 bytes\");\n require(keccak256(bytes(\"hello\".substring(0, 4))) == keccak256(bytes(\"hell\")), \"Copy substring\");\n require(keccak256(bytes(\"hello\".substring(1, 4))) == keccak256(bytes(\"ello\")), \"Copy substring\");\n require(keccak256(bytes(\"hello\".substring(0, 5))) == keccak256(bytes(\"hello\")), \"Copy whole string\");\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(bytes32(\"abcdefghijklmnopqrstuv\".readBytes20(1)) == bytes32(0x62636465666768696a6b6c6d6e6f707172737475000000000000000000000000), \"readBytes20\");\n }\n\n function testReadBytes32() public pure {\n require(\"0123456789abcdef0123456789abcdef\".readBytes32(0) == bytes32(0x3031323334353637383961626364656630313233343536373839616263646566), \"readBytes32\");\n }\n\n function testBase32HexDecodeWord() public pure {\n require(\"C4\".base32HexDecodeWord(0, 2) == bytes32(bytes1(\"a\")), \"Decode 'a'\");\n require(\"C5GG\".base32HexDecodeWord(0, 4) == bytes32(bytes2(\"aa\")), \"Decode 'aa'\");\n require(\"C5GM2\".base32HexDecodeWord(0, 5) == bytes32(bytes3(\"aaa\")), \"Decode 'aaa'\");\n require(\"C5GM2O8\".base32HexDecodeWord(0, 7) == bytes32(bytes4(\"aaaa\")), \"Decode 'aaaa'\");\n require(\"C5GM2OB1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")), \"Decode 'aaaaa'\");\n require(\"c5gm2Ob1\".base32HexDecodeWord(0, 8) == bytes32(bytes5(\"aaaaa\")), \"Decode 'aaaaa' lowercase\");\n require(\"C5H66P35CPJMGQBADDM6QRJFE1ON4SRKELR7EU3PF8\".base32HexDecodeWord(0, 42) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")), \"Decode alphabet\");\n require(\"c5h66p35cpjmgqbaddm6qrjfe1on4srkelr7eu3pf8\".base32HexDecodeWord(0, 42) == bytes32(bytes26(\"abcdefghijklmnopqrstuvwxyz\")), \"Decode alphabet lowercase\");\n require(\"C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GM2OB1C5GG\".base32HexDecodeWord(0, 52) == bytes32(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"), \"Decode 32*'a'\");\n require(\" bst4hlje7r0o8c8p4o8q582lm0ejmiqt\\x07matoken\\x03xyz\\x00\".base32HexDecodeWord(1, 32) == bytes32(hex\"5f3a48d66e3ec18431192611a2a055b01d3b4b5d\"), \"Decode real bytes32hex\");\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(bytes calldata data, bytes calldata hash)\n external\n pure\n override\n returns (bool)\n {\n require(hash.length == 32, \"Invalid sha256 hash length\");\n return sha256(data) == hash.readBytes32(0);\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(bytes calldata data, bytes calldata hash)\n external\n pure\n override\n returns (bool)\n {\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" + }, + "@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" + }, + "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/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/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/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/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(bytes memory data)\n internal\n pure\n returns (uint256[2] memory)\n {\n require(data.length == 64, \"Invalid p256 signature length\");\n return [uint256(data.readBytes32(0)), uint256(data.readBytes32(32))];\n }\n\n function parseKey(bytes memory data)\n internal\n pure\n returns (uint256[2] memory)\n {\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/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(uint256 x0, uint256 y0)\n internal\n pure\n returns (uint256[3] memory P)\n {\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 (\n uint256 x,\n uint256 y,\n uint256 z\n )\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(uint256 x0, uint256 y0)\n internal\n pure\n returns (bool isZero)\n {\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 )\n internal\n pure\n returns (\n uint256 x1,\n uint256 y1,\n uint256 z1\n )\n {\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 )\n internal\n pure\n returns (\n uint256 x2,\n uint256 y2,\n uint256 z2\n )\n {\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 )\n private\n pure\n returns (\n uint256 x2,\n uint256 y2,\n uint256 z2\n )\n {\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(uint256 x0, uint256 y0)\n internal\n pure\n returns (uint256, uint256)\n {\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(uint256 scalar)\n internal\n pure\n returns (uint256, uint256)\n {\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/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/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(bytes calldata, bytes calldata)\n external\n pure\n override\n returns (bool)\n {\n return true;\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(bytes calldata name)\n external\n view\n override\n returns (bool)\n {\n uint256 labellen = name.readUint8(0);\n return labellen > 0 && name.readUint8(labellen + 1) == 0;\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(bytes calldata name)\n external\n view\n override\n returns (bool)\n {\n return suffixes[name];\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/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 (\n bytes memory key,\n bytes memory value,\n uint256 nextOffset\n )\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/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(bytes32 => bytes) private zonehashes;\n\n // Version the mapping for each zone. This allows users who have lost\n // track of their entries to effectively delete an entire zone by bumping\n // the version number.\n // node => version\n mapping(bytes32 => uint256) private versions;\n\n // The records themselves. Stored as binary RRSETs\n // node => version => name => resource => data\n mapping(bytes32 => mapping(uint256 => mapping(bytes32 => mapping(uint16 => bytes))))\n private 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(bytes32 => mapping(uint256 => mapping(bytes32 => uint16)))\n private 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(bytes32 node, bytes calldata data)\n external\n virtual\n authorised(node)\n {\n uint16 resource = 0;\n uint256 offset = 0;\n bytes memory name;\n bytes memory value;\n bytes32 nameHash;\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 );\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 );\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 records[node][versions[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(bytes32 node, bytes32 name)\n public\n view\n virtual\n returns (bool)\n {\n return (nameEntriesCount[node][versions[node]][name] != 0);\n }\n\n /**\n * Clear all information for a DNS zone.\n * @param node the namehash of the node for which to clear the zone\n */\n function clearDNSZone(bytes32 node) public virtual authorised(node) {\n versions[node]++;\n emit DNSZoneCleared(node);\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(bytes32 node, bytes calldata hash)\n external\n virtual\n authorised(node)\n {\n bytes memory oldhash = zonehashes[node];\n zonehashes[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(bytes32 node)\n external\n view\n virtual\n override\n returns (bytes memory)\n {\n return zonehashes[node];\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\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 ) private {\n uint256 version = versions[node];\n bytes32 nameHash = keccak256(name);\n bytes memory rrData = data.substring(offset, size);\n if (deleteRecord) {\n if (records[node][version][nameHash][resource].length != 0) {\n nameEntriesCount[node][version][nameHash]--;\n }\n delete (records[node][version][nameHash][resource]);\n emit DNSRecordDeleted(node, name, resource);\n } else {\n if (records[node][version][nameHash][resource].length == 0) {\n nameEntriesCount[node][version][nameHash]++;\n }\n records[node][version][nameHash][resource] = rrData;\n emit DNSRecordChanged(node, name, resource, rrData);\n }\n }\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 // DNSZoneCleared is emitted whenever a given node's zone information is cleared.\n event DNSZoneCleared(bytes32 indexed node);\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/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\";\n\ninterface INameWrapper {\n function ownerOf(uint256 id) external view returns (address);\n}\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{\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 // 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 constructor(\n ENS _ens,\n INameWrapper wrapperAddress,\n address _trustedETHController,\n address _trustedReverseRegistrar\n ) {\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(address account, address operator)\n public\n view\n returns (bool)\n {\n return _operatorApprovals[account][operator];\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 owner == msg.sender || isApprovedForAll(owner, msg.sender);\n }\n\n function supportsInterface(bytes4 interfaceID)\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/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(bytes32 => mapping(uint256 => bytes)) 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 abis[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(bytes32 node, uint256 contentTypes)\n external\n view\n virtual\n override\n returns (uint256, bytes memory)\n {\n mapping(uint256 => bytes) storage abiset = abis[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(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(IABIResolver).interfaceId ||\n super.supportsInterface(interfaceID);\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(bytes32 => bytes) 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(bytes32 node, bytes calldata hash)\n external\n virtual\n authorised(node)\n {\n hashes[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(bytes32 node)\n external\n view\n virtual\n override\n returns (bytes memory)\n {\n return hashes[node];\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(IContentHashResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\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(bytes32 => mapping(bytes4 => address)) 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 interfaces[node][interfaceID] = 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(bytes32 node, bytes4 interfaceID)\n external\n view\n virtual\n override\n returns (address)\n {\n address implementer = interfaces[node][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(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(IInterfaceResolver).interfaceId ||\n super.supportsInterface(interfaceID);\n }\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(bytes32 => string) 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(bytes32 node, string calldata newName)\n external\n virtual\n authorised(node)\n {\n names[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(bytes32 node)\n external\n view\n virtual\n override\n returns (string memory)\n {\n return names[node];\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\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(bytes32 => PublicKey) 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 pubkeys[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(bytes32 node)\n external\n view\n virtual\n override\n returns (bytes32 x, bytes32 y)\n {\n return (pubkeys[node].x, pubkeys[node].y);\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\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(bytes32 => mapping(string => string)) 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 texts[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(bytes32 node, string calldata key)\n external\n view\n virtual\n override\n returns (string memory)\n {\n return texts[node][key];\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(ITextResolver).interfaceId ||\n super.supportsInterface(interfaceID);\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(bytes32 nodehash, bytes[] calldata data)\n internal\n returns (bytes[] memory results)\n {\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(bytes32 nodehash, bytes[] calldata data)\n external\n returns (bytes[] memory results)\n {\n return _multicall(nodehash, data);\n }\n\n function multicall(bytes[] calldata data)\n public\n override\n returns (bytes[] memory results)\n {\n return _multicall(bytes32(0), data);\n }\n\n function supportsInterface(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceID == type(IMulticallable).interfaceId ||\n super.supportsInterface(interfaceID);\n }\n}\n" + }, + "contracts/resolvers/profiles/IABIResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"./IABIResolver.sol\";\nimport \"../ResolverBase.sol\";\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(bytes32 node, uint256 contentTypes)\n external\n view\n returns (uint256, bytes memory);\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/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(bytes32 node, bytes4 interfaceID)\n external\n view\n 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/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(bytes32 node, string calldata key)\n external\n view\n returns (string memory);\n}\n" + }, + "contracts/resolvers/IMulticallable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IMulticallable {\n function multicall(bytes[] calldata data)\n external\n returns (bytes[] memory results);\n\n function multicallWithNodeCheck(bytes32, bytes[] calldata data)\n external\n returns (bytes[] memory results);\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(bytes4 interfaceId)\n public\n view\n virtual\n override\n returns (bool)\n {\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, address) {\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 resolveCallback(bytes calldata response, bytes calldata extraData)\n external\n view\n returns (bytes memory)\n {\n require(\n keccak256(response) == keccak256(extraData),\n \"Response data error\"\n );\n return abi.encode(address(this));\n }\n}\n" + }, + "contracts/resolvers/profiles/IExtendedResolver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedResolver {\n function resolve(bytes memory name, bytes memory data)\n external\n view\n returns (bytes memory, address);\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 {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\";\n\nerror OffchainLookup(\n address sender,\n string[] urls,\n bytes callData,\n bytes4 callbackFunction,\n bytes extraData\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 IExtendedResolver, ERC165 {\n using Address for address;\n using NameEncoder for string;\n using BytesUtils for bytes;\n\n ENS public immutable registry;\n\n constructor(address _registry) {\n registry = ENS(_registry);\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(bytes calldata name, bytes memory data)\n external\n view\n override\n returns (bytes memory, address)\n {\n (Resolver resolver, ) = findResolver(name);\n if (address(resolver) == address(0)) {\n return (\"\", address(0));\n }\n\n try\n resolver.supportsInterface(type(IExtendedResolver).interfaceId)\n returns (bool supported) {\n if (supported) {\n return (\n callWithOffchainLookupPropagation(\n address(resolver),\n abi.encodeCall(IExtendedResolver.resolve, (name, data)),\n UniversalResolver.resolveCallback.selector\n ),\n address(resolver)\n );\n }\n } catch {}\n return (\n callWithOffchainLookupPropagation(\n address(resolver),\n data,\n UniversalResolver.resolveCallback.selector\n ),\n address(resolver)\n );\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(bytes calldata reverseName)\n external\n view\n returns (\n string memory,\n address,\n address,\n address\n )\n {\n (\n bytes memory resolvedReverseData,\n address reverseResolverAddress\n ) = this.resolve(\n reverseName,\n abi.encodeCall(INameResolver.name, reverseName.namehash(0))\n );\n\n string memory resolvedName = abi.decode(resolvedReverseData, (string));\n\n (bytes memory encodedName, bytes32 namehash) = resolvedName\n .dnsEncodeName();\n\n (bytes memory resolvedData, address resolverAddress) = this.resolve(\n encodedName,\n abi.encodeCall(IAddrResolver.addr, namehash)\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 supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n interfaceId == type(IExtendedResolver).interfaceId ||\n super.supportsInterface(interfaceId);\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 * @param callbackFunction The function ID of a function on this contract to use as an EIP 3668 callback.\n * This function's `extraData` argument will be passed `(address target, bytes4 innerCallback, bytes innerExtraData)`.\n * @return ret If `target` did not revert, contains the return data from the call to `target`.\n */\n function callWithOffchainLookupPropagation(\n address target,\n bytes memory data,\n bytes4 callbackFunction\n ) internal view returns (bytes memory ret) {\n bool result = LowLevelCallUtils.functionStaticCall(target, data);\n uint256 size = LowLevelCallUtils.returnDataSize();\n\n if (result) {\n return LowLevelCallUtils.readReturnData(0, size);\n }\n\n // Failure\n if (size >= 4) {\n bytes memory errorId = LowLevelCallUtils.readReturnData(0, 4);\n if (bytes4(errorId) == OffchainLookup.selector) {\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 (\n address sender,\n string[] memory urls,\n bytes memory callData,\n bytes4 innerCallbackFunction,\n bytes memory extraData\n ) = abi.decode(\n revertData,\n (address, string[], bytes, bytes4, bytes)\n );\n if (sender == target) {\n revert OffchainLookup(\n address(this),\n urls,\n callData,\n callbackFunction,\n abi.encode(sender, innerCallbackFunction, extraData)\n );\n }\n }\n }\n\n LowLevelCallUtils.propagateRevert();\n }\n\n /**\n * @dev Callback function for `resolve`.\n * @param response Response data returned by the target address that invoked the inner `OffchainData` revert.\n * @param extraData Extra data encoded by `callWithOffchainLookupPropagation` to allow completing the request.\n */\n function resolveCallback(bytes calldata response, bytes calldata extraData)\n external\n view\n returns (bytes memory)\n {\n (\n address target,\n bytes4 innerCallbackFunction,\n bytes memory innerExtraData\n ) = abi.decode(extraData, (address, bytes4, bytes));\n return\n abi.decode(\n target.functionStaticCall(\n abi.encodeWithSelector(\n innerCallbackFunction,\n response,\n innerExtraData\n )\n ),\n (bytes)\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 The Resolver responsible for this name, and the namehash of the full name.\n */\n function findResolver(bytes calldata name)\n public\n view\n returns (Resolver, bytes32)\n {\n (address resolver, bytes32 labelhash) = findResolver(name, 0);\n return (Resolver(resolver), labelhash);\n }\n\n function findResolver(bytes calldata name, uint256 offset)\n internal\n view\n returns (address, bytes32)\n {\n uint256 labelLength = uint256(uint8(name[offset]));\n if (labelLength == 0) {\n return (address(0), bytes32(0));\n }\n uint256 nextLabel = offset + labelLength + 1;\n bytes32 labelHash = keccak256(name[offset + 1:nextLabel]);\n (address parentresolver, bytes32 parentnode) = findResolver(\n name,\n nextLabel\n );\n bytes32 node = keccak256(abi.encodePacked(parentnode, labelHash));\n address resolver = registry.resolver(node);\n if (resolver != address(0)) {\n return (resolver, node);\n }\n return (parentresolver, node);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, \"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 require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(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 require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(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 require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason 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 // 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\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}\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(address target, bytes memory data)\n internal\n view\n returns (bool success)\n {\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(uint256 offset, uint256 length)\n internal\n pure\n returns (bytes memory data)\n {\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/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 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(\n bytes32 node,\n uint256 coinType,\n bytes calldata a\n ) 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(\n bytes32 node,\n bytes32 x,\n bytes32 y\n ) 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(bytes[] calldata data)\n external\n returns (bytes[] memory results);\n\n function multicallWithNodeCheck(bytes32 nodehash, bytes[] calldata data)\n external\n 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/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(string memory name)\n internal\n pure\n returns (bytes memory dnsName, bytes32 node)\n {\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/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(bytes memory self, uint256 offset)\n internal\n pure\n returns (bytes32)\n {\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(bytes memory self, uint256 idx)\n internal\n pure\n returns (bytes32 labelhash, uint256 newIdx)\n {\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/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(bytes calldata name, uint256 offset)\n public\n pure\n returns (bytes32, uint256)\n {\n return name.readLabel(offset);\n }\n\n function namehash(bytes calldata name, uint256 offset)\n public\n pure\n returns (bytes32)\n {\n return name.namehash(offset);\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(bytes4 interfaceID)\n external\n view\n override\n returns (bool)\n {\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/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\";\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 PARENT_CANNOT_CONTROL = 64;\nuint32 constant CAN_DO_EVERYTHING = 0;\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, 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 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 uint32 fuses,\n uint64 _expiry,\n address resolver\n ) external returns (uint64 expiry);\n\n function registerAndWrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint256 duration,\n address resolver,\n uint32 fuses,\n uint64 expiry\n ) external returns (uint256 registrarExpiry);\n\n function renew(\n uint256 labelHash,\n uint256 duration,\n uint32 fuses,\n uint64 expiry\n ) external returns (uint256 expires);\n\n function unwrap(\n bytes32 node,\n bytes32 label,\n address owner\n ) external;\n\n function unwrapETH2LD(\n bytes32 label,\n address newRegistrant,\n address newController\n ) external;\n\n function setFuses(bytes32 node, uint32 fuses)\n external\n 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 isTokenOwnerOrApproved(bytes32 node, address addr)\n external\n 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 returns (address owner);\n\n function allFusesBurned(bytes32 node, uint32 fuseMask)\n external\n view\n returns (bool);\n\n function isWrapped(bytes32 node) external view returns (bool);\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" + }, + "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 iff 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" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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 be 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" + }, + "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" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\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 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 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 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 /**\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" + }, + "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(bytes4 interfaceId)\n public\n view\n virtual\n override(ERC165, IERC165)\n returns (bool)\n {\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" + }, + "contracts/wrapper/NameWrapper.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport {ERC1155Fuse, IERC165, OperationProhibited} 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, PARENT_CANNOT_CONTROL, CAN_DO_EVERYTHING} from \"./INameWrapper.sol\";\nimport {INameWrapperUpgrade} from \"./INameWrapperUpgrade.sol\";\nimport {IMetadataService} from \"./IMetadataService.sol\";\nimport {ENS} from \"../registry/ENS.sol\";\nimport {IBaseRegistrar} from \"../ethregistrar/IBaseRegistrar.sol\";\nimport {IERC721Receiver} from \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.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 NameNotFound();\nerror IncompatibleParent();\nerror IncompatibleName(bytes name);\nerror IncorrectTokenType();\nerror LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);\nerror LabelTooShort();\nerror LabelTooLong(string label);\nerror IncorrectTargetOwner(address owner);\nerror CannotUpgrade();\n\ncontract NameWrapper is\n Ownable,\n ERC1155Fuse,\n INameWrapper,\n Controllable,\n IERC721Receiver,\n ERC20Recoverable\n{\n using BytesUtils for bytes;\n ENS public immutable override ens;\n IBaseRegistrar public immutable override registrar;\n IMetadataService public override metadataService;\n mapping(bytes32 => bytes) public override names;\n\n bytes32 private constant ETH_NODE =\n 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;\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 ) {\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 */\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(bytes4 interfaceId)\n public\n view\n virtual\n override(ERC1155Fuse, IERC165)\n returns (bool)\n {\n return\n interfaceId == type(INameWrapper).interfaceId ||\n interfaceId == type(IERC721Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /* ERC1155 */\n\n function ownerOf(uint256 id)\n public\n view\n override(ERC1155Fuse, INameWrapper)\n returns (address owner)\n {\n return super.ownerOf(id);\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(IMetadataService _metadataService)\n public\n onlyOwner\n {\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(uint256 tokenId) public view override returns (string memory) {\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(INameWrapperUpgrade _upgradeAddress)\n public\n onlyOwner\n {\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 approved by the owner of a name\n * @param node namehash of the name to check\n */\n\n modifier onlyTokenOwner(bytes32 node) {\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n _;\n }\n\n /**\n * @notice Checks if owner 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 or approved\n */\n\n function isTokenOwnerOrApproved(bytes32 node, address addr)\n public\n view\n override\n returns (bool)\n {\n address owner = ownerOf(uint256(node));\n return owner == addr || isApprovedForAll(owner, addr);\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 fuses Initial fuses to set\n * @param expiry When the fuses will expire\n * @param resolver Resolver contract address\n * @return Normalised expiry of when the fuses expire\n */\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) public override returns (uint64) {\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 return _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);\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 fuses Initial fuses to set\n * @param expiry When the fuses will expire\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 uint32 fuses,\n uint64 expiry\n ) external override onlyController returns (uint256 registrarExpiry) {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n registrarExpiry = registrar.register(tokenId, address(this), duration);\n _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);\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 uint32 fuses,\n uint64 expiry\n ) external override onlyController returns (uint256 expires) {\n bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));\n\n expires = registrar.renew(tokenId, duration);\n (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n expiry = _normaliseExpiry(expiry, oldExpiry, uint64(expires));\n\n _setData(node, owner, oldFuses | fuses | PARENT_CANNOT_CONTROL, expiry);\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 override {\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 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 override onlyTokenOwner(_makeNode(ETH_NODE, labelhash)) {\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 override onlyTokenOwner(_makeNode(parentNode, labelhash)) {\n if (parentNode == ETH_NODE) {\n revert IncompatibleParent();\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 fuses Fuses to burn (cannot burn PARENT_CANNOT_CONTROL)\n * @return New fuses\n */\n\n function setFuses(bytes32 node, uint32 fuses)\n public\n onlyTokenOwner(node)\n operationAllowed(node, CANNOT_BURN_FUSES)\n returns (uint32)\n {\n _checkForParentCannotControl(node, fuses);\n\n (address owner, uint32 oldFuses, uint64 expiry) = getData(\n uint256(node)\n );\n\n fuses |= oldFuses;\n _setFuses(node, owner, fuses, expiry);\n return fuses;\n }\n\n /**\n * @notice Upgrades a .eth wrapped domain by calling the wrapETH2LD function of the upgradeContract\n * and burning the token of this contract\n * @dev Can be called by the owner of the name in this contract\n * @param label Label as a string of the .eth name to upgrade\n * @param wrappedOwner The owner of the wrapped name\n */\n\n function upgradeETH2LD(\n string calldata label,\n address wrappedOwner,\n address resolver\n ) public {\n bytes32 labelhash = keccak256(bytes(label));\n bytes32 node = _makeNode(ETH_NODE, labelhash);\n (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);\n\n upgradeContract.wrapETH2LD(\n label,\n wrappedOwner,\n fuses,\n expiry,\n resolver\n );\n }\n\n /**\n * @notice Upgrades 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 or an authorised caller\n * Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names\n * @param parentNode Namehash of the parent name\n * @param label Label as a string of the name to upgrade\n * @param wrappedOwner Owner of the name in this contract\n * @param resolver Resolver contract for this name\n */\n\n function upgrade(\n bytes32 parentNode,\n string calldata label,\n address wrappedOwner,\n address resolver\n ) public {\n bytes32 labelhash = keccak256(bytes(label));\n bytes32 node = _makeNode(parentNode, labelhash);\n (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);\n upgradeContract.setSubnodeRecord(\n parentNode,\n label,\n wrappedOwner,\n resolver,\n 0,\n fuses,\n expiry\n );\n }\n\n /** \n /* @notice Sets fuses of a name that you own the parent of. Can also be called by the owner of a .eth 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 fuses Fuses to burn\n * @param expiry When the fuses will expire\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 (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(\n uint256(node)\n );\n uint64 maxExpiry;\n (, uint32 parentFuses, uint64 parentExpiry) = getData(\n uint256(parentNode)\n );\n if (parentNode == ETH_NODE) {\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n // max expiry is set to the expiry on the registrar\n maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));\n } else {\n if (!isTokenOwnerOrApproved(parentNode, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n // max expiry is set to the expiry of the parent\n maxExpiry = parentExpiry;\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, 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 fuses will expire\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 )\n public\n onlyTokenOwner(parentNode)\n canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))\n returns (bytes32 node)\n {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\n expiry = _checkParentFusesAndExpiry(parentNode, node, fuses, expiry);\n\n if (!isWrapped(node)) {\n ens.setSubnodeOwner(parentNode, labelhash, address(this));\n _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);\n } else {\n _addLabelSetFusesAndTransfer(\n parentNode,\n node,\n label,\n owner,\n fuses,\n expiry\n );\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 regsitry\n * @param fuses initial fuses for the wrapped subdomain\n * @param expiry expiry date for the domain\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 )\n public\n onlyTokenOwner(parentNode)\n canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))\n returns (bytes32 node)\n {\n bytes32 labelhash = keccak256(bytes(label));\n node = _makeNode(parentNode, labelhash);\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 _addLabelAndWrap(parentNode, node, label, owner, fuses, expiry);\n } else {\n ens.setSubnodeRecord(\n parentNode,\n labelhash,\n address(this),\n resolver,\n ttl\n );\n _addLabelSetFusesAndTransfer(\n parentNode,\n node,\n label,\n owner,\n fuses,\n expiry\n );\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 override\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 (address oldOwner, , ) = getData(uint256(node));\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\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(bytes32 node, address resolver)\n public\n override\n onlyTokenOwner(node)\n operationAllowed(node, CANNOT_SET_RESOLVER)\n {\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(bytes32 node, uint64 ttl)\n public\n override\n onlyTokenOwner(node)\n operationAllowed(node, CANNOT_SET_TTL)\n {\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 node Namehash of the name to check\n * @param labelhash Labelhash of the name to check\n */\n\n modifier canCallSetSubnodeOwner(bytes32 node, bytes32 labelhash) {\n bytes32 subnode = _makeNode(node, labelhash);\n address owner = ens.owner(subnode);\n\n if (owner == address(0)) {\n (, uint32 fuses, ) = getData(uint256(node));\n if (fuses & CANNOT_CREATE_SUBDOMAIN != 0) {\n revert OperationProhibited(subnode);\n }\n } else {\n (, uint32 subnodeFuses, ) = getData(uint256(subnode));\n if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {\n revert OperationProhibited(subnode);\n }\n }\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(bytes32 node, uint32 fuseMask)\n public\n view\n override\n returns (bool)\n {\n (, uint32 fuses, ) = getData(uint256(node));\n return fuses & fuseMask == fuseMask;\n }\n\n /**\n * @notice Checks if a name is wrapped or not\n * @dev Both of these checks need to be true to be considered wrapped if checked without this contract\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 override returns (bool) {\n return\n ownerOf(uint256(node)) != address(0) &&\n ens.owner(node) == address(this);\n }\n\n function onERC721Received(\n address to,\n address,\n uint256 tokenId,\n bytes calldata data\n ) public override 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 uint32 fuses,\n uint64 expiry,\n address resolver\n ) = abi.decode(data, (string, address, uint32, uint64, 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 _wrapETH2LD(label, owner, fuses, expiry, resolver);\n\n return IERC721Receiver(to).onERC721Received.selector;\n }\n\n /***** Internal functions */\n\n function _canTransfer(uint32 fuses) internal pure override returns (bool) {\n return fuses & CANNOT_TRANSFER == 0;\n }\n\n function _makeNode(bytes32 node, bytes32 labelhash)\n private\n pure\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(node, labelhash));\n }\n\n function _addLabel(string memory label, bytes memory name)\n internal\n pure\n returns (bytes memory ret)\n {\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 = ownerOf(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 names[node] = name;\n _mint(node, wrappedOwner, fuses, expiry);\n emit NameWrapped(node, name, wrappedOwner, fuses, expiry);\n }\n\n function _addLabelAndWrap(\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 _prepareUpgrade(bytes32 node)\n private\n returns (uint32 fuses, uint64 expiry)\n {\n if (address(upgradeContract) == address(0)) {\n revert CannotUpgrade();\n }\n\n if (!isTokenOwnerOrApproved(node, msg.sender)) {\n revert Unauthorised(node, msg.sender);\n }\n\n (, fuses, expiry) = getData(uint256(node));\n\n // burn token and fuse data\n _burn(uint256(node));\n }\n\n function _addLabelSetFusesAndTransfer(\n bytes32 parentNode,\n bytes32 node,\n string memory label,\n address owner,\n uint32 fuses,\n uint64 expiry\n ) internal {\n address oldOwner = ownerOf(uint256(node));\n bytes memory name = _addLabel(label, names[parentNode]);\n if (names[node].length == 0) {\n names[node] = name;\n }\n _setFuses(node, oldOwner, fuses, expiry);\n _transfer(oldOwner, owner, uint256(node), 1, \"\");\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 isBurningPCC = fuses & PARENT_CANNOT_CONTROL ==\n PARENT_CANNOT_CONTROL;\n\n bool parentHasNotBurnedCU = parentFuses & CANNOT_UNWRAP == 0;\n\n if (isBurningPCC && parentHasNotBurnedCU) {\n revert OperationProhibited(node);\n }\n }\n\n function _getETH2LDDataAndNormaliseExpiry(\n bytes32 node,\n bytes32 labelhash,\n uint64 expiry\n )\n internal\n view\n returns (\n address owner,\n uint32 fuses,\n uint64\n )\n {\n uint64 oldExpiry;\n (owner, fuses, oldExpiry) = getData(uint256(node));\n uint64 maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));\n\n expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);\n return (owner, fuses, expiry);\n }\n\n function _normaliseExpiry(\n uint64 expiry,\n uint64 oldExpiry,\n uint64 maxExpiry\n ) internal 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 returns (uint64) {\n // Mint a new ERC1155 token with fuses\n // Set PARENT_CANNOT_REPLACE to reflect wrapper + registrar control over the 2LD\n bytes32 labelhash = keccak256(bytes(label));\n bytes32 node = _makeNode(ETH_NODE, labelhash);\n uint32 oldFuses;\n\n (, oldFuses, expiry) = _getETH2LDDataAndNormaliseExpiry(\n node,\n labelhash,\n expiry\n );\n\n _addLabelAndWrap(\n ETH_NODE,\n node,\n label,\n wrappedOwner,\n fuses | PARENT_CANNOT_CONTROL,\n expiry\n );\n if (resolver != address(0)) {\n ens.setResolver(node, resolver);\n }\n\n return expiry;\n }\n\n function _unwrap(bytes32 node, address owner) private {\n if (owner == address(0x0) || owner == address(this)) {\n revert IncorrectTargetOwner(owner);\n }\n\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 expiry\n ) internal {\n _setData(node, owner, fuses, expiry);\n emit FusesSet(node, fuses, expiry);\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 (\n fuses & ~PARENT_CANNOT_CONTROL != 0 &&\n fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=\n (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)\n ) {\n revert OperationProhibited(node);\n }\n }\n\n function _checkForParentCannotControl(bytes32 node, uint32 fuses)\n internal\n view\n {\n if (fuses & PARENT_CANNOT_CONTROL != 0) {\n // Only the parent can burn the PARENT_CANNOT_CONTROL fuse.\n revert Unauthorised(node, msg.sender);\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 _canTransfer 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\nerror OperationProhibited(bytes32 node);\n\nabstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n mapping(uint256 => uint256) public _tokens;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\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 {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(ERC165, IERC165)\n returns (bool)\n {\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(address account, uint256 id)\n public\n view\n virtual\n override\n returns (uint256)\n {\n require(\n account != address(0),\n \"ERC1155: balance query for the zero address\"\n );\n (address owner, , ) = getData(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(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\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(address operator, bool approved)\n public\n virtual\n override\n {\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(address account, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev Returns the Name's owner address and fuses\n */\n function getData(uint256 tokenId)\n public\n view\n returns (\n address owner,\n uint32 fuses,\n uint64 expiry\n )\n {\n uint256 t = _tokens[tokenId];\n owner = address(uint160(t));\n expiry = uint64(t >> 192);\n if (block.timestamp > expiry) {\n fuses = 0;\n } else {\n fuses = uint32(t >> 160);\n }\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 expiration) = getData(id);\n\n if (!_canTransfer(fuses)) {\n revert OperationProhibited(bytes32(id));\n }\n\n require(\n amount == 1 && oldOwner == from,\n \"ERC1155: insufficient balance for transfer\"\n );\n _setData(id, to, fuses, expiration);\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 _canTransfer(uint32 fuses) internal virtual returns (bool);\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 if (oldExpiry > expiry) {\n expiry = oldExpiry;\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 | oldFuses, 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 owner, uint32 fuses, uint64 expiry) = getData(tokenId);\n // Fuses and expiry are kept on burn\n _setData(tokenId, address(0x0), fuses, expiry);\n emit TransferSingle(msg.sender, owner, 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 if (!_canTransfer(fuses)) {\n revert OperationProhibited(bytes32(id));\n }\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" + }, + "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/INameWrapperUpgrade.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface INameWrapperUpgrade {\n function setSubnodeRecord(\n bytes32 parentNode,\n string calldata label,\n address owner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n ) external;\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) external;\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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 `IERC721.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" + }, + "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" + }, + "@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/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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 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 /**\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" + }, + "@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/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/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, _allowances[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 = _allowances[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 `sender` to `recipient`.\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 }\n _balances[to] += amount;\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 _balances[account] += amount;\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 }\n _totalSupply -= amount;\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 Spend `amount` form the allowance of `owner` toward `spender`.\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/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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: balance query for the zero address\");\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 = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\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 require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\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 overriden 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 owner nor 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 require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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 require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\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);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\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);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {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 a {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 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 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\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` 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 tokenId\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.\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 tokenId\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/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\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 // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\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 if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\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] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\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\";\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{\n function isAuthorised(bytes32) internal view override returns (bool) {\n return msg.sender == owner();\n }\n\n function supportsInterface(bytes4 interfaceID)\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/ethregistrar/StablePriceOracle.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\nimport \"./SafeMath.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 SafeMath for *;\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(bytes4 interfaceID)\n public\n view\n virtual\n returns (bool)\n {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IPriceOracle).interfaceId;\n }\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/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/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/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(uint256 expires, uint256 amount)\n external\n view\n returns (uint256)\n {\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(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return\n (interfaceID == TIME_UNTIL_PREMIUM_ID) ||\n super.supportsInterface(interfaceID);\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 {ReverseRegistrar} from \"../registry/ReverseRegistrar.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{\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 ) {\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(string memory name, uint256 duration)\n public\n view\n override\n returns (IPriceOracle.Price memory price)\n {\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 uint32 fuses,\n uint64 wrapperExpiry\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 resolver,\n data,\n secret,\n reverseRecord,\n fuses,\n wrapperExpiry\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 uint32 fuses,\n uint64 wrapperExpiry\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 fuses,\n wrapperExpiry\n )\n );\n\n uint256 expires = nameWrapper.registerAndWrapETH2LD(\n name,\n owner,\n duration,\n resolver,\n fuses,\n wrapperExpiry\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(string calldata name, uint256 duration)\n external\n payable\n override\n {\n _renew(name, duration, 0, 0);\n }\n\n function renewWithFuses(\n string calldata name,\n uint256 duration,\n uint32 fuses,\n uint64 wrapperExpiry\n ) external payable {\n bytes32 labelhash = keccak256(bytes(name));\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, labelhash));\n if (!nameWrapper.isTokenOwnerOrApproved(nodehash, msg.sender)) {\n revert Unauthorised(nodehash);\n }\n _renew(name, duration, fuses, wrapperExpiry);\n }\n\n function _renew(\n string calldata name,\n uint256 duration,\n uint32 fuses,\n uint64 wrapperExpiry\n ) internal {\n bytes32 labelhash = keccak256(bytes(name));\n bytes32 nodehash = keccak256(abi.encodePacked(ETH_NODE, labelhash));\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;\n if (nameWrapper.isWrapped(nodehash)) {\n expires = nameWrapper.renew(\n tokenId,\n duration,\n fuses,\n wrapperExpiry\n );\n } else {\n expires = base.renew(tokenId, duration);\n }\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(bytes4 interfaceID)\n external\n pure\n returns (bool)\n {\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/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(address spender, uint256 tokenId)\n internal\n view\n override\n returns (bool)\n {\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(uint256 tokenId)\n public\n view\n override(IERC721, ERC721)\n returns (address)\n {\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(uint256 id, uint256 duration)\n external\n override\n live\n onlyController\n returns (uint256)\n {\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(bytes4 interfaceID)\n public\n view\n override(ERC721, IERC165)\n returns (bool)\n {\n return\n interfaceID == INTERFACE_META_ID ||\n interfaceID == ERC721_ID ||\n interfaceID == RECLAIM_ID;\n }\n}\n" + }, + "contracts/registry/ReverseRegistrar.sol": { + "content": "pragma solidity >=0.8.4;\n\nimport \"./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(address owner, address resolver)\n public\n override\n returns (bytes32)\n {\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/ethregistrar/IETHRegistrarController.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\nimport \"./IPriceOracle.sol\";\n\ninterface IETHRegistrarController {\n function rentPrice(string memory, uint256)\n external\n 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 uint32,\n uint64\n ) external 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 uint32,\n uint64\n ) external payable;\n\n function renew(string calldata, uint256) external payable;\n}\n" + }, + "contracts/registry/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(address owner, address resolver)\n external\n 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/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(string[] calldata names, uint256 duration)\n external\n view\n override\n returns (uint256 total)\n {\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(string[] calldata names, uint256 duration)\n external\n payable\n override\n {\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(bytes4 interfaceID)\n external\n pure\n returns (bool)\n {\n return\n interfaceID == type(IERC165).interfaceId ||\n interfaceID == type(IBulkRenewal).interfaceId;\n }\n}\n" + }, + "contracts/ethregistrar/IBulkRenewal.sol": { + "content": "interface IBulkRenewal {\n function rentPrice(string[] calldata names, uint256 duration)\n external\n view\n returns (uint256 total);\n\n function renewAll(string[] calldata names, uint256 duration)\n external\n payable;\n}\n" + }, + "contracts/wrapper/mocks/UpgradedNameWrapperMock.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\nimport \"../INameWrapper.sol\";\nimport \"../../registry/ENS.sol\";\nimport \"../../ethregistrar/IBaseRegistrar.sol\";\n\ncontract UpgradedNameWrapperMock {\n address public immutable oldNameWrapper;\n ENS public immutable ens;\n IBaseRegistrar public immutable registrar;\n\n constructor(\n address _oldNameWrapper,\n ENS _ens,\n IBaseRegistrar _registrar\n ) {\n oldNameWrapper = _oldNameWrapper;\n ens = _ens;\n registrar = _registrar;\n }\n\n event SetSubnodeRecord(\n bytes32 parentNode,\n string label,\n address newOwner,\n address resolver,\n uint64 ttl,\n uint32 fuses,\n uint64 expiry\n );\n\n event WrapETH2LD(\n string label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n );\n\n function wrapETH2LD(\n string calldata label,\n address wrappedOwner,\n uint32 fuses,\n uint64 expiry,\n address resolver\n ) public {\n uint256 tokenId = uint256(keccak256(bytes(label)));\n address registrant = registrar.ownerOf(tokenId);\n registrar.transferFrom(registrant, address(this), tokenId);\n registrar.reclaim(tokenId, address(this));\n require(\n registrant == msg.sender ||\n registrar.isApprovedForAll(registrant, msg.sender),\n \"Unauthorised\"\n );\n emit WrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);\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 labelhash = keccak256(bytes(label));\n bytes32 node = keccak256(abi.encodePacked(parentNode, labelhash));\n address owner = ens.owner(node);\n require(\n msg.sender == oldNameWrapper ||\n owner == msg.sender ||\n ens.isApprovedForAll(owner, msg.sender),\n \"Not owner/approved or previous nameWrapper controller\"\n );\n ens.setOwner(node, address(this));\n emit SetSubnodeRecord(\n parentNode,\n label,\n newOwner,\n resolver,\n ttl,\n fuses,\n expiry\n );\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/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/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/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(uint256 startPremium, uint256 elapsed)\n public\n pure\n returns (uint256)\n {\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(uint256 fraction, uint256 premium)\n internal\n pure\n returns (uint256)\n {\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(bytes4 interfaceID)\n public\n view\n virtual\n override\n returns (bool)\n {\n return super.supportsInterface(interfaceID);\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" + }, + "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/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(string memory name)\n public\n pure\n returns (bytes memory, bytes32)\n {\n return name.dnsEncodeName();\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file