@cubed/coreid-util
Version:
coreid util
2,662 lines • 61.5 kB
JavaScript
var I = Object.defineProperty;
var A = (t, e, n) => e in t ? I(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var i = (t, e, n) => (A(t, typeof e != "symbol" ? e + "" : e, n), n);
import { sign as f, format as u, Conflux as C, address as x } from "js-conflux-sdk";
import { Buffer as l } from "buffer";
import M from "bignumber.js";
const N = {
// TODO
mainnet: {
CNS_REGISTRY: "",
REVERSE_REGISTRAR: "",
BASE_REGISTRAR: "",
NAME_WRAPPER: "",
WEB3_CONTROLLER: "",
PUBLIC_RESOLVER: "",
REVERSE_RECORDS: "",
UTIL: "",
MULTICALL: "cfx:achfcd4z000fw2977dz09z8nat38wxbfrynkxpe15v"
},
// come from: https://web3-username.gitbook.io/.web3-username-docs/deployment#testnet
testnet: {
CNS_REGISTRY: "cfxtest:acemru7fu1u8brtyn3hrtae17kbcd4pd9u2m761bta",
REVERSE_REGISTRAR: "cfxtest:acfarpzehntpre0thg8x7dp0ajw4ms328pe1mm17vd",
BASE_REGISTRAR: "cfxtest:acg08bujp0kmsup1zk11c9mad7zd6648eynbcjtndm",
NAME_WRAPPER: "cfxtest:acapc3y2j7atme3bawvaex18hs36tn40uu5h6j3mtu",
WEB3_CONTROLLER: "cfxtest:aca1858y5a9fnyx9rxd1c9knr517cd0e6afzzhgj01",
REVERSE_RECORDS: "cfxtest:acgddsj3kah2f4f4c6959bvc4732f4juyj90h0zmg2",
UTIL: "cfxtest:aca4w63ypgup8tryphprzfcrh5kh0hpbgasb2z3s0j",
MULTICALL: "cfxtest:acexk57dcp2gcaydnyyz615b1993c319uup08gwwzs"
}
}, S = [
"CNS_REGISTRY",
"REVERSE_REGISTRAR",
"BASE_REGISTRAR",
"NAME_WRAPPER",
"WEB3_CONTROLLER",
"REVERSE_RECORDS",
"UTIL",
"MULTICALL"
], m = {
CNS_REGISTRY: ["controller"],
REVERSE_REGISTRAR: [""],
BASE_REGISTRAR: ["nameExpires"],
NAME_WRAPPER: ["ownerOf", "getData", "userDomains"],
WEB3_CONTROLLER: ["status"],
UTIL: ["address", "parent", "registrant"],
REVERSE_RECORDS: ["name", "names"],
MULTICALL: ["aggregate"]
}, L = {
address: "addr(bytes32)",
name: "getNames(address[])",
names: "getNames(address[])",
status: "labelStatus",
registrant: "ownerOf",
parent: "addr(bytes32)",
controller: "owner"
}, D = {
mainnet: 1029,
testnet: 1
}, k = {
mainnet: "https://main.confluxrpc.com",
testnet: "https://test.confluxrpc.com"
}, b = "testnet", B = Object.keys(m).reduce((t, e) => (m[e].forEach((n) => n && (t[n] = e)), t), {}), W = Object.keys(m).reduce((t, e) => t.concat(m[e]), []).filter((t) => !!t);
var w;
(function(t) {
t[t.Valid = 0] = "Valid", t[t.TooShort = 1] = "TooShort", t[t.Reserved = 2] = "Reserved", t[t.IllegalChar = 3] = "IllegalChar", t[t.Locked = 4] = "Locked", t[t.Registered = 5] = "Registered", t[t.SoldOut = 6] = "SoldOut";
})(w || (w = {}));
const P = [
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "operator",
type: "address"
},
{
indexed: !1,
internalType: "bool",
name: "approved",
type: "bool"
}
],
name: "ApprovalForAll",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !0,
internalType: "bytes32",
name: "label",
type: "bytes32"
},
{
indexed: !1,
internalType: "address",
name: "owner",
type: "address"
}
],
name: "NewOwner",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "address",
name: "resolver",
type: "address"
}
],
name: "NewResolver",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "uint64",
name: "ttl",
type: "uint64"
}
],
name: "NewTTL",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "address",
name: "owner",
type: "address"
}
],
name: "Transfer",
type: "event"
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "address",
name: "operator",
type: "address"
}
],
name: "isApprovedForAll",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
}
],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
}
],
name: "recordExists",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
}
],
name: "resolver",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "operator",
type: "address"
},
{
internalType: "bool",
name: "approved",
type: "bool"
}
],
name: "setApprovalForAll",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "address",
name: "owner",
type: "address"
}
],
name: "setOwner",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "address",
name: "resolver",
type: "address"
},
{
internalType: "uint64",
name: "ttl",
type: "uint64"
}
],
name: "setRecord",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "address",
name: "resolver",
type: "address"
}
],
name: "setResolver",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "bytes32",
name: "label",
type: "bytes32"
},
{
internalType: "address",
name: "owner",
type: "address"
}
],
name: "setSubnodeOwner",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "bytes32",
name: "label",
type: "bytes32"
},
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "address",
name: "resolver",
type: "address"
},
{
internalType: "uint64",
name: "ttl",
type: "uint64"
}
],
name: "setSubnodeRecord",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
internalType: "uint64",
name: "ttl",
type: "uint64"
}
],
name: "setTTL",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32"
}
],
name: "ttl",
outputs: [
{
internalType: "uint64",
name: "",
type: "uint64"
}
],
stateMutability: "view",
type: "function"
}
], F = [
{
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: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "account",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "operator",
type: "address"
},
{
indexed: !1,
internalType: "bool",
name: "approved",
type: "bool"
}
],
name: "ApprovalForAll",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "controller",
type: "address"
},
{
indexed: !1,
internalType: "bool",
name: "active",
type: "bool"
}
],
name: "ControllerChanged",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "uint32",
name: "fuses",
type: "uint32"
},
{
indexed: !1,
internalType: "uint64",
name: "expiry",
type: "uint64"
}
],
name: "FusesSet",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !1,
internalType: "uint8",
name: "version",
type: "uint8"
}
],
name: "Initialized",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "address",
name: "owner",
type: "address"
}
],
name: "NameUnwrapped",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "bytes32",
name: "node",
type: "bytes32"
},
{
indexed: !1,
internalType: "bytes",
name: "name",
type: "bytes"
},
{
indexed: !1,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !1,
internalType: "uint32",
name: "fuses",
type: "uint32"
},
{
indexed: !1,
internalType: "uint64",
name: "expiry",
type: "uint64"
}
],
name: "NameWrapped",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "previousOwner",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "newOwner",
type: "address"
}
],
name: "OwnershipTransferred",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "operator",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "from",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "to",
type: "address"
},
{
indexed: !1,
internalType: "uint256[]",
name: "ids",
type: "uint256[]"
},
{
indexed: !1,
internalType: "uint256[]",
name: "values",
type: "uint256[]"
}
],
name: "TransferBatch",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "operator",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "from",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "to",
type: "address"
},
{
indexed: !1,
internalType: "uint256",
name: "id",
type: "uint256"
},
{
indexed: !1,
internalType: "uint256",
name: "value",
type: "uint256"
}
],
name: "TransferSingle",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !1,
internalType: "string",
name: "value",
type: "string"
},
{
indexed: !0,
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: "id",
type: "uint256"
}
],
name: "getData",
outputs: [
{
internalType: "address",
name: "",
type: "address"
},
{
internalType: "uint32",
name: "",
type: "uint32"
},
{
internalType: "uint64",
name: "",
type: "uint64"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "contract ENS",
name: "_ens",
type: "address"
},
{
internalType: "contract IBaseRegistrar",
name: "_registrar",
type: "address"
},
{
internalType: "contract IMetadataService",
name: "_metadataService",
type: "address"
}
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
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: [],
name: "name",
outputs: [
{
internalType: "string",
name: "",
type: "string"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
name: "names",
outputs: [
{
internalType: "bytes",
name: "",
type: "bytes"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "to",
type: "address"
},
{
internalType: "address",
name: "",
type: "address"
},
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
},
{
internalType: "bytes",
name: "data",
type: "bytes"
}
],
name: "onERC721Received",
outputs: [
{
internalType: "bytes4",
name: "",
type: "bytes4"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
}
],
name: "ownerOf",
outputs: [
{
internalType: "address",
name: "owner",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "_token",
type: "address"
},
{
internalType: "address",
name: "_to",
type: "address"
},
{
internalType: "uint256",
name: "_amount",
type: "uint256"
}
],
name: "recoverFunds",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "string",
name: "label",
type: "string"
},
{
internalType: "address",
name: "wrappedOwner",
type: "address"
},
{
internalType: "uint256",
name: "duration",
type: "uint256"
},
{
internalType: "address",
name: "resolver",
type: "address"
},
{
internalType: "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: "address",
name: "user",
type: "address"
}
],
name: "userDomains",
outputs: [
{
internalType: "string[]",
name: "",
type: "string[]"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address"
}
],
name: "userNodeSet",
outputs: [
{
internalType: "bytes32[]",
name: "",
type: "bytes32[]"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address"
}
],
name: "userOperators",
outputs: [
{
internalType: "address[]",
name: "",
type: "address[]"
}
],
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"
}
], G = [
"constructor(address)",
"function getNames(address[]) view returns (string[])"
], z = [
{
inputs: [
{
internalType: "contract ENS",
name: "_ens",
type: "address"
},
{
internalType: "bytes32",
name: "_baseNode",
type: "bytes32"
}
],
stateMutability: "nonpayable",
type: "constructor"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "approved",
type: "address"
},
{
indexed: !0,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "Approval",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "operator",
type: "address"
},
{
indexed: !1,
internalType: "bool",
name: "approved",
type: "bool"
}
],
name: "ApprovalForAll",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "controller",
type: "address"
}
],
name: "ControllerAdded",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "controller",
type: "address"
}
],
name: "ControllerRemoved",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "uint256",
name: "id",
type: "uint256"
},
{
indexed: !0,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !1,
internalType: "uint256",
name: "expires",
type: "uint256"
}
],
name: "NameMigrated",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "uint256",
name: "id",
type: "uint256"
},
{
indexed: !0,
internalType: "address",
name: "owner",
type: "address"
},
{
indexed: !1,
internalType: "uint256",
name: "expires",
type: "uint256"
}
],
name: "NameRegistered",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "uint256",
name: "id",
type: "uint256"
},
{
indexed: !1,
internalType: "uint256",
name: "expires",
type: "uint256"
}
],
name: "NameRenewed",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "previousOwner",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "newOwner",
type: "address"
}
],
name: "OwnershipTransferred",
type: "event"
},
{
anonymous: !1,
inputs: [
{
indexed: !0,
internalType: "address",
name: "from",
type: "address"
},
{
indexed: !0,
internalType: "address",
name: "to",
type: "address"
},
{
indexed: !0,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "Transfer",
type: "event"
},
{
inputs: [],
name: "GRACE_PERIOD",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "controller",
type: "address"
}
],
name: "addController",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "to",
type: "address"
},
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "approve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
}
],
name: "available",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address"
}
],
name: "balanceOf",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "baseNode",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
name: "controllers",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "ens",
outputs: [
{
internalType: "contract ENS",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "getApproved",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "address",
name: "operator",
type: "address"
}
],
name: "isApprovedForAll",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "name",
outputs: [
{
internalType: "string",
name: "",
type: "string"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
}
],
name: "nameExpires",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "ownerOf",
outputs: [
{
internalType: "address",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
},
{
internalType: "address",
name: "owner",
type: "address"
}
],
name: "reclaim",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
},
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "uint256",
name: "duration",
type: "uint256"
}
],
name: "register",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
},
{
internalType: "address",
name: "owner",
type: "address"
},
{
internalType: "uint256",
name: "duration",
type: "uint256"
}
],
name: "registerOnly",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "controller",
type: "address"
}
],
name: "removeController",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "id",
type: "uint256"
},
{
internalType: "uint256",
name: "duration",
type: "uint256"
}
],
name: "renew",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "from",
type: "address"
},
{
internalType: "address",
name: "to",
type: "address"
},
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "from",
type: "address"
},
{
internalType: "address",
name: "to",
type: "address"
},
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
},
{
internalType: "bytes",
name: "data",
type: "bytes"
}
],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "operator",
type: "address"
},
{
internalType: "bool",
name: "approved",
type: "bool"
}
],
name: "setApprovalForAll",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "resolver",
type: "address"
}
],
name: "setResolver",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes4",
name: "interfaceID",
type: "bytes4"
}
],
name: "supportsInterface",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "symbol",
outputs: [
{
internalType: "string",
name: "",
type: "string"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "tokenURI",
outputs: [
{
internalType: "string",
name: "",
type: "string"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "from",
type: "address"
},
{
internalType: "address",
name: "to",
type: "address"
},
{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}
],
name: "transferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address"
}
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}
], V = [
"constructor(address,address,uint256,uint256,address,address)",
"error CommitmentTooNew(bytes32)",
"error CommitmentTooOld(bytes32)",
"error DurationTooShort(uint256)",
"error InsufficientValue()",
"error MaxCommitmentAgeTooHigh()",
"error MaxCommitmentAgeTooLow()",
"error NameNotAvailable(string)",
"error ResolverRequiredWhenDataSupplied()",
"error Unauthorised(bytes32)",
"error UnexpiredCommitmentExists(bytes32)",
"event Initialized(uint8)",
"event NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)",
"event NameRenewed(string,bytes32 indexed,uint256,uint256)",
"event OwnershipTransferred(address indexed,address indexed)",
"event RoleAdminChanged(bytes32 indexed,bytes32 indexed,bytes32 indexed)",
"event RoleGranted(bytes32 indexed,address indexed,address indexed)",
"event RoleRevoked(bytes32 indexed,address indexed,address indexed)",
"function ADMIN_ROLE() view returns (bytes32)",
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
"function MIN_REGISTRATION_DURATION() view returns (uint256)",
"function available(string) view returns (bool)",
"function commit(bytes32)",
"function commitments(bytes32) view returns (uint256)",
"function getRoleAdmin(bytes32) view returns (bytes32)",
"function grantRole(bytes32,address)",
"function hasRole(bytes32,address) view returns (bool)",
"function initialize(address,address,uint256,uint256,address,address,address)",
"function labelStatus(string) view returns (uint8)",
"function makeCommitment(string,address,uint256,bytes32,address,bytes[],bool,uint32,uint64) pure returns (bytes32)",
"function maxCommitmentAge() view returns (uint256)",
"function minCommitmentAge() view returns (uint256)",
"function nameWhitelist() view returns (address)",
"function nameWrapper() view returns (address)",
"function owner() view returns (address)",
"function prices() view returns (address)",
"function recoverFunds(address,address,uint256)",
"function register(string,address,uint256,bytes32,address,bytes[],bool,uint32,uint64) payable",
"function registerWithFiat(string,address,uint256,bytes32,address,bytes[],bool,uint32,uint64)",
"function renew(string,uint256) payable",
"function renewWithFiat(string,uint256,uint32,uint64)",
"function renewWithFuses(string,uint256,uint32,uint64) payable",
"function renounceOwnership()",
"function renounceRole(bytes32,address)",
"function rentPrice(string,uint256) view returns (tuple(uint256,uint256))",
"function rentPriceInFiat(string,uint256) view returns (tuple(uint256,uint256))",
"function reverseRegistrar() view returns (address)",
"function revokeRole(bytes32,address)",
"function setCommitmentAge(uint