Skip to content

[CurvePB] Improve CurvePoolBoosterBribesModule#2789

Merged
clement-ux merged 18 commits intomasterfrom
clement/improve-CurvePBBribeModule
Feb 11, 2026
Merged

[CurvePB] Improve CurvePoolBoosterBribesModule#2789
clement-ux merged 18 commits intomasterfrom
clement/improve-CurvePBBribeModule

Conversation

@clement-ux
Copy link
Collaborator

@clement-ux clement-ux commented Feb 6, 2026

Summary

  • Single manageCampaign call: Replaces 3 separate calls (manageNumberOfPeriods, manageTotalRewardAmount, manageRewardPerVote) with a single manageCampaign call, reducing gas costs and bridge fees.
  • Configurable bridge fee: The ETH bridge fee is now a storage variable (bridgeFee) with a setter, instead of being hardcoded to 0.001 ETH. Capped at 0.01 ETH.
  • ETH sent from Safe: Bridge fees are now sent directly from the Safe's balance via execTransactionFromModule value parameter, removing the requirement for each pool booster to hold ETH.
  • Fully configurable manageBribes: The parameterized overload now accepts totalRewardAmounts, extraDuration (uint8), and rewardsPerVote per pool. The no-arg version retains sensible defaults (all available rewards, +1 period, no reward rate update).
  • Configurable additionalGasLimit: Replaced the hardcoded 1000000 gas limit with a storage variable, constructor param, and setter. Capped at 10,000,000.
  • Rename POOLS to poolBoosters: Follow Solidity convention (all-caps reserved for constants/immutables) and avoid confusion with AMM pools.
  • Revert on pool not found: _removePoolBoosterAddress now reverts instead of silently no-oping when the address is not in the list.
  • Duplicate pool check: _addPoolBoosterAddress reverts with "Pool already added" if the address already exists, preventing double processing.
  • Zero address check: _addPoolBoosterAddress reverts on address(0).
  • Use calldata for pool lists: addPoolBoosterAddress now uses calldata instead of memory for gas efficiency, consistent with removePoolBoosterAddress.
  • NatSpec documentation: Full NatSpec coverage on all functions (external and internal).

- Use single `manageCampaign` call instead of 3 separate calls
- Make bridge fee configurable instead of hardcoded
- Send ETH from Safe via execTransactionFromModule instead of
  requiring pool boosters to hold ETH
- Add NatSpec documentation
@clement-ux clement-ux marked this pull request as draft February 6, 2026 18:28
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 29.41176% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.24%. Comparing base (766c645) to head (affc595).

Files with missing lines Patch % Lines
...tracts/automation/CurvePoolBoosterBribesModule.sol 29.41% 36 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2789      +/-   ##
==========================================
+ Coverage   39.02%   39.24%   +0.22%     
==========================================
  Files         126      126              
  Lines        5825     5845      +20     
  Branches     1546     1547       +1     
==========================================
+ Hits         2273     2294      +21     
+ Misses       3550     3549       -1     
  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.

Add totalRewardAmounts and extraDuration parameters to the
parameterized manageBribes overload, allowing per-pool control
over reward amounts and campaign duration. The no-arg version
retains the previous defaults (use all rewards, +1 period, no
maxRewardPerVote update). Remove redundant onlyOperator modifier
from internal _manageBribes. Update NatSpec.
Follow Solidity naming convention: all-caps is reserved for
constants and immutables. Rename mutable storage array to
lowercase. Prefix function parameters with underscore to
avoid shadowing.
_removePoolBoosterAddress previously did a silent no-op when
the address was not found. Now it reverts with "Pool not found"
to prevent masking bugs in the caller.
Refactor _addPoolBoosterAddress to accept a single address and
revert with "Pool already added" if it already exists, preventing
double processing and double bridge fees. Switch
addPoolBoosterAddress parameter to calldata for gas efficiency,
consistent with removePoolBoosterAddress.
Replace the hardcoded 1000000 gas limit with a storage variable
that can be set at construction and updated via
setAdditionalGasLimit. Add corresponding event.
@clement-ux clement-ux force-pushed the clement/improve-CurvePBBribeModule branch from 11e1d8c to 3d9c56d Compare February 9, 2026 09:44
Switch the parameterized manageBribes overload from memory to
calldata for gas efficiency, avoiding unnecessary memory copies.
Pass the new constructor parameter (1000000) to match the
updated CurvePoolBoosterBribesModule constructor signature.
@clement-ux clement-ux marked this pull request as ready for review February 9, 2026 10:01
Update the ABI and manageBribes call to match the new contract
interface. Use the no-arg manageBribes() when skipRewardPerVote
is true, and the 3-param overload with default totalRewardAmounts
(max) and extraDuration (1) otherwise.
sparrowDom
sparrowDom previously approved these changes Feb 9, 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.

Left a couple of comments inline

sparrowDom
sparrowDom previously approved these changes Feb 10, 2026
@clement-ux clement-ux merged commit a854682 into master Feb 11, 2026
8 of 15 checks passed
@clement-ux clement-ux deleted the clement/improve-CurvePBBribeModule branch February 11, 2026 13:54
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.

2 participants