Skip to content

Add max cost cap to Predict mint#1075

Open
emmazzz wants to merge 6 commits into
mainfrom
emma/predict-mint-max-cost
Open

Add max cost cap to Predict mint#1075
emmazzz wants to merge 6 commits into
mainfrom
emma/predict-mint-max-cost

Conversation

@emmazzz

@emmazzz emmazzz commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Require max_cost on the existing Predict mint entrypoint and internal mint path.
  • Abort with EMintCostAboveMax when the all-in mint withdrawal exceeds the cap.
  • Add focused flow coverage for exact-cap success and cap-underflow abort.

Key decisions

  • Keep the cap non-optional; callers can pass std::u64::max_value!() for uncapped behavior.
  • Split mint preparation/payment helpers so fixed-cost mint can stack separately without duplicating flow gates.

Test plan

  • sui move test --path packages/predict mint_slippage --gas-limit 100000000000
  • sui move build --path packages/predict --warnings-are-errors
  • sui move test --path packages/predict --gas-limit 100000000000

@emmazzz emmazzz marked this pull request as ready for review June 17, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants