-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture Redesign: ERC1167 Minimal Proxy using clones, Improved Contract Initializations, and chore upgrades #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
- Pausing a campaign - Cancelling a campaign - Clonable with Immutable Args
- Update imports - Replace `platformBytes` with `platformHash` - Update function names
- Remove deterministic create2 deployment - Remove bytecode deployment methods - Introduce ERC1167 minimal proxy
- Add PausableCancellable functions - Refactor Reward struct - Update ERC20 with safeERC20 - Add feature to accept shipping fee - Upgrade constructor with Initializer - Remove fiat relevant functions and calculations in raised amounts - Remove preLaunch pledge functions
mahabubAlahi
requested changes
Apr 21, 2025
Collaborator
mahabubAlahi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides my comments, all the contracts LGTM.
…gnInfo implementation
- Removed addReward - Improved validation logic in `addRewards` - Combined the if conditions to make it concise - Updated the function visibily of `_pledge` - `Reordered _checkSuccessCondition`
- Added `s_tokenToPledgedAmount` to map pledged amount per token ID - Renamed `s_tokenToCollectedAmount` to `s_tokenToTotalCollectedAmount` - Update `claimRefund` function to refund full amount including pledged food and shipping fees. - Fixed issue in `claimRefund` `s_pledgedAmount` balance deduction
mahabubAlahi
requested changes
Apr 22, 2025
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For consistency, two require checking still exist in the
ItemRegistry.solandCounters.sol; they can be replaced with custom errors.
LGTM
mahabubAlahi
approved these changes
Apr 22, 2025
rayedsikder
pushed a commit
that referenced
this pull request
Dec 9, 2025
* Fix incorrect description of the `claimFund` function (#6) (immunefi)(issue#06) - Updated the NatSpec comment for claimFund() * Refactor `platformDataKey` parameter validation optimization (#7) (immunefi)(issue#09) - Move `platformDataKey` parameter validation to an earlier stage of the `createCampaign` flow * Add configuring platform data during `updateSelectedPlatform` (#8) (immunefi)(issue#10) * Add creator's non-zero validation during `createCampaign` (#9) (immunefi)(issue#16) * Add zero validation for `platformDataValue` in `createCampaign` (#10) (immunefi)(issue#12) * Add reward value zero validation in pledge (#11) (immunefi)(issue#14) * Fix `updateDeadline` allowing past deadline that blocks `claimRefund` (#12) (immunefi)(issue#05) - Added check to ensure new deadline is after current block timestamp * Fix blocking KeepWhatsRaised pledge functions via front-running (#13) (immunefi)(issue#04) - Add internal pledge ID generation using msg.sender and pledgeId * Add fee configuration via configure treasury (#14) (immunefi)(issue#11) - Update configure treasury to support fee values - Add getter function for fee value * Add campaign data validation in configure treasury (#15) (immunefi)(issue#20) - Update fee values js doc - Update custom error * Fix Gateway fee bypass (#16) (immunefi)(issue#19) - When `setFeeAndPledge` is called, tokens are transferred from the admin's wallet (msg.sender) - When `pledgeWithoutAReward` or `pledgeForAReward` is called directly, tokens are transferred from the backer's wallet * Add expected fee description in create campaign jsdoc (#17) (immunefi)(issue#03) * Refactor withdrawal and pledge calculation (#19) (immunefi)(issue#15) (immunefi)(issue#18) - Restrict access to the withdrawal function so that only the campaign owner and platform administrator can use it. - Move the protocol fee calculation from the withdrawal process to the pledge stage. - For withdrawals: - Partial Withdrawals: - Conditions: amount > 0 and amount + fees ≤ available balance. - The creator must specify the exact withdrawal amount, and the system will ensure there are sufficient funds to cover both the withdrawal and the fees. - Final Withdrawals: - Conditions: available balance > 0 and fees ≤ available balance. - The creator can withdraw the entire remaining balance. The system will check if there are enough funds to cover the fees and will then provide the remainder to the creator. --------- Co-authored-by: mahabubAlahi <mahabub@ccprotocol.xyz>
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.
Architecture Redesign: ERC1167 Minimal Proxy using clones, Improved Contract Initializations, and chore upgrades
This PR introduces significant improvements to the Creative Crowdfunding Protocol contracts architecture with cleaner code organization, improved deployment workflows, and enhanced security features.
Key Changes
Architecture Improvements
Documentation & Environment
Security Enhancements
platformBytestoplatformHashfor better semantic clarityTreasury Model Updates
claimRefundto properly handle pledge amounts and feess_tokenToTotalCollectedAmount)Breaking Changes
Please review especially the treasury factory implementation and the deployment scripts, as these represent the most significant architectural changes, as well as the refactored refund logic which fixes several accounting issues.