Update PriceFeedConsumer.sol contract
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- solidity
- 领域
- blockchain
调研方向
Start with PriceFeedConsumer.sol and inspect the current getLatestPrice() implementation and its feed configuration. Use Chainlink Local's MockV3Aggregator updateAnswer and updateRoundData references to exercise zero values, stale timestamps, and decimal formatting; done means all listed edge cases are covered by tests and the contract exposes the renamed function.
由索引模型根据 Issue 内容生成。
描述
- Rename the
getLatestPrice()function togetChainlinkDataFeedLatestAnswer() - Revert if returned
answerorroundIdare zero - Have a check for a stale answer. The
timeStamp/updatedAtshould be compared against the storage variable provided by the user that ideally should be a value close to a heartbeat of an actual feed. Ifblock.timestamp - s_usdcUsdFeedHeartbeatis greater thantimeStampcontract should revert - Currently contract returns plain
answer. We should format that value based on thedecimals()of the feed and token's decimals - Test all of these edge cases using Chainlink Local
- https://docs.chain.link/chainlink-local/api-reference/solidity/data-feeds/mockv3aggregator#updateanswer
- https://docs.chain.link/chainlink-local/api-reference/solidity/data-feeds/mockv3aggregator#updaterounddata
- https://docs.chain.link/chainlink-local/api-reference/solidity/data-feeds/mockoffchainaggregator#updateminandmaxanswers (optionally)
- 主要语言
- Solidity
- 星标
- 364
- 派生
- 107
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
smartcontractkit/foundry-starter-kit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
smartcontractkit/foundry-starter-kit#37 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
smartcontractkit/foundry-starter-kit#36 · 1 条评论 ·
查看 smartcontractkit/foundry-starter-kit 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
icon-project/sodax-sdks#696 ·
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 76/100
th30d4y/OpenLearnX#737 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 78/100
btclib-org/btclib-node#2656 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
hiero-ledger/hiero-sdk-js#4832 ·
维护者通常 1 天内回复
-
Bigint RPC params are sent as strings when the application defines BigInt.prototype.toJSON可能已有人在做 @andreisilviudragnea 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复