Verify source code on Etherscan
Since web3 is verifiable, we will discuss the tools to verify the code we are interacting with
Last updated
Since web3 is verifiable, we will discuss the tools to verify the code we are interacting with
Last updated
Now that we have navigated to out contract address in Etherscan we will be able to verify that the functions that exist in the contract are the ones we are expecting to be there.
To do this, first select the tab labeled Contract
We can see three "views" - the bytecode (the machine-readable version of our Solidity contract!), opcodes view and the similar contracts view. Since we have access to the original source code for this Register contract, we can Verify and Publish the code that we have associated with the contract address.
We will need to complete the forms information in our case, we will select
Solidity (Single File): since our file is a simple single file contract
Compiler v0.8.19+commit.hash: this was defined in our pragma portion of the Solidity code (the second line in our Register.sol file)
License Type: MIT as defined in our code also (In production, you will need to research and select the License that best fits your organizations needs).
On the next screen we will paste the human-readable Solidity Code into the Enter the Solidity Contract Code Below.
Complete by selecting the captcha at the bottom and submit using Verify and Publish. Upon Successful Completion you will receive the following screen:
While this is easy for you to do with your own code, you can also use this function to verify that other contract addresses have the smart contract code that is claimed to be there (provided you have the original Solidity code for that contract!).
Now you are ready to start interacting with Web3 at large!