Skip to content

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Apr 24, 2025

Fix CheckWitnessUsageAnalyzer to check if result is used rather than specific patterns

Changes

  • Updated the CheckWitnessUsageAnalyzer to check if the result of Runtime.CheckWitness is being used in any way, rather than requiring specific patterns
  • The analyzer now only reports an issue if the CheckWitness call is used directly as a statement without capturing the result
  • Updated error messages to be more accurate
  • GasOptimizationAnalyzer already skips checking string literals in contract attributes

Reason for changes

The previous implementation of CheckWitnessUsageAnalyzer was too restrictive, requiring specific patterns like if statements or Assert calls. The updated version recognizes that the result of CheckWitness can be used in many valid ways, such as being assigned to a variable, used in a condition, passed as a parameter, etc.

@Jim8y Jim8y changed the title Improve storage analyzer docs Improve contract syntax analyzer Apr 24, 2025
@Wi1l-B0t
Copy link
Contributor

UT failed?

@Jim8y Jim8y requested a review from shargon May 26, 2025 04:01
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

@Jim8y can this be made in smaller PRs?

@Jim8y
Copy link
Contributor Author

Jim8y commented Jun 5, 2025

@Jim8y can this be made in smaller PRs?

Its large because it enforce the requirement of contact arttributes,,,,, so as long as that analyer is added, pr will be as large as this one..... since all artifcts will be udpated simultaneously

Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

If 'ts generated automatically we should fix it

}
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Why all ends in double empty lines?

@Jim8y Jim8y changed the base branch from master to dev June 20, 2025 11:58
@Jim8y Jim8y force-pushed the improve-storage-analyzer-docs branch from 34f6c44 to a43bcb2 Compare June 20, 2025 12:04
@Jim8y
Copy link
Contributor Author

Jim8y commented Jun 20, 2025

this will be replaced with other prs.

@Jim8y Jim8y closed this Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants