New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Using Etherscan

BaseMon, Oct 9, 2023, 12:00 AM

Use Etherscan: a blockchain explorer for various networks. Discover how to explore blocks, transactions, and contract details. Interact with contracts, verify source code, and test functions. Safely navigate the blockchain world and find valuable insights for your development journey! 🚀🔍 📚 Head to Base Camp for full courses on smart contract development: https://docs.base.org/base-camp/docs/welcome ✅ Subscribe to our channel here: https://www.youtube.com/@BuildonBase ► Build on Base: https://base.org ► Follow us on Twitter: https://twitter.com/buildonbase ► Join our Discord: https://base.org/discord

Transcript

etherscan is a popular blockchain explorer that works for several different networks in it you can take a look at the latest blocks explore what is in those blocks by clicking at them get a list of information about when the block was created what transactions are in it and so on and so forth there are many variations of ether scan for different networks such as the Gorly test Network for polygon and its test Network and coinbases base score early test Network one of the more interesting things that you can do with etherscan is you can use it to interact with your contracts or even other people's for example the popular board ape Yacht Club collection of nfts is deployed on mainnet and you can see a Marketplace for those nfts on openc but you can also find them on etherscan and look at the contract itself be careful when you're searching for these contracts because sometimes you can find the address of a fake or a copy and you don't want to do anything accidentally one way to find the correct contracts is to find them on open C or another reputable website and see if they have a link such as this one that will let you view the contract on etherscan looking at the contract we can see some information such as its eth balance any tokens it's holding the Creator what transaction it was created in and other information you can also review a list of all of the recent transactions for that contract and get an idea of what's going on one of the more interesting and useful tabs for developers is the contract tab in this tab if you verified or if someone has verified the source code for this contract then you can see it you can review all of the parts of the contract and take a look at how it's constructed this is important to keep in mind when you're developing although you don't have to verify your source code quite often the community expects you to because one of the ideals of blockchain and on-chain development is that it is open in public but doing so comes with some risks uh instead of any attackers having to decompile your code from byte code and not get any comments or notes or the names of functions everyone who wants will get a copy of your source code and can look for exploits and vulnerabilities but the great thing when you're learning is you can actually look at the source code and find out how developers of popular programs accomplished what they accomplished you can also interact with the contracts directly through etherscan in a similar way to how you might have been doing with remix if we go to the read contract tab we'll see a list of functions that are public and we can interact with them for example this is an ERC 721 contract so it implements owner of and we can find out which address is the owner of any particular number that we pick and we can see the owner of token number 150. so we can also write to the contract we could click the connect to web 3 button and attempt to interact with it but since this is on mainnet that would be expensive and I don't have permission to do anything anyway because I sadly do not own a board ape but what we can do is we can go to a different contract for example we could go to the base squarely Network Explorer and we can look up the address of one of our contracts so in this case this is the contract that manages the tests for the basic contracts pin that you may have earned earlier in this series and we can take a look at the contract again we can read the contract we can look at all of the public functions and find out the owner of token number 50 and get that address we can also go to write contract and see all of the functions that are available here so we'll click this button to connect to web3 pick our coinbase wallet this is a beta feature so sometimes it's doesn't always refresh or do things correctly so let's try that again see they give you a warning they're just beta okay and this time it worked That's Not Unusual to have to do this a couple of times click it reset it um so just keep that in mind when you're working with base scan okay so we can see a list of all of the functions that are available that are marked as public uh remember if you mark a contract as public any address any wallet anywhere can call it whenever they want and they're only restricted by what you allow them to do for example if we didn't have the set Yuri function protected and in this case it is then anyone who wanted could change the token address for your nfts and change what they look like so another reminder to be careful when you're developing you can use this panel to test your functions after they're deployed on one of the test networks in a live environment it's very useful in the same way that the deploy panel and remix worked where you can interact with your contract without needing to build a front end and that's about it for an overview of etherscan we encourage you to jump in take a look and explore and see what else you can find

Automatic transcript — names and jargon may be misspelled.