Delayed Reward Cut Parameter Updates (Two-Cycle Enforcement Lag)
The updateRCParams function processes rewards before storing new reward cut parameters, so the new parameters only take effect after two full processing cycles instead of one. This delays administrative parameter changes, such as during token depegging events, by two cycles.
Source: https://github.com/sherlock-audit/2025-08-usg-tangent-judging/issues/697
Found by
Cybrid, ck, molaratai
Summary
The RewardAccumulator::updateRCParams() function exhibits unexpected behavior where new reward cut parameters only take effect after two full processing cycles instead of the expected one cycle. This occurs due to improper ordering of operations within the update function, creating a significant delay between administrative actions and their enforcement.
Root Cause
updateRCParams() calls processRewards() before updating rcParams[market]
function updateRCParams(address market, RCParams calldata _rcParam) external onlyOwner {
_verifyRCParams(_rcParam);
processRewards(market, controlTower.feeTreasury()); // Uses OLD rcParams
rcParams[market] = _rcParam; // Updates AFTER processing
}
function processRewards(address market, address harvestFeeReceiver) public {
require(controlTower.isMarket(market), NotAMarketRewards());
// Checkpoint the rewards
_updateReward(market, address(0), 0, ICollateral(market).totalCollateral());
// Claim the rewards linked to the collateral from the underlying protocol
TokenAmount[] memory rewardAmounts = IMarketExternalActions(market).claimUnderlyingRewards(rewardTokens[market]);
uint256 rewardTokensLength = rewardAmounts.length;
@> uint256 rewardCutPercentage = lastRewardCuts[market]; //process reward with old params
@> RCParams memory _rcParams = rcParams[market]; //caches the old param
// Computes and actulize the new reward cut
@> lastRewardCuts[market] = _calculateRC(USGOracle.price_w(), _rcParams); //updates the next cycle call with old params
uint16 harvestFeePercentage = _rcParams.harvestFeePercentage;
// Stream rewards for every tokens
for (uint256 tokenIndex; tokenIndex < rewardTokensLength; ) {
IERC20 rewardToken = rewardAmounts[tokenIndex].token;
// Update streaming data for the current rewardToken
(uint256 rewardCutAmount, uint256 harvesterAmount) = _processRewards(market, rewardToken, rewardAmounts[tokenIndex].amount, harvestFeePercentage, rewardCutPercentage);
...
}
Internal Pre-conditions
.
External Pre-conditions
.
Attack Path
- Cycle 1: Admin calls
updateRCParams()expecting new parameters to be staged for next cycle
processRewards()executes with old rcParamslastRewardCuts[market]is calculated using old parameters- New
rcParamsare stored but won't be used yet
- Cycle 2: Next
processRewards()call
- Still uses
lastRewardCutscalculated with old parameters - Calculates new
lastRewardCutswith new parameters (finally)
- Cycle 3: Third
processRewards()call
- First time new parameters actually affect reward distribution
Impact
Parameter updates (e.g., during token depegging events) are delayed by two full cycles
PoC
No response
Mitigation
Reorder operations in updateRCParams() to update parameters before processing rewards:
function updateRCParams(address market, RCParams calldata _rcParam) external onlyOwner {
// Verify if the new reward cut params are compliant
_verifyRCParams(_rcParam);
+ // Update RC params BEFORE processing rewards
+ rcParams[market] = _rcParam;
// Process the rewards (now with updated rcParams for next cycle calculation)
processRewards(market, controlTower.feeTreasury());
- // Update the new RC Params
- rcParams[market] = _rcParam;
}
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/Tangent-labs/tangent-contracts/pull/118
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the update function calls processRewards before assigning the new parameters, so the processing step caches and uses the old values.
Impact
Parameter updates, such as during token depegging events, are delayed by two full cycles.
What the attacker needed
Admin privileges to call updateRCParams
The fix
The protocol team fixed this issue by reordering operations so that rcParams[market] is updated before processRewards is called.
How it was found
- Admin calls updateRCParams expecting new parameters to be staged for the next cycle.
- processRewards executes with the old parameters and calculates lastRewardCuts using them.
- The new parameters are stored but not used yet.
- The next processRewards call still uses the old lastRewardCuts and only then calculates new lastRewardCuts with the new parameters.
- Only the third processRewards call actually applies the new parameters to reward distribution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract lets an admin change how rewards are split. The function that changes the settings first pays out rewards using the old settings, then saves the new ones. Because of this order, the new settings are not used until two reward cycles later, not the next one as intended.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.