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

Detect function's effects #677

Open
anton-trunov opened this issue Aug 12, 2024 · 0 comments
Open

Detect function's effects #677

anton-trunov opened this issue Aug 12, 2024 · 0 comments
Assignees
Milestone

Comments

@anton-trunov
Copy link
Member

anton-trunov commented Aug 12, 2024

Useful, for instance, for static analysis: nowarp/misti#88.

Actually, we need to track more than purity, but effects:

  • contract state reads,
  • contract state writes,
  • blockchain state reads (e.g. time),
  • sending messages,
  • randomness.

For instance, getters can have the following set of effects: contract state reads, blockchain state reads, randomness.
Const-eval (comptime) functions must be (observationally) pure, i.e. those can only modify some internal state.

Also, showing those effects in the compilation report is important for contract audits.

@anton-trunov anton-trunov added this to the v1.5.0 milestone Aug 12, 2024
@anton-trunov anton-trunov self-assigned this Aug 12, 2024
@anton-trunov anton-trunov changed the title Detect if a function is pure Detect function's effects Aug 12, 2024
@jubnzv jubnzv mentioned this issue Aug 13, 2024
3 tasks
@anton-trunov anton-trunov modified the milestones: v1.5.0, v1.6.0 Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant