DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Valid

The `balanceDeployed` view function adds the underlying amount which is incorrect.

Summary

balanceDeployed view function can be used to check the total deployed alETH but including underlying(WETH) makes it incorrect.

Vulnerability Details

WETH and alETH don’t have the same exchange rate and it is just a softly pegged asset. Including raw WETH in the balanceDeployed view, function will result in the incorrect return value for the external system.

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L147

function balanceDeployed() public view returns (uint256) {
return transmuter.getUnexchangedBalance(address(this)) + underlying.balanceOf(address(this)) + asset.balanceOf(address(this));
}

Example Scenario: Let's say the strategy has:

  • 100 alETH in the transmuter (unexchanged balance)

  • 10 WETH (underlying balance)

  • 5 alETH (loose asset balance)

With WETH/alETH exchange rate of 0.95 (meaning 1 WETH = 0.95 alETH), the current implementation would return:

100 + 10 + 5 = 115 alETH

But this is incorrect because those 10 WETH are actually only worth 9.5 alETH (10 * 0.95). The actual deployed value should be:

100 + 9.5 + 5 = 114.5 alETH

Impact

Incorrect return data in view function,so i think it is low issue.Tools Used

Recommendations

Either exclude WETH from calculation or implement a way to get the current exchange rate of WETH → alETH and use that.

Updates

Appeal created

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

balanceDeployed() and _harvestAndReport() add WETH and alETH, but they have different prices

0xhuntoor Auditor
10 months ago
0xhuntoor Auditor
10 months ago
inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

balanceDeployed() and _harvestAndReport() add WETH and alETH, but they have different prices

Support

FAQs

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