Contract Pages
Watchdog includes dedicated pages for blockchain addresses, whether they are contracts or EOAs (Externally Owned Accounts). These pages provide information about the address's code, transactions, storage, and more.
Code Sections
Source Code
For some addresses, developers have opted to make the source code of the smart contracts publicly available. You can find it under the "Source" tab.
In the source code section, you can access the warnings panel to review the vulnerabilities detected in this contract through our static analysis. To open the warnings panel, select the 'Warning' button located on the top left of the screen. The warnings that are displayed by default are those with higher confidence levels. However, you may choose to view all warnings by toggling the "Show likely / all" switch. To view the location of a specific warning, simply click on it and the code line containing the warning will be scrolled into view.
Decompiled Code
The original source code of a contract may not always be available. In such cases, it can be useful to examine the decompiled code. The decompiled code is our best effort to reconstruct the contract's source code from its on-chain bytecode.
To get an overview of the decompiled code, open the "Functions" panel by clicking the "Functions" button on the top left. There, you will find all the function signatures defined in the contract. You may filter and sort them using the buttons at the top of the panel. Click on a function signature to view its definition, which will be scrolled into view.
Through the decompiled code section, you can access a contract's storage via the "Storage" panel. To open the "Storage" panel, either click the "Storage" button on the top left or click the storage location of interest on the code editor. (The interactive code lines are shown with an arrow on their left.)
Keep in mind that you may need to change the encoding of the result of the storage access, as all primitive types are interpreted as uint256
. Strings are also interpreted as uint256[]
.
3-address Code
The Ethereum Virtual Machine operates as a stack machine. To conduct our static analysis, we convert the stack machine code, run by the EVM, into 3-address code. You can find this code in the "3-address code" section under "Code".
Disassebled Code
Sometimes it is useful to know the exact opcode run by the EVM. You can find the Stack Machine Code that compiles to the on-chain bytecode under the "Disassembled" code tab.
ABI
The ABI is essential for the deployment and execution of smart contracts, as it allows other programs to interact with the contract without needing to understand its underlying code. Such interactions include the integration of a smart contract with a Decentralized Application. You can find a contract's ABI under the "ABI" tab.