# How to quickly view contract code in Visual Studio

**URL:** <https://talk.markets/t/how-to-quickly-view-contract-code-in-visual-studio/444>\
**Category:** Crypto & DeFi\
**Tags:** script, members-only\
**Created:** [27 June 2022 21:37 UTC](https://talk.markets/t/how-to-quickly-view-contract-code-in-visual-studio/444 "2022-06-27T21:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lux](https://talk.markets/user_avatar/talk.markets/lux/32/15251_2.png) [@Lux](https://talk.markets/u/Lux)\
**Post date:** [27 June 2022 21:37 UTC](https://talk.markets/t/how-to-quickly-view-contract-code-in-visual-studio/444/1 "2022-06-27T21:37:00Z")

</div>

I use a bookmark to quickly change the explorer URL from `.io` to `.deth.net`. This opens the contract code in a web based Visual Studio environment. It works from any explorer (ie. EtherScan) page as long as the contract is in the URL.

While browsing smart contract code on [Etherscan](https://etherscan.io/) just change URL from `.io` to `.deth.net`. This will open Visual Studio Code instance and fetch the verified code using Etherscan API.

# Add script

```plaintext
javascript:var _0x4ffab4=_0x3ac3;(function(_0x31bc91,_0x30e703){var _0x4f2439=_0x3ac3,_0x13ba2f=_0x31bc91();while(!![]){try{var _0x3bbb61=parseInt(_0x4f2439(0x107))/0x1*(-parseInt(_0x4f2439(0xed))/0x2)+parseInt(_0x4f2439(0xf3))/0x3+-parseInt(_0x4f2439(0xe4))/0x4+-parseInt(_0x4f2439(0xfb))/0x5*(parseInt(_0x4f2439(0xf1))/0x6)+parseInt(_0x4f2439(0x101))/0x7+-parseInt(_0x4f2439(0x108))/0x8+parseInt(_0x4f2439(0x109))/0x9;if(_0x3bbb61===_0x30e703)break;else _0x13ba2f['push'](_0x13ba2f['shift']());}catch(_0x189b02){_0x13ba2f['push'](_0x13ba2f['shift']());}}}(_0x3e5b,0xd3109));_0x4edc1f:var contract=extractUrlValue(_0x4ffab4(0x114));function extractUrlValue(_0x17a7f1){var _0xbde693=_0x4ffab4;_0x17a7f1=window[_0xbde693(0xf8)][_0xbde693(0x100)];var _0x548015=_0x17a7f1['match'](/0x[a-fA-F0-9]{40}/);return _0x548015;}if(contract===null)throw _0x4ffab4(0x103);function _0x3ac3(_0x2a76db,_0x4763a4){var _0x54bf8c=_0x3e5b();return _0x3ac3=function(_0x13adca,_0x3875dd){_0x13adca=_0x13adca-0xe3;var _0x409271=_0x54bf8c[_0x13adca];return _0x409271;},_0x3ac3(_0x2a76db,_0x4763a4);}{navigator[_0x4ffab4(0xf7)][_0x4ffab4(0x112)](contract)[_0x4ffab4(0xf6)](()=>{var _0x1109d2=_0x4ffab4;console[_0x1109d2(0xf9)]('Copied\x20to\x20clipboard\x20successfully.');},_0xd20af2=>{var _0x4423b0=_0x4ffab4;console['log'](_0x4423b0(0x115),_0xd20af2);});}var bscscan=checkIfBNB(_0x4ffab4(0xfe));function checkIfBNB(_0x5731c0){var _0x3480e3=_0x4ffab4;_0x5731c0=window[_0x3480e3(0xf8)][_0x3480e3(0x100)];var _0x3aa761=/bscscan|bsc|bnb|\/moonarch\.app|poocoin/i[_0x3480e3(0x10d)](_0x5731c0);return _0x3aa761;}console['log'](bscscan+_0x4ffab4(0x105));var avax=checkIfAVAX(_0x4ffab4(0x10f));function checkIfAVAX(_0x4390fe){var _0x5f093d=_0x4ffab4;_0x4390fe=window['location']['href'];var _0x47a71f=/snowtrace|avalanche|avax/i[_0x5f093d(0x10d)](_0x4390fe);return _0x47a71f;}console[_0x4ffab4(0xf9)](avax+_0x4ffab4(0xff));var ftm=checkIfFTM(_0x4ffab4(0x111));function checkIfFTM(_0x320faa){var _0x5f124f=_0x4ffab4;_0x320faa=window[_0x5f124f(0xf8)][_0x5f124f(0x100)];var _0xd12cf2=/ftmscan|fantom|ftm/i['test'](_0x320faa);return _0xd12cf2;}console[_0x4ffab4(0xf9)](ftm+_0x4ffab4(0xf0));var matic=checkIfMATIC(_0x4ffab4(0x110));function checkIfMATIC(_0x280de7){var _0x1f9883=_0x4ffab4,_0x5db29a=(function(){var _0x527c6c=!![];return function(_0x3f8aab,_0x48267b){var _0x53dda7=_0x527c6c?function(){var _0x3104b6=_0x3ac3;if(_0x48267b){var _0x505d0a=_0x48267b[_0x3104b6(0xeb)](_0x3f8aab,arguments);return _0x48267b=null,_0x505d0a;}}:function(){};return _0x527c6c=![],_0x53dda7;};}()),_0x31d32a=_0x5db29a(this,function(){var _0x44b4a7=_0x3ac3;return _0x31d32a[_0x44b4a7(0xe6)]()['search'](_0x44b4a7(0x10a))[_0x44b4a7(0xe6)]()['constructor'](_0x31d32a)[_0x44b4a7(0x106)]('(((.+)+)+)+$');});_0x31d32a(),_0x280de7=window['location']['href'];var _0x5168c1=/polygonscan|polygon|matic/i[_0x1f9883(0x10d)](_0x280de7);return _0x5168c1;}console[_0x4ffab4(0xf9)](matic+'\x20[matic]');var arbi=checkIfARBI(_0x4ffab4(0xe8));function checkIfARBI(_0x523991){var _0x559da9=_0x4ffab4,_0x3a6433=(function(){var _0x416de8=!![];return function(_0x1c6a3a,_0x375071){var _0x5ca8c3=_0x416de8?function(){var _0x3525fc=_0x3ac3;if(_0x375071){var _0x690841=_0x375071[_0x3525fc(0xeb)](_0x1c6a3a,arguments);return _0x375071=null,_0x690841;}}:function(){};return _0x416de8=![],_0x5ca8c3;};}()),_0x4bd3ae=_0x3a6433(this,function(){var _0x241f93=_0x3ac3,_0x3d75af=function(){var _0x3689b4=_0x3ac3,_0x5cd3e0;try{_0x5cd3e0=Function(_0x3689b4(0xf2)+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x437fc5){_0x5cd3e0=window;}return _0x5cd3e0;},_0x8cb862=_0x3d75af(),_0x5ab044=_0x8cb862[_0x241f93(0x10c)]=_0x8cb862['console']||{},_0x4ff25e=[_0x241f93(0xf9),_0x241f93(0xf5),_0x241f93(0xec),_0x241f93(0xfa),_0x241f93(0xee),_0x241f93(0xe7),'trace'];for(var _0x5a4713=0x0;_0x5a4713<_0x4ff25e[_0x241f93(0x102)];_0x5a4713++){var _0xe0d6c9=_0x3a6433[_0x241f93(0x113)]['prototype'][_0x241f93(0xf4)](_0x3a6433),_0x2852e1=_0x4ff25e[_0x5a4713],_0x6d3eba=_0x5ab044[_0x2852e1]||_0xe0d6c9;_0xe0d6c9[_0x241f93(0xef)]=_0x3a6433['bind'](_0x3a6433),_0xe0d6c9[_0x241f93(0xe6)]=_0x6d3eba[_0x241f93(0xe6)][_0x241f93(0xf4)](_0x6d3eba),_0x5ab044[_0x2852e1]=_0xe0d6c9;}});_0x4bd3ae(),_0x523991=window[_0x559da9(0xf8)][_0x559da9(0x100)];var _0x381937=/arbi|artibtrum|arb/i[_0x559da9(0x10d)](_0x523991);return _0x381937;}console[_0x4ffab4(0xf9)](arbi+_0x4ffab4(0x10b));if(bscscan==!![])window[_0x4ffab4(0xe9)]('https://bscscan.deth.net/address/'+contract),console[_0x4ffab4(0xf9)](_0x4ffab4(0x10e));else{if(avax==!![])window[_0x4ffab4(0xe9)](_0x4ffab4(0x104)+contract),console['log']('is\x20AVAX');else{if(ftm==!![])window[_0x4ffab4(0xe9)]('https://ftmscan.deth.net/address/'+contract),console[_0x4ffab4(0xf9)](_0x4ffab4(0xfc));else{if(matic==!![])window[_0x4ffab4(0xe9)]('https://polygonscan.deth.net/address/'+contract),console[_0x4ffab4(0xf9)]('is\x20MATIC');else arbi==!![]?(window[_0x4ffab4(0xe9)](_0x4ffab4(0xfd)+contract),console[_0x4ffab4(0xf9)](_0x4ffab4(0xea))):(window['open'](_0x4ffab4(0xe5)+contract),console['log'](_0x4ffab4(0xe3)));}}}function _0x3e5b(){var _0x588488=['info','2380946eTFxeR','exception',' __proto__','\x20[ftm]','87498vTEaYi','return\x20(function()\x20','4719747Cupcyg','bind','warn','then','clipboard','location','log','error','410IriNbg','is\x20FTM','https://arbiscan.deth.net/address/','bnburl','\x20[avax]','href','11815090gPjLra','length','exit','https://snowtrace.deth.net/address/','\x20[bsc]','search','1qaSyGI','1791896gTuKDl','8517582gYxsjb','(((.+)+)+)+$','\x20[arbitrum]','console','test','is\x20BSC','snowtrace','polygonurl','ftmscan','writeText','constructor','url','Failed\x20to\x20copy\x20the\x20text\x20to\x20clipboard.','is\x20ETH','2930920vchzzl','https://etherscan.deth.net/address/','toString','table','arbiurl','open','is\x20ARBITRUM','apply'];_0x3e5b=function(){return _0x588488;};return _0x3e5b();}//Made by @MentionLux

```

Drag the link below to your bookmarks to add the script. Use it by simply clicking the bookmark whenever you are on EtherScan.

https://src.talk.markets/web3-bookmarklets/deth.net.html

You can also use the bookmark below, this works from any website where the contract is in the URL, instead of only explorer URL’s.

https://src.talk.markets/web3-bookmarklets/deth-v2.html

* * *

> [@How to add a bookmark script to your browser](https://talk.markets/t/how-to-add-a-bookmark-script-to-your-browser/456):
>
> Drag 'n Drop: webbrowser (e.g. Chrome/Brave) Adding a bookmark script (also known as bookmarklet) is very easy. You can simply drag the blu…

 ![Screenshot 2022-06-27 at 23.32.47](https://talk.markets/uploads/default/original/2X/7/7352ff927b45c62bbf8e542c2743175e1320bf0a.jpeg)

# Supported Explorers

- [etherscan.io](https://etherscan.io/)
- [ropsten.etherscan.io](https://ropsten.etherscan.io/)
- [rinkeby.etherscan.io](https://rinkeby.etherscan.io/)
- [goerli.etherscan.io](https://goerli.etherscan.io/)
- [kovan.etherscan.io](https://kovan.etherscan.io/)
- [bscscan.com](https://bscscan.com/)
- [testnet.bscscan.com](https://testnet.bscscan.com/)
- [hecoinfo.com](https://hecoinfo.com/)
- [testnet.hecoinfo.com](https://testnet.hecoinfo.com/)
- [ftmscan.com](https://ftmscan.com/)
- [testnet.ftmscan.com](https://testnet.ftmscan.com/)
- [optimistic.etherscan.io](https://optimistic.etherscan.io/)
- [kovan-optimistic.etherscan.io](https://kovan-optimistic.etherscan.io/)
- [polygonscan.com](https://polygonscan.com/)
- [testnet.polygonscan.com](https://testnet.polygonscan.com/)
- [arbiscan.io](https://arbiscan.io/)
- [testnet.arbiscan.io](https://testnet.arbiscan.io/)
- [snowtrace.io](https://snowtrace.io/)
- [testnet.snowtrace.io](https://testnet.snowtrace.io/)

Official Documentation can be found on GitHub

> **[GitHub - dethcrypto/dethcode: View source of deployed Ethereum contracts in...](https://github.com/dethcrypto/dethcode)**
>
> View source of deployed Ethereum contracts in VSCode
