Since web3 is verifiable, we will discuss the tools to verify the code we are interacting with
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.
Example Register Etherscan Display
To do this, first select the tab labeled Contract
Example Contract Display on Etherscan
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.
Verify and Publish Display
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.
Example Register.sol upload contract source code
Complete by selecting the captcha at the bottom and submit using Verify and Publish. Upon Successful Completion you will receive the following screen:
Example Successful Confirmation
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!