Skip to content

Conversation

@caieu
Copy link
Contributor

@caieu caieu commented Nov 10, 2025

Description

  • Adds minimum transfer after claim

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds a balance check and optionally appends a USDC transfer to claim transactions when signer collateral is below a minimum threshold; updates claim transaction shape and tests.

  • Polymarket Provider
    • prepareClaim: checks signer collateral via getBalance and sets includeTransferTransaction when balance < MIN_COLLATERAL_BALANCE_FOR_CLAIM.
    • Returns claim transactions as an array (not a single object).
  • Safe Utils
    • createClaimSafeTransaction: optionally appends an ERC20 transfer (USDC) to the signer and aggregates via multisend.
    • getClaimTransaction: accepts includeTransferTransaction, using signer address when true.
  • Constants
    • Introduces MIN_COLLATERAL_BALANCE_FOR_CLAIM = 0.5 and uses collateral/decimals in transfer encoding.
  • Tests
    • Update provider and safe utils tests to expect array-based claim transactions and to cover transfer-inclusion cases across balance thresholds.

Written by Cursor Bugbot for commit 8abd446. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-predict Predict team label Nov 10, 2025
@caieu caieu marked this pull request as ready for review November 10, 2025 22:04
Copy link
Contributor

@matallui matallui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment on updating the top-up calculations, but not blocking for this PR. We can address that later. 🚀

Comment on lines +650 to +653
value: parseUnits(
MIN_COLLATERAL_BALANCE_FOR_CLAIM.toString(),
COLLATERAL_TOKEN_DECIMALS,
).toBigInt(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal should be to top up the account up to $1, not just add 0.5 when it's below that. I do think this is pretty good for this PR though, just to give something to Confirmations team. We can always update that logic later.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@caieu caieu enabled auto-merge November 11, 2025 02:09
@matallui matallui added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Nov 11, 2025
@caieu caieu added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 06ff8af Nov 11, 2025
158 of 161 checks passed
@caieu caieu deleted the chore/predict-claim-transfer branch November 11, 2025 05:09
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-L skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants