P4: Tip Forwarding Module — Design & Implementation Plan#85
Draft
ccp-manash wants to merge 3 commits intofeat/proposal-p4from
Draft
P4: Tip Forwarding Module — Design & Implementation Plan#85ccp-manash wants to merge 3 commits intofeat/proposal-p4from
ccp-manash wants to merge 3 commits intofeat/proposal-p4from
Conversation
Comprehensive design and implementation plan for making tip forwarding an optional module via hook pattern in KeepWhatsRaised, based on analysis from 10 independent perspectives (security, gas, proxy, Permit2, accounting, factory, testing, off-chain alternatives, integration, audit). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
I don't understand anything here, just trying to help out Suvadra with vibe planning 😂 |
KeepWhatsRaised changes (minimal, backward-compatible): - 5 storage mappings private→internal for child contract access - _pledge() private→internal virtual for override New KeepWhatsRaisedWithTipForwarding contract: - Admin path (setFeeAndPledge): deducts tip from pledgeAmount, only transfers effective pledge. Tip stays with admin. - Permit2 path: transfers full amount via Permit2, forwards tip to platformAdmin after all state updates (CEI compliant). - TipForwarded event, TipExceedsPledgeAmount error Includes: deployment script, shared test setup, unit + security tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Design doc and implementation plan for P4 (Tip Forwarding in
setFeeAndPledge), implemented as an optional separate module rather than modifying the core KeepWhatsRaised flow._pledge()into_handleTip()internal virtual, child contract overrides to forward tips atomicallyimplementationMapalready supports multiple implementations viaimplementationId_handleTip()preserves current accumulate-and-claim patternWhat's in this PR
Design document only (
docs/proposals/P4-tip-forwarding-module-design.md). No code changes yet — this is for SC team review and alignment before implementation.Key design decisions for review
setFeeAndPledge, zero contract changes) is fully viable if deferredclaimTip()is acceptableclaimTip()behavior — no-op in forwarding variant (handles fallback-stored tips). Should it revert instead?claimRefund()/disburseFees()lacknonReentrant, tip-only pledges create phantom NFTs. Separate PR?Design doc sections
Proposal reference
https://hackmd.io/@vaki/SypnuDM_Wg#4-P2-Tip-Forwarding-in-setFeeAndPledge
Test plan
🤖 Generated with Claude Code