The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Issues can occur when the balance of the manager is zero

Summary

The position function in the smart contract aims to return the position and rewards of a given _holder. However, a specific conditional operation within the function could lead to a scenario where the _position.EUROs value does not increase as intended if the manager's balance of EUROs is zero.

Vulnerability Details

The function calculates _position.EUROs by adding a value derived from the manager's EURO balance. This is done only if _position.TST is greater than zero. The calculation involves multiplying the manager's EURO balance by _position.TST and then dividing by the total TST obtained from getTstTotal(). If the manager's EURO balance is zero, this entire calculation results in zero, which means _position.EUROs remains unchanged regardless of the _position.TST value. This could be problematic if the intention is to increase _position.EUROs based on other factors in addition to the manager's EURO balance.

Impact

In scenarios where the manager has a zero EURO balance, holders with a positive TST balance will not see any increase in their EUROs position, potentially leading to incorrect or unexpected results in the contract's logic. This issue impacts the accuracy and reliability of the position function, especially in its ability to reflect the true position of a holder.

Tools Used

Manual Review

Recommendations

Implement an alternative method for calculating _position.EUROs that does not solely depend on the manager's EURO balance. This method should account for cases where the manager's balance might be zero, ensuring that _position.EUROs can still be updated appropriately.

Updates

Lead Judging Commences

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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

Give us feedback!