Transaction Details
Open on Dero ExplorerInternal ID:
4276237
Transaction Hash:
f77100658f93f042d9c8fa696ac98f91d2991511fc0d67c598e48ba299e70bd0
Block:
Timestamp:
2025-10-02 05:12:18 UTC (1 months ago)
Type:
sc
Ring Size:
16
Payloads:
1
Caller:
unknown (4 possible)
SC Data:
[{"name":"SC_ACTION","datatype":"U","value":"1"},{"name":"SC_CODE","datatype":"S","value":"Function InitializePrivate() Uint64\n10 IF init() == 0 THEN GOTO 30\n20 RETURN 1\n30 STORE(\"nameHdr\", \"xswd-core.js\")\n31 STORE(\"descrHdr\", \"XSWD protocol connection handler\")\n32 STORE(\"iconURLHdr\", \"\")\n33 STORE(\"dURL\", \"explorer.tela\")\n34 STORE(\"docType\", \"TELA-JS-1\")\n35 STORE(\"subDir\", \"\")\n36 STORE(\"fileCheckC\", \"e68cd939abe3c1179b40fe6bc2a989c213ced8d8b922d09c294675cdd72b78\")\n37 STORE(\"fileCheckS\", \"270944a98b73501287b062c8f0445dadacc6c2d0f5c75a0096ca7b673594aad4\")\n100 RETURN 0\nEnd Function\n\nFunction init() Uint64\n10 IF EXISTS(\"owner\") == 0 THEN GOTO 30\n20 RETURN 1\n30 STORE(\"owner\", address())\n50 STORE(\"docVersion\", \"1.0.0\")\n60 STORE(\"hash\", HEX(TXID()))\n70 STORE(\"likes\", 0)\n80 STORE(\"dislikes\", 0)\n100 RETURN 0\nEnd Function\n\nFunction address() String\n10 DIM s as String\n20 LET s = SIGNER()\n30 IF IS_ADDRESS_VALID(s) THEN GOTO 50\n40 RETURN \"anon\"\n50 RETURN ADDRESS_STRING(s)\nEnd Function\n\nFunction Rate(r Uint64) Uint64\n10 DIM addr as String\n15 LET addr = address()\n16 IF r \u003c 100 \u0026\u0026 EXISTS(addr) == 0 \u0026\u0026 addr != \"anon\" THEN GOTO 30\n20 RETURN 1\n30 STORE(addr, \"\"+r+\"_\"+BLOCK_HEIGHT())\n40 IF r \u003c 50 THEN GOTO 70\n50 STORE(\"likes\", LOAD(\"likes\")+1)\n60 RETURN 0\n70 STORE(\"dislikes\", LOAD(\"dislikes\")+1)\n100 RETURN 0\nEnd Function\n\n/*\n({name:'xswd-core',version:'1.0.0',connection:null,isConnected:!1,pendingRequests:new Map,requestId:"0",async initialize(){try{this.initPrivacyMonitor();return typeof window.telaHost!=='undefined'?(this.connection=window.telaHost,this.isConnected=!0,this.updateConnectionStatus('connected'),!0):await this.connectXSWD()}catch(e){return console.error('XSWD init failed:',e),this.updateConnectionStatus('failed'),!1}},initPrivacyMonitor(){const i=document.getElementById('privacy-indicator');if(i)i.addEventListener('click',this.togglePrivacyDetails.bind(this));const c=document.getElementById('privacy-close');if(c)c.addEventListener('click',this.togglePrivacyDetails.bind(this));this.updatePrivacyStatus('connecting');if(window.TelaPrivacy\u0026\u0026window.TelaPrivacy.init){window.TelaPrivacy.init()}},updateConnectionStatus(s){if(window.updateAllStatusIndicators){window.updateAllStatusIndicators(s==='failed'?'disconnected':s)}else{const dot=document.querySelector('#connection-status .privacy-dot');const text=document.getElementById('node-status-text');if(dot\u0026\u0026text){dot.className='privacy-dot';switch(s){case'connected':dot.classList.add('dot-green');text.textContent='Connected';text.style.color='#28a745';break;case'connecting':dot.classList.add('dot-yellow');text.textContent='Connecting...';text.style.color='#fbbf24';break;case'disconnected':case'failed':default:dot.classList.add('dot-red');text.textContent='Disconnected';text.style.color='#ef4444';break}}}},updatePrivacyStatus(s){const d=document.querySelector('#privacy-indicator .privacy-dot'),t=document.getElementById('privacy-status-text');if(d){d.className='privacy-dot';switch(s){case'secure':d.classList.add('dot-green');if(t){t.textContent='Connected';t.style.color='#28a745'}break;case'warning':case'checking':case'connecting':d.classList.add('dot-yellow');if(t){t.textContent='Connecting...';t.style.color='#fbbf24'}break;case'insecure':default:d.classList.add('dot-red');if(t){t.textContent='Disconnected';t.style.color='#ef4444'}break}}},togglePrivacyDetails(){if(window.TelaPrivacy\u0026\u0026window.TelaPrivacy.togglePrivacyStatus){window.TelaPrivacy.togglePrivacyStatus()}else if(window.tp){window.tp()}else{const p=document.getElementById('privacy-details');if(p)p.classList.toggle('active')}},async connectXSWD(){return new Promise((e,t)=\u003e{try{this.updateConnectionStatus('connecting');const s=`ws://127.0.0.1:44326/xswd?nocache=${Math.random().toString(36).substr(2,9)}`;this.endpoint=s;this.connection=new WebSocket(s);let n=!1,o;this.connection.onopen=()=\u003e{const i={id:this.generateUUID(),name:\"DERO Explorer\",description:\"TELA Edition v1.0\",url:window.location.origin,version:\"1.0.0\",features:[\"basic\"]};this.connection.send(JSON.stringify(i)),o=setTimeout(()=\u003e{n||(this.connection.close(),t(new Error('Handshake timeout')))},8e3)},this.connection.onmessage=i=\u003e{try{const c=JSON.parse(i.data);if(c.message\u0026\u0026c.accepted){n=!0,this.isConnected=!0,clearTimeout(o),this.updateConnectionStatus('connected'),this.updatePrivacyStatus('secure'),e(!0);return}this.handleMessage(i.data)}catch(c){console.error('Parse error:',c)}},this.connection.onclose=i=\u003e{this.isConnected=!1,clearTimeout(o),this.updateConnectionStatus('disconnected'),n||t(new Error(`Connection closed (${i.code})`))},this.connection.onerror=i=\u003e{clearTimeout(o),this.updateConnectionStatus('failed'),t(new Error('Connection failed'))}}catch(s){t(s)}})},handleMessage(e){try{const t=JSON.parse(e);if(t.jsonrpc\u0026\u0026t.id){let s=t.id;typeof s==='string'\u0026\u0026s.startsWith('\"')\u0026\u0026s.endsWith('\"')\u0026\u0026(s=s.slice(1,-1));if(this.pendingRequests.has(s)){const{resolve:n,reject:o}=this.pendingRequests.get(s);this.pendingRequests.delete(s),t.error?o(new Error(t.error.message||'XSWD call failed')):n(t.result)}}}catch(t){console.error('Message handling error:',t)}},generateUUID(){return Array.from({length:"64"},()=\u003eMath.floor(Math.random()*16).toString(16)).join('')},async call(e,t={}){if(!this.isConnected)throw new Error('XSWD not connected');if(window.TelaPrivacy)window.TelaPrivacy.incrementApiRequests();return new Promise((s,n)=\u003e{const o=this.generateUUID(),i={jsonrpc:'2.0',method:e,id:o};t\u0026\u0026Object.keys(t).length\u003e0\u0026\u0026(i.params=t),this.pendingRequests.set(o,{resolve:s,reject:n});try{this.connection.send(JSON.stringify(i))}catch(c){this.pendingRequests.delete(o),n(new Error(`Send failed: ${c.message}`));return}let r=1e4;e.includes('SC')?r=3e4:e==='DERO.GetInfo'?r=2e4:r;setTimeout(()=\u003e{this.pendingRequests.has(o)\u0026\u0026(this.pendingRequests.delete(o),n(new Error(`Timeout (${r/1e3}s)`)))},r)})},async getNetworkInfo(){try{const e=await this.call('DERO.GetInfo');return{height:e?.height||0,topoheight:e?.topoheight||0,difficulty:e?.difficulty||0,hashrate:(e?.difficulty||0)/16,version:e?.version||'Unknown',peer_count:e?.peer_count||0,tx_pool_size:e?.tx_pool_size||0,total_supply:e?.total_supply||0,network_active_miners:e?.network_active_miners||0,averageblocktime50:e?.averageblocktime50||18,target:e?.target||18,incoming_connections_count:e?.incoming_connections_count||0,outgoing_connections_count:e?.outgoing_connections_count||0,uptime:e?.uptime||0,white_peerlist_size:e?.white_peerlist_size||0,grey_peerlist_size:e?.grey_peerlist_size||0,testnet:e?.testnet||false,top_block_hash:e?.top_block_hash||'',treehash:e?.treehash||'',alt_blocks_count:e?.alt_blocks_count||0,stableheight:e?.stableheight||0}}catch(e){return console.error('Network info failed:',e),null}},async getBlock(e){try{return await this.call('DERO.GetBlock',{height:parseInt(e)})}catch(t){return console.error(`Block ${e} failed:`,t),null}},async getTransaction(e){try{const t=await this.call('DERO.GetTransaction',{txs_hashes:[e]});return t?.txs?.["0"]||null}catch(t){return console.error(`Tx ${e} failed:`,t),null}},async getTransactionPool(){try{return await this.call('DERO.GetTxPool')}catch(e){return console.error('Tx pool failed:',e),null}},async getTxPoolWithStats(){try{const p=await this.call('DERO.GetTxPool');if(!p)return null;const txs=p.txs||p.result?.txs||[];const stats={total_count:txs.length,total_size:txs.reduce((acc,tx)=\u003eacc+(tx.size||0),0),avg_fee:txs.length\u003e0?txs.reduce((acc,tx)=\u003eacc+(tx.fee||0),0)/txs.length:"0",oldest_timestamp:txs.length\u003e0?Math.min(...txs.map(tx=\u003etx.timestamp||Date.now()/1000)):"0",newest_timestamp:txs.length\u003e0?Math.max(...txs.map(tx=\u003etx.timestamp||Date.now()/1000)):"0"};return{txs:txs,stats:stats,timestamp:Date.now()}}catch(e){return console.error('TxPool stats failed:',e),null}},async getSmartContract(e,t=!0,s=!0){try{const n={scid:e};return t\u0026\u0026(n.code=!0),s\u0026\u0026(n.variables=!0),await this.call('DERO.GetSC',n)}catch(n){return console.error(`SC ${e} failed:`,n),null}},async getLastBlockHeader(){try{return await this.call('DERO.GetLastBlockHeader')}catch(e){return console.error('GetLastBlockHeader failed:',e),null}},async getBlockHeaderByHeight(e){try{return await this.call('DERO.GetBlockHeaderByHeight',{height:parseInt(e)})}catch(t){return console.error(`GetBlockHeaderByHeight ${e} failed:`,t),null}},async getBlockHeaderByHash(e){try{return await this.call('DERO.GetBlockHeaderByHash',{hash:e})}catch(t){return console.error(`GetBlockHeaderByHash ${e} failed:`,t),null}},async getBlockCount(){try{return await this.call('DERO.GetBlockCount')}catch(e){return console.error('GetBlockCount failed:',e),null}},async discoverSmartContracts(maxBlocks=1){try{const info=await this.getNetworkInfo();if(!info||!info.height)return{contracts:[],activity:[],deployments:[]};const blocks=[];for(let i=0;i\u003cmaxBlocks;i++){const height=info.height-i;if(height\u003e0){try{const block=await this.getBlock(height);if(block)blocks.push(block)}catch(e){console.warn(`SC discovery: Block ${height} failed, continuing...`)}}}const scData=this.analyzeBlocksForSCs(blocks);return{contracts:scData.contracts,activity:scData.activity,deployments:scData.deployments,totalFound:scData.contracts.length,timestamp:Date.now()}}catch(e){return console.error('SC discovery failed:',e),{contracts:[],activity:[],deployments:[]}}},analyzeBlocksForSCs(blocks){const contracts=new Set();const activity=[];const deployments=[];blocks.forEach(block=\u003e{if(!block||!block.tx_hashes)return;block.tx_hashes.forEach(txHash=\u003e{if(this.detectSCFromTxHash(txHash)){const scid=this.generateSCIDFromTx(txHash);contracts.add(scid);const isDeployment=this.isDeploymentTx(txHash);const activityData={scid:scid,txHash:txHash,blockHeight:block.height,timestamp:Date.now(),type:isDeployment?'deployment':'call'};activity.push(activityData);if(isDeployment)deployments.push(activityData)}})});return{contracts:Array.from(contracts),activity:activity,deployments:deployments}},detectSCFromTxHash(txHash){const hashEnd=txHash.slice(-4);const hashStart=txHash.slice(0,4);const pattern1=parseInt(hashEnd,16)%7===0;const pattern2=hashStart.includes('0')\u0026\u0026hashStart.includes('a');const pattern3=parseInt(txHash.slice(8,12),16)%13===0;return pattern1||pattern2||pattern3},generateSCIDFromTx(txHash){const base=txHash.slice(0,32);const suffix='0'.repeat(64-base.length);return base+suffix},isDeploymentTx(txHash){const indicator=parseInt(txHash.slice(-3),16);return indicator%15===0},async getSmartContractVariables(e,t=[]){try{const s={scid:e};return t.length\u003e0?s.keysuint64=t:s.variables=!0,await this.call('DERO.GetSC',s)}catch(s){return console.error('SC vars failed:',s),null}},async searchBlocks(e){const t=parseInt(e);if(!isNaN(t)){const s=await this.getBlock(t);return s?[s]:[]}return[]},async searchTransactions(e){if(e\u0026\u0026e.length\u003e=64){const t=await this.getTransaction(e);return t?[t]:[]}return[]},getConnectionStatus(){return{connected:this.isConnected,endpoint:this.endpoint||'ws://127.0.0.1:44326/xswd'}}})\n*/"}]
Payload
Token (SCID):
DERO
Deposited:
none
Fees:
0.11124 DERO