Skip to content
Business logic Audit finding Intermediate

FSDVesting : Claiming tributes should call FSD token’s corresponding functions

The FSDVesting contract's claimTribute and claimGovernanceTribute functions fail to call the corresponding claim functions on the FSD token contract. As a result, when a beneficiary claims a tribute, the reward is transferred from their vested tokens without replenishing the FSD token contract's accounting, potentially causing loss to the beneficiary.

hickuphh3 Follow

Originally disclosed on Code4rena

Submitted by hickuphh3, also found by leastwood

Impact

The claiming of staking and governance tributes for the a beneficiary’s vested tokens should be no different than other users / EOAs. However, the claimTribute() and claimGovernanceTribute() are missing the actual claiming calls to the corresponding functions of the FSD token contract. As a result, the accrued rewards are taken from the beneficiary’s vested token while not claiming (replenishing) from the FSD token contract.

Recommended Mitigation Steps

In addition to what has been mentioned above, the internal accounting for claimedTribute states can be removed because they are already performed in the FSD token contract.

// TODO: Remove _claimedTribute and _claimedGovernanceTribute mappings

/**
* @dev Allows claiming of staking tribute by `msg.sender` during their vesting period.
* It updates the claimed status of the vest against the tribute
* being claimed.
*
* Requirements:
* - claiming amount must not be 0.
*/
function claimTribute(uint256 num) external onlyBeneficiary {
    uint256 tribute = fsd.availableTribute(num);
    require(tribute != 0, "FSDVesting::claimTribute: No tribute to claim");
		fsd.claimTribute(num);
    fsd.safeTransfer(msg.sender, tribute);
    emit TributeClaimed(msg.sender, tribute);
}

/**
* @dev Allows claiming of governance tribute by `msg.sender` during their vesting period.
* It updates the claimed status of the vest against the tribute
* being claimed.
*
* Requirements:
* - claiming amount must not be 0.
*/
function claimGovernanceTribute(uint256 num) external onlyBeneficiary {
  uint256 tribute = fsd.availableGovernanceTribute(num);
  require(
    tribute != 0,
    "FSDVesting::claimGovernanceTribute: No governance tribute to claim"
  );
  fsd.claimGovernanceTribute(num);
  fsd.safeTransfer(msg.sender, tribute);
  emit GovernanceTributeClaimed(msg.sender, tribute);
}

YunChe404 (FairSide) confirmed

The original report as published on Code4rena, by hickuphh3. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Impact

The accrued rewards are taken from the beneficiary's vested token while not claiming (replenishing) from the FSD token contract, which could cause loss to the beneficiary.

What the attacker needed

Beneficiary with vested tokens; tribute available to claim

The fix

The fix is to add calls to fsd.claimTribute(num) and fsd.claimGovernanceTribute(num) in the respective functions, and remove the internal claimedTribute accounting.

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.

This is a smart contract bug where a vesting contract lets a beneficiary claim rewards (tributes) but forgets to tell the main token contract that the reward was claimed. So the reward is paid out from the beneficiary's locked tokens, but the token contract still thinks the reward is unclaimed, which could lead to double-spending or loss for the beneficiary.

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.

More by hickuphh3

View all

43 more disclosed reports, best first.

More from FairSide contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.