[MerklPB] Migrate PoolBoosterFactoryMerkl to Beacon Proxy#2796
Open
clement-ux wants to merge 12 commits intomasterfrom
Open
[MerklPB] Migrate PoolBoosterFactoryMerkl to Beacon Proxy#2796clement-ux wants to merge 12 commits intomasterfrom
clement-ux wants to merge 12 commits intomasterfrom
Conversation
- PoolBoosterMerkl: refactor to initializable pattern for clone compatibility - PoolBoosterFactoryMerkl: use Clones.cloneDeterministic instead of CREATE2 - Add implementation, strategist storage with governor setters - Simplify computePoolBoosterAddress to only require salt
Accept raw `bytes calldata _initData` instead of typed initialize params, making the factory implementation-agnostic. Remove merklDistributor and strategist storage/setters as they are no longer needed at factory level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check implementation is set before validating other parameters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set implementation in factory constructor and add deploy script that swaps old factory for new in the central registry and creates an initial Pool Booster. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… & factory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove onlyGovernorOrStrategist from bribe() on PoolBoosterMerklV2 to align with all other pool booster implementations (SwapxDouble, SwapxSingle, Metropolis) and make bribeAll() on the factory work correctly. The previous modifier caused bribeAll() to revert since msg.sender is the factory, not the governor/strategist. Test improvements: - Use named constant MERKL_BOOSTER_TYPE instead of magic number 3 - Add comment explaining why init revert tests check "Initialization failed" - Add withArgs check on TokensRescued event - Add removePoolBooster auth test - Add positive bribeAll test (executes bribes on funded boosters) - Remove stale minAmount comment with wrong numbers - Add note on createPoolBooster helper about || footgun Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…l() to governor Store factory address during initialize() and require bribe() caller to be factory, governor, or strategist. Override bribeAll() on PoolBoosterFactoryMerkl with onlyGovernor. Add corresponding tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop the V2 suffix — no longer needed since the old contract is gone. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bribe() now requires governor/strategist/factory caller. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…with old sonic contract The old PoolBoosterMerkl (non-clone, constructor-based) is still used on sonic. Renaming to PoolBoosterMerkl breaks the sonic factory compilation. Also fix sonic test to use strategist for bribe() and PoolBoosterMerklV2 artifact. Co-Authored-By: Claude Opus 4.6 <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
Replaces EIP-1167 minimal proxies (Clones) with OpenZeppelin Beacon Proxy pattern so that upgrading a single
GovernableBeaconautomatically upgrades all existing Merkl pool boosters — no redeployment, no re-delegation.Architecture
Upgrading: governor calls
GovernableBeacon.upgradeTo(newImpl)→ all existing pool boosters instantly use the new implementation.Changes
GovernableBeacon.sol— OZIBeaconwith OriginGovernableaccess controlPoolBoosterFactoryMerkl.sol— nowInitializablebehindInitializeGovernedUpgradeabilityProxy, deploysBeaconProxyvia CREATE2, inlines pool booster tracking (no longer inheritsAbstractPoolBoosterFactory)PoolBoosterFactoryMerklProxyinProxies.solPoolBoosterMerklV2.sol— locked implementation against direct initialization, addedcampaignType > 0validationremovePoolBoosterreverts on not found, storage gap for upgradeabilityoTokenstorage from factoryTest plan
beacon.upgradeTo()→ existing proxies use new logicremovePoolBoosterreverts when address not foundcomputePoolBoosterAddressreturns correct deterministic addressbribeAll()works across all pool boosters🤖 Generated with Claude Code