Add constraints to examples in dapps/ needed to prevent overflow. #443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@marcinjangrzybowski asked me to come up with some examples of what index type constraints would look like in glow. This PR is a first step; it adds annotations that would become necessary for our existing apps in
dapps/
to type check (and adds comments explaining what's going on). I'm pleased to see that it's already catching real bugs (if ones that are unlikely to come up in practice).I'm going to mark this as a draft; we should not merge this, but it seemed like an easy way to get the diff in front of your eyes.
I plan to also look up some representative overflow exploits to see how this would apply to those as well.