@@ -59,7 +59,7 @@ contract MStableYieldSource is IYieldSource, ReentrancyGuard {
/// @notice Approves of the max spend amount for the Savings contract.
function approveMax() public {
- IERC20(savings.underlying()).safeApprove(address(savings), type(uint256).max);
+ mAsset.safeApprove(address(savings), type(uint256).max);
emit ApprovedMax(msg.sender);
}
Instead of an expensive external call, the value would be replaced by a
cheap push operation.
Handle
hrkrshnn
Vulnerability details
Replace an external call with the immutable variable
Context
Instead of an expensive external call, the value would be replaced by a cheap
push
operation.