20,000 USDC
View results
Submission Details
Severity: high
Valid

Rebasing tokens will get stuck in the contract

Summary

Rebasing tokens are tokens that have each holder's balanceof() increase over time. Aave aTokens are an example of such tokens.

Vulnerability Details

In Staking.sol users expect that when they deposit tokens to the contract, they get back all rewards earned, not just a flat rate. With the contracts of this project, deposited tokens will grow in value, but the user will only return the pre-calculated amount set in the storage variable balances[msg.sender] -= _amount;. Amounts go solely to the owner/creator or will remain locked in the contract if no withdraw excess tokens function is added to the contract for the owner.

/// @notice withdraw tokens from stake
/// @param _amount the amount to withdraw
function deposit(uint _amount) external {
TKN.transferFrom(msg.sender, address(this), _amount);
updateFor(msg.sender);
balances[msg.sender] += _amount;
}

Impact

If rebasing tokens are used as the collateral token, rewards accrue to the contract and cannot be withdrawn by either the user or the owner, and remain locked forever.

Tools Used

Manual Review

Recommended Steps

Provide a function for the pool owner to withdraw excess deposited tokens and repay any associated taxes.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!