Skip to content

fix(contracts): oracle auth, unknown types, and payout overflow#458

Merged
ChaoLing140 merged 5 commits into
ChaoLing140:masterfrom
jacktruedream:fix-oracle-and-payout-issues
Jun 2, 2026
Merged

fix(contracts): oracle auth, unknown types, and payout overflow#458
ChaoLing140 merged 5 commits into
ChaoLing140:masterfrom
jacktruedream:fix-oracle-and-payout-issues

Conversation

@jacktruedream
Copy link
Copy Markdown
Contributor

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.

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>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@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! 🚀

Learn more about application limits

@ChaoLing140 ChaoLing140 merged commit b210889 into ChaoLing140:master Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

🎉 This PR is included in version 1.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants