Repository navigation
Fix: 4 issues (#1689, #1690, #1691, #1692) - #1814
Merged
hman38705 merged 3 commits intoOct 19, 2026
Merged
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
|
@AMV-AUTOS 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! 🚀 |
…e agent) - contracts/predict-iq/src/errors.rs: merged [markers] — model resolved the conflict markers Co-authored-by: Simple Agent <agent@simple.dev>
…e agent) - contracts/predict-iq/src/errors.rs: merged [markers] — model resolved the conflict markers Co-authored-by: Simple Agent <agent@simple.dev>
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.
Closes #1689
Closes #1690
Closes #1691
Closes #1692
Issues
#1689 Market creator cannot reclaim the creation deposit on a cancelled market unless they also placed a bet
#1690 Token-mismatch and missing-bet paths return misleading error codes
#1691 Governance guardian-removal voting reuses AlreadyVotedOnUpgrade and GuardianNotSet for unrelated failures
#1692 cancel_market_vote has no voting-period check and an unchecked tally sum
Summary
New error codes must be appended after the current maximum (161) to avoid renumbering existing codes, which would break clients and the docs drift test. The docs table is generated by scripts/check-contract-errors.js, so edit errors.rs first and regenerate rather than hand-editing the table. For #1689, prefer restructuring withdraw_refund so the creator-deposit branch is evaluated before the bet lookup, and extend release_creation_deposit to accept Cancelled; keep the zero-before-transfer ordering to prevent double refunds. For #1692, reuse the 72h voting window constant used by finalize_resolution and define an explicit quorum constant; return ArithmeticOverflow on checked_add failure. Run the full contract test suite and the frontend drift test after changes.
Changes
total_votes += ...with checked_add returning ErrorCode::ArithmeticOverflow (or Overflow) on overflow. Keep the existing checked_mul/checked_div threshold math. (contracts/predict-iq/src/modules/cancellation.rs)node scripts/check-contract-errors.js --writeafter updating errors.rs, so the new variants (InvalidToken, AlreadyVotedOnRemoval, RemovalNotPending, RemovalExpired) appear with correct codes and descriptions, and update the Error Groups section to place them under Betting and Voting & Governance respectively. (docs/CONTRACT_ERRORS.md)