Closed c4-submissions closed 11 months ago
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as primary issue
Nothing wrong here. Caching is meant for gas saving.
fatherGoose1 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L63
Vulnerability details
Impact
Saving contract balance into variable will result in wrong price being transferred using the
depositIntoStrategy
method which will cause the transfer to fail if balance is less than transferred and wrong amount transferred if amount increases.Proof of Concept
The balance of token is saved into
balance
variable which is then used to transfer using thedepositIntoStrategy
method.Tools Used
Manual Review
Recommended Mitigation Steps
Use token balance in the contract address directly to avoid wrong transfer.
Assessed type
Other