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.
A Stacks smart contract stores user BTC price prediction and verifies accuracy with an AMM pool.
This smart contract is for a prediction game. The game lets users predict whether BTC prices will increase or decrease in the following 100 Bitcoin blocks (approximately 16 hours). After 100 Bitcoin blocks, admin calls verify with the correct Stacks block height without needing to provide BTC prices, as BTC prices can be retrieved from ALEX AMM pools with the at-block function.
AFAIK, currently, there is no way to get Bitcoin block height from Stacks block height and vice versa. Getting Bitcoin block height in the at-block function still returns the latest height. That's why verify can be called by admin only. At least the verified result is transparent, and the admin can re-verify with the correct Stacks block height.
After #1615 is fixed, verify will be more robust and can be called by anyone.