DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

Unchecked External Call in getEthVerificationFee()

Summary

The function makes an external call to chainlinkFeeManager.getFeeAndReward without checking if the call was successful.

Vulnerability Details

https://github.com/Cyfrin/2024-07-zaros/blob/main/src/external/chainlink/ChainlinkUtil.sol

function getEthVericationFee(
IVerifierProxy chainlinkVerifier,
bytes memory reportData
)
internal
returns (FeeAsset memory fee)
{
IFeeManager chainlinkFeeManager = chainlinkVerifier.s_feeManager();
address feeTokenAddress = chainlinkFeeManager.i_nativeAddress();
(fee,,) = chainlinkFeeManager.getFeeAndReward(address(this), reportData, feeTokenAddress);
}

Impact

An unchecked external call can lead to unexpected behavior or errors if the external call fails.

Tools Used

Manual code review

Recommendations

Check the return value of the external call to ensure it was successful. Example:

(bool success, bytes memory data) = address(chainlinkFeeManager).call(abi.encodeWithSignature("getFeeAndReward(address,bytes,address)", address(this), reportData, feeTokenAddress));
require(success, "External call failed");
(fee,,) = abi.decode(data, (FeeAsset, , ));
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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