Skip to content

Conversation

@clement-ux
Copy link
Collaborator

@clement-ux clement-ux commented Jan 22, 2026

Summary

  • Consolidated campaign management: Merged three separate functions (manageTotalRewardAmount, manageNumberOfPeriods, manageRewardPerVote) into a single manageCampaign function that can update any combination of parameters in one cross-chain call
  • Simplified bridge fee handling: Changed all external functions to payable, removing the explicit bridgeFee parameter and using msg.value directly
  • Flexible reward amount handling: The new manageCampaign accepts a totalRewardAmount with special semantics (0 = no update, type(uint256).max = use all contract balance, other = specific amount capped by balance)

Changes

CurvePoolBooster.sol

createCampaign

  • Removed bridgeFee parameter, now uses msg.value for bridge fee
  • Function is now payable

manageCampaign (new - replaces 3 functions)

  • Replaces manageTotalRewardAmount, manageNumberOfPeriods, and manageRewardPerVote
  • Accepts all parameters at once, uses 0 as "no change" sentinel value
  • Uses msg.value for bridge fee

closeCampaign

  • Removed bridgeFee parameter, now uses msg.value for bridge fee
  • Function is now payable

_handleFee

  • Added overload that accepts a specific amount instead of always using full contract balance

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 5.26316% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.62%. Comparing base (6524de2) to head (aa943c5).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...acts/poolBooster/curve/CurvePoolBoosterFactory.sol 9.37% 29 Missing ⚠️
...s/contracts/poolBooster/curve/CurvePoolBooster.sol 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2762      +/-   ##
==========================================
+ Coverage   39.31%   39.62%   +0.30%     
==========================================
  Files         126      126              
  Lines        5802     5825      +23     
  Branches     1542     1546       +4     
==========================================
+ Hits         2281     2308      +27     
+ Misses       3519     3515       -4     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clement-ux clement-ux marked this pull request as ready for review January 22, 2026 15:10
Copy link
Member

@sparrowDom sparrowDom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of comments otherwise looks good

IERC20(rewardToken).safeTransfer(feeCollector, feeAmount);
emit FeeCollected(feeCollector, feeAmount);

return IERC20(rewardToken).balanceOf(address(this));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we did another balanceOf check here because of the worry that after transferring fees out, there might be reward tokens (like our OUSD & OETH) where after sending the feeAmount the remaining balance wouldn't equal: remainingBalance = previousBalance - feeAmount because of the potential rounding in the underlying token contracts.

I think we should call balanceOf again. Or add extra math that will deduct 1 WEI for any potential rounding issues.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and we should put comments explaining this in the file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, good idea. Fixed in this commit: ffd591e

function _handleFee() internal returns (uint256) {
// Cache current rewardToken balance
uint256 balance = IERC20(rewardToken).balanceOf(address(this));
require(balance > 0, "No reward to manage");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we previously had this require(balance > 0, "No reward to manage"); but I am not sure it is preferable that this function ever reverts. Because then the whole manageBribes from the BribesModule will revert. And all that is needed is that somehow yield forwarding is stopped or that contract for some other reason doesn't have the reward token balance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Fixed in this commit: 57f37c4

sparrowDom
sparrowDom previously approved these changes Jan 22, 2026
Copy link
Member

@sparrowDom sparrowDom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* Enhance CurvePoolBooster and Factory: Add CurvePoolBoosterPlain.

* move curvePB to dedicated folder
@clement-ux clement-ux merged commit 7fbff1d into master Jan 23, 2026
10 of 17 checks passed
@clement-ux clement-ux deleted the clement/curvePB-improvement branch January 23, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants