58427 sc medium stargateethpoolstrategy allocate and deallocate inconsistent dust handling causes eth to be permanently locked in strategy contract
Description
Brief/Intro
Vulnerability Details
function _allocate(uint256 amount) internal override returns (uint256) {
require(TokenUtils.safeBalanceOf(address(weth), address(this)) >= amount, "not enough WETH");
// unwrap to native ETH for Pool Native
weth.withdraw(amount);
uint256 amountToDeposit = (amount / 1e12) * 1e12;
uint256 dust = amount - amountToDeposit;
if (dust > 0) {
emit StrategyAllocationLoss("Strategy allocation loss due to rounding.", amount, amountToDeposit);
}
pool.deposit{value: amountToDeposit}(address(this), amountToDeposit);
return amount;
}Impact Details
References
Proof of Concept
Proof of Concept
Previousalchemix-v3-audit-competition%20(no%20readme)Next58607 sc low incorrect access control in admin ownership transfer allows only current admin to accept ownership instead of pending admin
Was this helpful?