-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display contract names in UI #1181
Conversation
f3a0d05
to
01c7227
Compare
WalkthroughThe recent updates to the Echidna tool, a security tool for Ethereum smart contracts, focus on enhancing its UI and reporting features to accommodate the analysis of multiple contracts. By introducing additional parameters to function signatures across several modules, the changes aim to improve the visibility of contract names in both the UI and JSON reports, directly addressing user feedback for clearer identification of contract interactions. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- lib/Echidna/UI.hs (2 hunks)
- lib/Echidna/UI/Report.hs (7 hunks)
- lib/Echidna/UI/Widgets.hs (3 hunks)
Additional comments: 15
lib/Echidna/UI/Report.hs (10)
- 14-14: The addition of the
Optics
import is necessary for the new functionality to work with optics in Haskell, which is a common pattern for dealing with nested data structures.- 18-18: The addition of the
Echidna.SourceMapping
module import is required for the new functionality that involves source mapping, specifically for fetching contract names based on addresses.- 38-38: The modification of the
ppCampaign
function signature to include an additionalVM RealWorld
parameter is crucial for accessing the VM state, which is necessary for retrieving contract names based on addresses.- 56-56: The modification of the
ppTx
function signature to accept an additionalVM RealWorld
parameter is necessary for the function to access the VM state, enabling it to retrieve contract names for transactions.- 73-82: The addition of the
contractNameForAddr
function is a key enhancement. It retrieves the contract name for a given address, which is central to the PR's objective of displaying contract names in the UI. This function correctly handles the possibility of not finding a contract name by falling back to displaying the address itself, which is a good practice for maintaining usability in case of missing data.- 104-104: The modification of the
ppGasInfo
function signature to include an additionalVM RealWorld
parameter is necessary for the function to access the VM state, which might be required for future enhancements related to gas information display that involves contract names.- 111-111: The modification of the
ppGasOne
function signature to include an additionalVM RealWorld
parameter is consistent with the changes made to other functions in this file, allowing it to potentially access VM state for enhanced display information.- 125-125: The modification of the
ppFail
function signature to include an additionalVM RealWorld
parameter aligns with the overall goal of enhancing the UI to display contract names, allowing this function to access VM state if needed for failure analysis.- 142-142: The modification of the
ppFailWithTraces
function signature to include an additionalVM RealWorld
parameter is necessary for accessing VM state during the display of failure traces, which may include contract names for a more informative output.- 176-176: The modification of the
ppOptimized
function signature to include an additionalVM RealWorld
parameter is consistent with the changes made to other functions, allowing it to access VM state for potentially enhanced display information related to optimized tests.lib/Echidna/UI.hs (2)
- 152-152: The update to the
ppCampaign
function call to include thevm
argument is necessary for passing the VM state to the function. This change is crucial for enabling the display of contract names in the UI, aligning with the PR's objectives.- 206-206: The update to the
ppCampaign
function call to include thevm
argument in the non-interactive output format case is consistent with the changes made for the interactive UI. This ensures that contract names can be displayed in all output formats, enhancing usability.lib/Echidna/UI/Widgets.hs (3)
- 315-315: The update to the
seqWidget
function call within thefailWidget
function to pass thevm
parameter is necessary for the function to access the VM state. This change enables the display of contract names in the failure widget, improving the information provided to the user.- 352-352: The update to the
seqWidget
function call within themaxWidget
function to pass thevm
parameter is consistent with the changes made in thefailWidget
function. This ensures that the VM state is accessible for displaying contract names in the optimization widget, enhancing clarity for the user.- 365-368: The modification of the
seqWidget
function to include an additionalVM RealWorld
parameter is crucial for the function to access the VM state. This change allows for the potential display of contract names within the sequence widget, aligning with the PR's objectives to enhance UI clarity by displaying contract names.
Closes #415, #783, #567.
Summary by CodeRabbit