ベストプラクティス
Chiliz Chain の price feed を安全に利用するためのバリデーションパターン、 ヘルス状態 API、staleness チェック、および統合チェックリスト。
最終更新
役に立ちましたか?
役に立ちましたか?
uint80 factor = priceFeed.healthFactor(); // per-feed; do NOT assume the default of 2 (live feeds use 720)uint8 public immutable feedDecimals;
constructor(address _feed) {
priceFeed = IChilizPriceFeed(_feed);
feedDecimals = priceFeed.decimals();
}require(!priceFeed.paused(), "Feed paused");