31383 - [SC - Low] price feeds sanity checks isnt correct in funct...
Description
Brief/Intro
Vulnerability Details
116 function amountToCompound(uint256 _alcxAmount) public view returns (uint256, uint256[] memory) {
117 // Increased for testing since tests go into future
118 uint256 staleThreshold = 60 days;
119
120 (uint80 roundId, int256 alcxEthPrice, , uint256 priceTimestamp, uint80 answeredInRound) = priceFeed
121 .latestRoundData();
122
123 require(answeredInRound >= roundId, "Stale price");
124 require(block.timestamp - priceTimestamp < staleThreshold, "Price is stale"); <<<--- Here the function checks stale price using 60 days
125 require(alcxEthPrice > 0, "Chainlink answer reporting 0");
126
127 uint256[] memory normalizedWeights = IManagedPool(address(balancerPool)).getNormalizedWeights();
128
129 uint256 amount = (((_alcxAmount * uint256(alcxEthPrice)) / 1 ether) * normalizedWeights[0]) /
130 normalizedWeights[1];
131
132 return (amount, normalizedWeights);
133 }Impact Details
References
Proof of Concept
Previous31382 - [SC - High] VotingEscrowupdateUnlockTime - Its possible for...Next31385 - [SC - Low] RewardsDistributortokensPerWeek might be zero i...
Last updated
Was this helpful?