You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Description
The claimRemovedTokens function is designed to allow users to claim their share of tokens that have been removed in previous snapshots. The function iterates over all snapshot IDs from the last claimed ID to the current snapshot ID, attempting to claim the user's share of each removed token using the attemptClaim function. The safeTransfer function within attemptClaim is used to transfer the calculated share to the user. If the transfer fails for any reason, the entire claimRemovedTokens function reverts, preventing the user from claiming any of their removed tokens.
Here is the relevant portion of the code for the claimRemovedTokens function:
This issue results in inefficiencies and potential user dissatisfaction. Users will be unable to claim their removed tokens if any single transfer operation fails, leading to potential loss of funds and a poor user experience.
Scenario Overview
User Stakes Tokens: A user stakes tokenA, tokenB, and tokenC in the protocol.
Protocol Removes Tokens: The protocol subsequently calls removePortfolioToken for tokenB and tokenC.
Initiate Claim Process: The user calls the claimRemovedTokens function to claim their removed tokens (tokenB and tokenC).
Trigger Transfer Failure for TokenB: During the claim process, the protocol first attempts to transfer tokenB to the user. However, the transfer of tokenB fails due to a malfunctioning token contract, insufficient balance in the contract, or any other reason.
Function Reverts: The safeTransfer function fails and reverts, causing the entire claimRemovedTokens function to revert. As a result, the user is unable to claim both tokenB and tokenC, even though the transfer of tokenC would have succeeded.
Continued Transfer Failures: If the issue with the tokenB transfer persists, the user will continuously be unable to retrieve both tokenB and tokenC every time they attempt to call the claimRemovedTokens function.
Consequences
Denial of Service: The user is unable to claim any of their removed tokens due to the failure of the transfer for tokenB.
Potential Financial Loss: Users might face financial losses if they are unable to reclaim valuable tokens that have been removed.
Github username: --
Twitter username: --
Submission hash (on-chain): 0x2a60e4e670f79bb68f964cd50c776c60f0a87c58f61272a1ec41950ee8dbcd2e
Severity: medium
Description:
Description
The
claimRemovedTokens
function is designed to allow users to claim their share of tokens that have been removed in previous snapshots. The function iterates over all snapshot IDs from the last claimed ID to the current snapshot ID, attempting to claim the user's share of each removed token using theattemptClaim
function. ThesafeTransfer
function withinattemptClaim
is used to transfer the calculated share to the user. If the transfer fails for any reason, the entireclaimRemovedTokens
function reverts, preventing the user from claiming any of their removed tokens.Here is the relevant portion of the code for the
claimRemovedTokens
function:This issue results in inefficiencies and potential user dissatisfaction. Users will be unable to claim their removed tokens if any single transfer operation fails, leading to potential loss of funds and a poor user experience.
Scenario Overview
User Stakes Tokens: A user stakes tokenA, tokenB, and tokenC in the protocol.
Protocol Removes Tokens: The protocol subsequently calls
removePortfolioToken
for tokenB and tokenC.Initiate Claim Process: The user calls the
claimRemovedTokens
function to claim their removed tokens (tokenB and tokenC).Trigger Transfer Failure for TokenB: During the claim process, the protocol first attempts to transfer tokenB to the user. However, the transfer of tokenB fails due to a malfunctioning token contract, insufficient balance in the contract, or any other reason.
Function Reverts: The
safeTransfer
function fails and reverts, causing the entireclaimRemovedTokens
function to revert. As a result, the user is unable to claim both tokenB and tokenC, even though the transfer of tokenC would have succeeded.Continued Transfer Failures: If the issue with the tokenB transfer persists, the user will continuously be unable to retrieve both tokenB and tokenC every time they attempt to call the
claimRemovedTokens
function.Consequences
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
Files:
The text was updated successfully, but these errors were encountered: