Boost _ Folks Finance 33675 - [Smart Contract - Low] PythNodeprocess can revert because of incorrect
Description
Brief/Intro
Vulnerability Details
function process(bytes memory parameters) internal view returns (NodeOutput.Data memory nodeOutput) {
(address pythAddress, bytes32 priceFeedId, bool useEma) = abi.decode(parameters, (address, bytes32, bool));
/// @dev using unsafe methods to avoid reverting, so this accepts old data
IPyth pyth = IPyth(pythAddress);
PythStructs.Price memory pythData = useEma
? pyth.getEmaPriceUnsafe(priceFeedId)
: pyth.getPriceUnsafe(priceFeedId);
/// @dev adjust the price to 18 d.p., exponent is a int32 so it could be negative or positive
int256 factor = PRECISION + pythData.expo; // 1e18 + -8 = 1e10
uint256 price = factor > 0
? pythData.price.toUint256() * (10 ** factor.toUint256())
->> : pythData.price.toUint256() / (10 ** factor.toUint256());
return NodeOutput.Data(price, pythData.publishTime, NodeDefinition.NodeType.PYTH, 0, 0);
}Impact Details
References
Proof of concept
PreviousBoost _ Folks Finance 33670 - [Smart Contract - Insight] Violator can deny his liquidation by frontNextBoost _ Folks Finance 33684 - [Smart Contract - Critical] Lack of available liquidity check when sen
Last updated
Was this helpful?