Complete reference for the IfaPriceFeedVerifier validation contract
IfaPriceFeedVerifier
contract serves as the validation and security layer for price data submissions in the IFA Oracle Price Feed System. It validates incoming data from relayer nodes and forwards approved updates to the main price feed contract.
IfaPriceFeedVerifier
src/IfaPriceFeedVerifier.sol
relayerNode
: Only this address can submit price datapriceFeed
: The IfaPriceFeed contract to updateowner
: Administrative control over the verifier_relayerNode
: Address authorized to submit price data_priceFeed
: Address of the IfaPriceFeed contract to update_assetindex
: Array of asset identifiers (keccak256 hashes)_prices
: Array of PriceFeed structs with price datasetAssetInfo
on price feed for each asset_relayerNode
: New relayer node addressFunction | Owner | Relayer | Anyone |
---|---|---|---|
submitPriceFeed | ❌ | ✅ | ❌ |
setRelayerNode | ✅ | ❌ | ❌ |
View relayerNode | ✅ | ✅ | ✅ |
View priceFeed | ✅ | ✅ | ✅ |
View owner | ✅ | ✅ | ✅ |
Error | Condition | Solution |
---|---|---|
”Only relayer can submit” | Wrong caller | Use authorized relayer address |
”Array length mismatch” | Different array sizes | Ensure equal length arrays |
”Arrays cannot be empty” | Zero-length arrays | Submit at least one asset |
Forwarded errors | Price feed rejection | Check price data validity |
Assets | Individual Calls | Batch Call | Savings |
---|---|---|---|
1 | ~50,000 gas | ~50,000 gas | 0% |
5 | ~250,000 gas | ~180,000 gas | ~28% |
10 | ~500,000 gas | ~330,000 gas | ~34% |