|
| 1 | +#!/usr/bin/env node |
| 2 | +const { Connection, PublicKey } = require('@solana/web3.js'); |
| 3 | + |
| 4 | +const ADDRESSES = { |
| 5 | + program: 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4', |
| 6 | + programData: '4Ec7ZxZS6Sbdg5UGSLHbAnM7GQHp2eFd4KYWRexAipQT', |
| 7 | + currentAuthority: 'CvQZZ23qYDWF2RUpxYJ8y9K4skmuvYEEjH7fK58jtipQ', |
| 8 | + newController: 'GLzZk1sczzW6fM4uPFeQCtTZQaf8H5VaBt99tUMbJAAW', |
| 9 | + multisig: '7ZyDFzet6sKgZLN4D89JLfo7chu2n7nYdkFt5RCFk8Sf', |
| 10 | + members: [ |
| 11 | + '2MgqMXdwSf3bRZ6S8uKJSffZAaoZBhD2mjst3phJXE7p', |
| 12 | + '89FnbsKH8n6FXCghGUijxh3snqx3e6VXJ7q1fQAHWkQQ', |
| 13 | + 'BYidGfUnfoQtqi4nHiuo57Fjreizbej6hawJLnbwJmYr', |
| 14 | + 'CHRDWWqUs6LyeeoD7pJb3iRfnvYeMfwMUtf2N7zWk7uh', |
| 15 | + 'Dg5NLa5JuwfRMkuwZEguD9RpVrcQD3536GxogUv7pLNV', |
| 16 | + 'EhJqf1p39c8NnH5iuZAJyw778LQua1AhZWxarT5SF8sT', |
| 17 | + 'GGG2JyBtwbPAsYwUQED8GBbj9UMi7NQa3uwN3DmyGNtz' |
| 18 | + ] |
| 19 | +}; |
| 20 | + |
| 21 | +async function verifyOnChain() { |
| 22 | + const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed'); |
| 23 | + |
| 24 | + console.log('🔍 Solana On-Chain Verification\n'); |
| 25 | + console.log('━'.repeat(60)); |
| 26 | + |
| 27 | + const results = { valid: [], invalid: [] }; |
| 28 | + |
| 29 | + // Verify Program |
| 30 | + try { |
| 31 | + const programInfo = await connection.getAccountInfo(new PublicKey(ADDRESSES.program)); |
| 32 | + if (programInfo && programInfo.executable) { |
| 33 | + console.log('✅ Jupiter Program:', ADDRESSES.program); |
| 34 | + console.log(' Executable:', programInfo.executable); |
| 35 | + console.log(' Owner:', programInfo.owner.toBase58()); |
| 36 | + console.log(' 🔗 https://solscan.io/account/' + ADDRESSES.program); |
| 37 | + results.valid.push({ type: 'Program', address: ADDRESSES.program }); |
| 38 | + } |
| 39 | + } catch (e) { |
| 40 | + results.invalid.push({ type: 'Program', address: ADDRESSES.program, error: e.message }); |
| 41 | + } |
| 42 | + |
| 43 | + console.log('\n━'.repeat(60)); |
| 44 | + |
| 45 | + // Verify Program Data |
| 46 | + try { |
| 47 | + const dataInfo = await connection.getAccountInfo(new PublicKey(ADDRESSES.programData)); |
| 48 | + if (dataInfo) { |
| 49 | + console.log('✅ Program Data:', ADDRESSES.programData); |
| 50 | + console.log(' Size:', dataInfo.data.length, 'bytes'); |
| 51 | + console.log(' 🔗 https://solscan.io/account/' + ADDRESSES.programData); |
| 52 | + results.valid.push({ type: 'Program Data', address: ADDRESSES.programData }); |
| 53 | + } |
| 54 | + } catch (e) { |
| 55 | + results.invalid.push({ type: 'Program Data', address: ADDRESSES.programData, error: e.message }); |
| 56 | + } |
| 57 | + |
| 58 | + console.log('\n━'.repeat(60)); |
| 59 | + |
| 60 | + // Verify Current Authority |
| 61 | + try { |
| 62 | + const authInfo = await connection.getAccountInfo(new PublicKey(ADDRESSES.currentAuthority)); |
| 63 | + const balance = await connection.getBalance(new PublicKey(ADDRESSES.currentAuthority)); |
| 64 | + console.log('✅ Current Authority:', ADDRESSES.currentAuthority); |
| 65 | + console.log(' Balance:', (balance / 1e9).toFixed(4), 'SOL'); |
| 66 | + console.log(' 🔗 https://solscan.io/account/' + ADDRESSES.currentAuthority); |
| 67 | + results.valid.push({ type: 'Current Authority', address: ADDRESSES.currentAuthority }); |
| 68 | + } catch (e) { |
| 69 | + results.invalid.push({ type: 'Current Authority', address: ADDRESSES.currentAuthority, error: e.message }); |
| 70 | + } |
| 71 | + |
| 72 | + console.log('\n━'.repeat(60)); |
| 73 | + |
| 74 | + // Verify New Controller |
| 75 | + try { |
| 76 | + const controllerBalance = await connection.getBalance(new PublicKey(ADDRESSES.newController)); |
| 77 | + console.log('✅ New Controller:', ADDRESSES.newController); |
| 78 | + console.log(' Balance:', (controllerBalance / 1e9).toFixed(4), 'SOL'); |
| 79 | + console.log(' 🔗 https://solscan.io/account/' + ADDRESSES.newController); |
| 80 | + results.valid.push({ type: 'New Controller', address: ADDRESSES.newController }); |
| 81 | + } catch (e) { |
| 82 | + results.invalid.push({ type: 'New Controller', address: ADDRESSES.newController, error: e.message }); |
| 83 | + } |
| 84 | + |
| 85 | + console.log('\n━'.repeat(60)); |
| 86 | + |
| 87 | + // Verify Multisig |
| 88 | + try { |
| 89 | + const multisigInfo = await connection.getAccountInfo(new PublicKey(ADDRESSES.multisig)); |
| 90 | + if (multisigInfo) { |
| 91 | + console.log('✅ Multisig Account:', ADDRESSES.multisig); |
| 92 | + console.log(' Owner:', multisigInfo.owner.toBase58()); |
| 93 | + console.log(' 🔗 https://solscan.io/account/' + ADDRESSES.multisig); |
| 94 | + results.valid.push({ type: 'Multisig', address: ADDRESSES.multisig }); |
| 95 | + } |
| 96 | + } catch (e) { |
| 97 | + results.invalid.push({ type: 'Multisig', address: ADDRESSES.multisig, error: e.message }); |
| 98 | + } |
| 99 | + |
| 100 | + console.log('\n━'.repeat(60)); |
| 101 | + console.log('🔑 Multisig Members:\n'); |
| 102 | + |
| 103 | + for (let i = 0; i < ADDRESSES.members.length; i++) { |
| 104 | + try { |
| 105 | + const balance = await connection.getBalance(new PublicKey(ADDRESSES.members[i])); |
| 106 | + console.log(`✅ Member ${i + 1}:`, ADDRESSES.members[i]); |
| 107 | + console.log(` Balance: ${(balance / 1e9).toFixed(4)} SOL`); |
| 108 | + console.log(` 🔗 https://solscan.io/account/${ADDRESSES.members[i]}`); |
| 109 | + results.valid.push({ type: `Member ${i + 1}`, address: ADDRESSES.members[i] }); |
| 110 | + } catch (e) { |
| 111 | + console.log(`❌ Member ${i + 1}:`, ADDRESSES.members[i], '- ERROR'); |
| 112 | + results.invalid.push({ type: `Member ${i + 1}`, address: ADDRESSES.members[i], error: e.message }); |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + console.log('\n' + '━'.repeat(60)); |
| 117 | + console.log('\n📊 Verification Summary:'); |
| 118 | + console.log(` ✅ Valid: ${results.valid.length}`); |
| 119 | + console.log(` ❌ Invalid: ${results.invalid.length}`); |
| 120 | + console.log(` 📈 Success Rate: ${((results.valid.length / (results.valid.length + results.invalid.length)) * 100).toFixed(1)}%`); |
| 121 | + |
| 122 | + if (results.invalid.length === 0) { |
| 123 | + console.log('\n🎉 ALL ADDRESSES VERIFIED ON SOLANA MAINNET!'); |
| 124 | + } |
| 125 | + |
| 126 | + return results; |
| 127 | +} |
| 128 | + |
| 129 | +verifyOnChain().catch(console.error); |
0 commit comments