feat: opt-in backstop pool for slashed-intent user compensation - #334
Open
Keengfk wants to merge 1 commit into
Open
feat: opt-in backstop pool for slashed-intent user compensation#334Keengfk wants to merge 1 commit into
Keengfk wants to merge 1 commit into
Conversation
- Add DataKey::BackstopPool (instance) and BackstopClaimed(BytesN<32>) (persistent) storage keys - Add Error::BackstopPoolEmpty=35 and BackstopAlreadyClaimed=36 - Add MAX_BACKSTOP_BPS (5 000) and MAX_BACKSTOP_CLAIM_BPS (100) constants - Add missing constants: DEFAULT_MIN_BOND, DEFAULT_FILL_WINDOW, DEFAULT_INTENT_EXPIRY, DEFAULT_PROTOCOL_FEE_BPS, MAX_PROTOCOL_FEE_BPS, MIN_FILL_WINDOW_SECS, MIN_INTENT_EXPIRY_SECS, MIN_BOND_FLOOR, SLASH_COOLDOWN, CANCEL_COOLDOWN, MAX_BATCH_SIZE, MAX_EXTENSION_DURATION - Add missing DataKey variants: Config, PendingAdmin, AllowedDstTokenList, PendingDstTokenAdd, PendingDstTokenRemove, MinBondMultiplier, UserIntents, CancelCooldown, ExtensionGranted - Fix Error enum duplicate discriminants; add TimelockNotElapsed=26, NoPendingAdminTransfer=27, NoPendingDstTokenChange=28, InvalidSrcToken=29, AmountTooLarge=30, InvalidConfig=31, CancelCooldownNotExpired=32, SrcChainNotAllowed=33, RescueProtectedToken=34 - Add backstop_bps: i128 field to ProtocolConfig (default 0 = dormant) - Update set_config to accept and validate backstop_bps (0..=MAX_BACKSTOP_BPS) - Modify slash_solver: divert backstop_bps share into BackstopPool before transferring remainder to fee_recipient (CEI discipline preserved); event payload extended to (intent_id, slash_amount, backstop_amount) - Add claim_backstop_compensation entrypoint: user calls once per intent, payout capped at MAX_BACKSTOP_CLAIM_BPS (1%) of pool, min 1 stroop; BackstopClaimed flag prevents double-claims across re-slash cycles - Add get_backstop_pool view function - Add get_pending_admin view function (was missing) - Fix fill_intent: remove duplicate premature token transfers (triple-send bug) - Fix existing tests: pass &caller to pause() (was zero-arg in 3 tests) - Add backstop pool test suite: accumulation, successful claim, double-claim rejection, empty pool / bps=0 rejection, config validation tests
|
@Keengfk 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 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.
Summary
Related issue
Type of change
Component
vortex-contract)vortex-backend)vortex-frontend)Checklist
Screenshots / notes
closes #280