Repository navigation
fix: fee ceiling, treasury recipient validation, migrate v0 rejection, and upgrade standardization - #925
Merged
chonilius merged 1 commit intoNov 24, 2026
Conversation
…grade standardization issues
|
@Joeloo1 is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Joeloo1 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.
This PR addresses four security and consistency issues:
Changes
Fee Ceiling (Issue escrow::set_fee_bps can ratchet the protocol fee to 100% in 500-bps steps — validate_fee_change bounds the step size, not the ceiling #778): Added MAX_FEE_BPS constant (1000 = 10%) to prevent fee ratcheting to 100% through repeated set_fee_bps calls. The step limit (500 bps) prevents accidental spikes, while the ceiling prevents malicious ratcheting.
Treasury Recipient Validation (Issue escrow::release never checks that the treasury is absent from
recipients, so the treasury can be paid twice out of a single release #781): Modified compute_split to reject treasury address as a recipient. A compromised oracle can no longer route funds back to the protocol by naming treasury as a 10000-bps recipient.Migrate Version 0 Rejection (Issue escrow::migrate accepts from_version = 0 on a contract that was never initialized, writing Version = 2 onto empty instance storage #783): Explicitly reject from_version=0 in migrate() to prevent contracts that predate the Version key from incorrectly reporting v2 without actual storage migration.
Upgrade Standardization (Issue escrow::upgrade leaves DataKey::Version at the pre-upgrade value while milestones::upgrade writes it — the three contracts disagree on which call advances the version #785): Standardized upgrade behavior across all three contracts - upgrade() now only updates WASM and publishes ContractUpgraded with current version, while migrate() advances the Version.
Testing
Closes #778
Closes #781
Closes #783
Closes #785