-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-subnames.js
More file actions
152 lines (120 loc) · 6.23 KB
/
Copy pathcheck-subnames.js
File metadata and controls
152 lines (120 loc) · 6.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://eth.llamarpc.com');
// ENS Registry address
const ENS_REGISTRY = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e';
// ENS Registry ABI (only what we need)
const registryABI = [
'function owner(bytes32 node) view returns (address)',
'function resolver(bytes32 node) view returns (address)'
];
async function checkSubnames() {
console.log('Querying ucash.eth subnames...\n');
const registry = new ethers.Contract(ENS_REGISTRY, registryABI, provider);
// Get the namehash of ucash.eth
const ucashNode = ethers.namehash('ucash.eth');
console.log('ucash.eth nodehash:', ucashNode);
console.log('');
// Complete list of 300+ documented subdomains
const subnames = [
// Core Infrastructure
'www', 'app', 'api', 'docs', 'info', 'admin', 'dev', 'test', 'testnet',
'demo', 'code', 'whitepaper', 'management', 'proxy', 'view', 'create', 'layer',
'space', 'web', '_', '$', 'pay', 'usdc', 'dai', 'usdt', 'git', 'history',
'actions', 'mail', 'payments', 'records', 'finance', 'store', 'action',
'ipns', 'explorer', 'about', 'eth', 'connect', 'sdk', 'pages', 'gateway',
'automation', 'mission', 'workers', 'worker', 'naming', 'auth', 'host',
'contact', 'learn', 'blog', 'faq', 'knowledgebase', 'android', 'ios', 'data',
'home', '-', 'brave', 'web3', 'uni', 'page', 'extension', 'meta', 'claw',
'tasks', 'services', 'key', 'manage', 'units', 'index', 'readme', 'global',
'address', 'invoice', 'dex', 'box', 'subnames', 'ai', 'tx', 'markets',
'wallet', 'agents',
// Smart Contracts & Protocol
'batch', 'contracts', 'token', 'bridge', 'earn', 'vault', 'claim', 'lock',
'gov', 'dao', 'vote', 'oracle', 'agent', 'bot', 'sign', 'supply',
'initial', 'ongoing', 'build', 'partners', 'future', 'liquidity',
'validator', 'nft', 'contract', 'swap', 'faucet', 'multisig', 'tree', 'smart',
// Governance & DeFi
'delegates', 'delegate', 'delegation', 'proposals', 'proposal', 'aragon',
'badges', 'loyalty', 'access', 'rewards', 'receipt', 'order', 'coupon',
'coupons', 'codes', 'uip', 'urc',
// Naming Services & Registries
'wns', 'uid', 'sid', 'cns', 'sns', 'tns', 'register', 'registrar',
'registry', 'dns', 'ens', 'domains', 'names', 'uns', 'linked', 'label', 'wei',
// Blockchain Networks
'polygon', 'base', 'arb', 'linea', 'op', 'sol', 'bnb', 'btc', 'xrp', 'ltc',
'xmr', 'g', 'sui', 'ada', 'ton', 'tao', 'mesh', 'fio', 'bch', 'nodes', 'node',
'multichain',
// Cross-Chain
'network', 'swap', 'exchange',
// Referral & Marketing
'refer', 'referrer', 'referral',
// Infrastructure & Operations
'infra', 'infrastructure', 'lab', 'legacy', 'tunnel', 'sync', 'launch',
'cold', 'warm', 'hot', 'lightning', 'anchor', 'zones', 'onchain', 'robot', 'agi',
// Explorers & Tools
'scan', 'verify', 'link', 'mgr', 'nic', 'support', 'bounties', 'news',
'validate', 'txt', 'xml', 'md', 'sitemap', 'whois', 'manager', 'premium', 'channel',
// Decentralized Storage
'ipfs', 'arweave', 'swarm', 'onion', 'skynet', 'hosting',
// Geographic TLDs (ccTLDs)
'ad', 'ar', 'at', 'br', 'ca', 'cc', 'cn', 'co', 'cv', 'de', 'es', 'fm',
'fr', 'id', 'in', 'io', 'it', 'jp', 'kr', 'la', 'li', 'ly', 'me', 'mx',
'mw', 'my', 'ng', 'nl', 'ru', 'rw', 'to', 'tv', 'uk', 'us', 'vn', 'ws',
// Generic TLDs (gTLDs)
'tld', 'club', 'pro', 'biz', 'name', 'vip', 'top', 'tech', 'online',
'ooo', 'gdn', 'xyz', 'u', 'net', 'org', 'onl', 'com', 'wiki', 'technology',
'productions', 'exchange',
// Brand & Identity
'brand', 'cash', 'builders', 'channel', 'premium', 'meta', 'claw',
// Time & Temporal
'one', 'now', 'new',
// Emoji subdomains (encoded)
'🏰', '🛕', '🐘', '🗿', '🐉', '📡', '🧊', '🗽', '🍁', '🏦', '🏆', '🪄',
'⚡', '🎯', '👽', '🤯', '🔧', '💎', '☁', '🌙', '💱', '👑', '🪙', '🛟',
'📙', '💵', '❔', '✅', '🏢', '📺', '🔗', '🛒', '🌐', '🔑', '⛓', '🤖'
];
const found = [];
for (const subname of subnames) {
const fullName = `${subname}.ucash.eth`;
try {
const node = ethers.namehash(fullName);
const owner = await registry.owner(node);
// If owner is not zero address, subname exists
if (owner !== ethers.ZeroAddress && owner !== '0x0000000000000000000000000000000000000000') {
const resolver = await registry.resolver(node);
found.push({
subname: fullName,
owner: owner,
resolver: resolver,
hasResolver: resolver !== ethers.ZeroAddress && resolver !== '0x0000000000000000000000000000000000000000'
});
console.log(`✅ ${fullName}`);
console.log(` Owner: ${owner}`);
console.log(` Resolver: ${resolver}`);
console.log('');
}
} catch (error) {
// Subname doesn't exist or other error
}
}
console.log(`\nFound ${found.length} active subnames out of ${subnames.length} checked`);
// Also check the main ucash.eth info
console.log('\n=== Main ucash.eth Info ===');
const ucashOwner = await registry.owner(ucashNode);
const ucashResolver = await registry.resolver(ucashNode);
console.log(`Owner: ${ucashOwner}`);
console.log(`Resolver: ${ucashResolver}`);
// If there's a resolver, try to get the address
if (ucashResolver !== ethers.ZeroAddress) {
try {
const resolverABI = ['function addr(bytes32 node) view returns (address)'];
const resolverContract = new ethers.Contract(ucashResolver, resolverABI, provider);
const address = await resolverContract.addr(ucashNode);
console.log(`Address: ${address}`);
} catch (error) {
console.log('Could not resolve address');
}
}
return found;
}
checkSubnames().catch(console.error);