sherlock-audit / 2024-06-leveraged-vaults-judging

9 stars 8 forks source link

unique - in `PendlePTOracle::_calculateBaseToQuote()` the function expects to return `answeredInRound` which is Deprecated #130

Closed sherlock-admin4 closed 2 months ago

sherlock-admin4 commented 2 months ago

unique

Medium

in PendlePTOracle::_calculateBaseToQuote() the function expects to return answeredInRound which is Deprecated

Summary

answeredInRound: Deprecated - Previously used when answers could take multiple rounds to be computed

Vulnerability Detail

latestRoundData() and _calculateBaseToQuote() functions in PendlePTOracle.sol are expected to return answeredInRound, which, according to the Chainlink documentation, is deprecated.

Impact

The function might still work as is for now, but future versions of Chainlink might remove answeredInRound, leading to potential compatibility issues.

Code Snippet

https://github.com/sherlock-audit/2024-06-leveraged-vaults/blob/main/leveraged-vaults-private/contracts/oracles/PendlePTOracle.sol#L97

  function latestRoundData() external view override returns (
        uint80 roundId,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    ) {
        return _calculateBaseToQuote();
    }

Tool used

Manual Review

Recommendation

I didn't find an alternative property or method instead of answeredInRound in Chanlink documentation.

Update Your Function: Modify the function to either exclude answeredInRound or replace it with the new recommended method or property.

unique0x7 commented 2 months ago

I submitted this issue at the last minute and forgot to include the Chainlink documentation link related to it.

https://docs.chain.link/data-feeds/feed-registry/feed-registry-functions#latestrounddata

sherlock-admin3 commented 2 months ago

1 comment(s) were left on this issue during the judging contest.

0xmystery commented:

That's only a parameter name