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

Remote read of contract parameters #1035

Open
jjcnn opened this issue Jul 22, 2021 · 3 comments · May be fixed by #1220
Open

Remote read of contract parameters #1035

jjcnn opened this issue Jul 22, 2021 · 3 comments · May be fixed by #1220
Labels
enhancement New feature or request
Milestone

Comments

@jjcnn
Copy link
Contributor

jjcnn commented Jul 22, 2021

We currently only support remote reads of the mutable state of a contract, but not of the immutable state (the contract parameters).

To support this we need the following:

  • A syntax for contract parameters in address types. Contract parameters may have the same name as a field, so we need to be able to distinguish syntactically between a remote field and a remote contract parameter. One idea is ByStr20 with contract (x : Uint128) ... end.
  • A syntax for remote reads of contract parameters. One idea is x <-& c.(x).
  • On the C++ side, a way to fetch the value of a contract parameter. One suggestion is that we add contract parameters to the levelDB database with a suitable prefix (e.g., _cparam_<parameter name>), so that we can fetch them in the same way as we do for mutable fields, but that requires a database migration.
@anton-trunov
Copy link
Contributor

Resolving this issue would simplify contract auditing. As of now contract writers create read-only contract fields initialized with immutable contract parameters to be able to read those. And the dead code detector reports these fields in warning which can be distracting from actual errors when the contract author forgot to put in code that updates a field.

@anton-trunov anton-trunov added this to the Scilla 0.13.0 milestone Aug 18, 2022
@anton-trunov anton-trunov added the enhancement New feature or request label Aug 18, 2022
@anton-trunov
Copy link
Contributor

This has been asked to be implemented by some users. CC @chetan-zilliqa

@jjcnn
Copy link
Contributor Author

jjcnn commented Sep 16, 2022

Moving this to v0.14. It's an important issue, but because of the integration with the state database we won't have time to do it in time for v0.13.

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

Successfully merging a pull request may close this issue.

2 participants