fix(contracts): oracle auth, unknown types, and payout overflow#458
Merged
ChaoLing140 merged 5 commits intoJun 2, 2026
Merged
Conversation
Resolves ChaoLing140#386 Signed-off-by: jacktruedream <jacktruedream@qubzes.com>
Resolves ChaoLing140#385 Signed-off-by: jacktruedream <jacktruedream@qubzes.com>
Resolves ChaoLing140#384 Signed-off-by: jacktruedream <jacktruedream@qubzes.com>
Resolves ChaoLing140#383 Signed-off-by: jacktruedream <jacktruedream@qubzes.com>
|
@jacktruedream Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
🎉 This PR is included in version 1.32.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Fixed four critical contract issues: reserve ratio boundary tests, unknown oracle type rejection, oracle trigger authorization, and checked addition for payout accounting.
Issues Resolved
Closes #386
Closes #385
Closes #384
Closes #383
Changes
#386 - Add tests for reserve ratio boundary values
Added tests for reserve ratio boundary values (0, 10000, and above 10000) to ensure proper validation of the reserve ratio parameter.
#385 - Avoid treating unknown oracle types as smart contract oracle
Modified verify_oracle_condition to explicitly check for Weather, Flight, Price, and SmartContract oracle types, returning an error for unknown types instead of defaulting to SmartContractOracle.
#384 - Add admin auth to oracle trigger evaluation
Added caller authentication to evaluate_oracle_trigger, requiring the caller to be either the registered oracle address or the admin to authorize trigger evaluation.
#383 - Use checked addition for total payout accounting
Replaced unchecked addition with checked_add() for total payout updates to prevent overflow panics and provide proper error handling.