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

Allow contract state to be read (but not written to) from pure code #384

Open
jjcnn opened this issue Jan 15, 2019 · 1 comment
Open

Allow contract state to be read (but not written to) from pure code #384

jjcnn opened this issue Jan 15, 2019 · 1 comment

Comments

@jjcnn
Copy link
Contributor

jjcnn commented Jan 15, 2019

It is sometimes necessary to perform a recursive check for the contents of a map.

An example is the Shogi contract, where the board is represented as a map, and where we need to check that when a piece moves from square A to square B, no intervening square is occupied by another piece.

This check needs to happen using recursion, which puts us in the pure part of Scilla where map reads can only happen on a copy of the board map, not directly on the map in the contract state.

It would be more convenient and probably also more efficient to be able to read from the map during the recursive traversal, and in general read from the contract state in the pure part of Scilla.

@vaivaswatha
Copy link
Contributor

@jjcnn is this also related to #254 ?

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

2 participants