From f9c254aecfc2181615f0330b24379b24260a4fed Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Thu, 9 May 2024 07:47:35 +0000 Subject: [PATCH] fix: safecast to separate variable Signed-off-by: Reinis Martinsons --- .../ChainlinkDestinationAdapter.sol | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/adapters/destination-adapters/ChainlinkDestinationAdapter.sol b/src/adapters/destination-adapters/ChainlinkDestinationAdapter.sol index 8fc193e..aef1405 100644 --- a/src/adapters/destination-adapters/ChainlinkDestinationAdapter.sol +++ b/src/adapters/destination-adapters/ChainlinkDestinationAdapter.sol @@ -49,14 +49,8 @@ abstract contract ChainlinkDestinationAdapter is DiamondRootOval, IAggregatorV3 * hardcodes to 1). */ function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) { - (int256 answer, uint256 updatedAt, uint256 roundId) = internalLatestData(); - - return ( - SafeCast.toUint80(roundId), - DecimalLib.convertDecimals(answer, 18, decimals), - updatedAt, - updatedAt, - SafeCast.toUint80(roundId) - ); + (int256 answer, uint256 updatedAt, uint256 _roundId) = internalLatestData(); + roundId = SafeCast.toUint80(_roundId); + return (roundId, DecimalLib.convertDecimals(answer, 18, decimals), updatedAt, updatedAt, roundId); } }