Enhance contracts with driver authorization and platform fee management#121
Merged
Conversation
… authorization and reputation penalty logic; add platform fee management to settlement contract
|
@promisszn 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
callerparameter toadd_driver_to_fleetwith a code-level ownership check (matching the pattern already used byupdate_fleet_treasury), and added tests that confirm non-owners are rejected withUnauthorizedadd_evidence_hashwas already implemented; fixed a pre-existing test failure inresolve_dispute_refund_sender(mock delivery missing driver) and made the reputation penalty conditional so the dispute contract degrades gracefully when no identity contract is configuredexecute_settlement_swapalready enforcedmin_amount_out; added missingtestutilsdev-dependency that was causing compilation failure, introduced a mock router in tests, and added full slippage coverage for both same-asset and cross-asset pathsPlatformFeeBpsstorage key,set_platform_fee_bps(admin-only, capped at 10%) andget_platform_fee_bpsfunctions; cross-asset swaps now route output through the contract before forwarding net amount to recipient; same-asset transfers deduct fee before sending; fee is collected by the admin addressTest results
130 tests across the workspace — 0 failures.
Closes #74
Closes #78
Closes #92
Closes #93