Skip to content
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

feat(snapshot): post-processing outputs #203

Closed

Conversation

solidoracle
Copy link
Contributor

@solidoracle solidoracle commented Nov 27, 2023

fixes #177

@Jon-Becker
Copy link
Owner

I'll take a look tonight!

@Jon-Becker
Copy link
Owner

good start! there are still a few conditionals slipping through :)

image

core/src/snapshot/postprocessers/postprocess.rs Outdated Show resolved Hide resolved
core/src/snapshot/postprocessers/postprocess.rs Outdated Show resolved Hide resolved
@solidoracle
Copy link
Contributor Author

solidoracle commented Dec 5, 2023

good start! there are still a few conditionals slipping through :)

image

In these expressions there are an odd number of parenthesis, so the find_balanced_encapsulator is not finding the closing one.
I've pushed a temporary fix removing the initial odd parenthesis, and added test_double_negation to share my thinking.
Let me know your thoughts.
Ignore the println, will remove once finalised
@Jon-Becker

@Jon-Becker
Copy link
Owner

Sounds good! i'll review tonight :)

Copy link
Owner

@Jon-Becker Jon-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great so far!

core/src/snapshot/analyze.rs Outdated Show resolved Hide resolved
core/src/snapshot/postprocessers/postprocess.rs Outdated Show resolved Hide resolved
core/src/snapshot/postprocessers/postprocess.rs Outdated Show resolved Hide resolved
cleaned = simplify_parentheses(&cleaned, paren_index);
} else {
// remove double negation, if one exists
if cleaned.contains("!!") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if statement might be redundant, since replace will replace nothing if !! doesnt exist in the string.

core/src/snapshot/postprocessers/postprocess.rs Outdated Show resolved Hide resolved
}

#[test]
fn test_double_negation() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where I was confused -- in fact we should expect:
if (storage[keccak256(memory[0])] == Oxfffffffffffffffffffffffffffffffffffffffff)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that makes sense to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really struggling on these nested negations like !(!(...)), maybe I could put up another issue in case someone wants to help?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can help out with this!

@Jon-Becker
Copy link
Owner

pending #290 :)

ill tackle soon!

@Jon-Becker Jon-Becker closed this May 7, 2024
@Jon-Becker
Copy link
Owner

closing as snapshot is being removed in 0.8.0, as its just a simplified decompile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement post-processing for snapshot outputs
2 participants