Conversation
|
@eddiehsu66 pr需要引用解决的相关问题 我已经帮你引用上了 下次希望能够引用一下解决的问题 你的代码这几天 我会去本地测试的 谢谢你的贡献 |
|
#607 是需要支持预言机本地化 如果可以的话 能否在这个pr中支持 |
|
okok,我重新看一下文档整理一下
|
好 辛苦大佬 |
OKOK,已支持预言机本地化测试,已提交 |
辛苦辛苦 争取下周 review完 |
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Chainlink VRF V2 integration to VRF V2.5, updating consumer contracts, type definitions, imports, and documentation accordingly.
- Swapped out
VRFConsumerBaseV2forVRFConsumerBaseV2Plusand updated all import paths and constructor calls. - Changed
subIdfromuint64touint256and updated coordinator addresses and key hashes. - Refactored
requestRandomWordscalls to useVRFV2PlusClient.RandomWordsRequestwithExtraArgsV1, added a mock contract for local testing, and expanded the README with remix setup instructions.
Reviewed Changes
Copilot reviewed 4 out of 10 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| 39_Random/readme.md | Updated docs for VRF V2.5 usage, added local test guide, corrected addresses and sample calls |
| 39_Random/VRFCoordinatorV2_5Mock.sol | Introduced mock import for VRFCoordinatorV2_5Mock to enable local testing in remix |
| 39_Random/RandomNumberConsumer.sol | Migrated consumer contract to use VRFConsumerBaseV2Plus, updated types, imports, and request API |
| 39_Random/Random.sol | Migrated NFT contract to use VRFConsumerBaseV2Plus, updated types, imports, and request API |
Comments suppressed due to low confidence (2)
39_Random/RandomNumberConsumer.sol:63
- [nitpick] The parameter
s_randomWordsuses thes_prefix (typically for storage); consider renaming torandomWordsor similar for clarity and consistency with_requestId.
function fulfillRandomWords(uint256 _requestId, uint256[] calldata s_randomWords) internal override {
39_Random/Random.sol:110
- [nitpick] Similarly here,
s_randomWordscould be renamed to avoid the storage-prefix convention and match the_requestIdstyle.
function fulfillRandomWords(uint256 _requestId, uint256[] calldata s_randomWords) internal override{
|
|
||
| ## `remix`本地测试网验证 | ||
|
|
||
| ChainLink也提供了在remix本地进行测试的方案。 |
There was a problem hiding this comment.
[nitpick] Consistently capitalize 'Chainlink' instead of 'ChainLink' to match product branding.
| ChainLink也提供了在remix本地进行测试的方案。 | |
| Chainlink也提供了在remix本地进行测试的方案。 |
|
|
||
| ### 5. 发起随机数请求 | ||
|
|
||
| 点击左侧`mintRandomVRF`,发起随机数请求,可以通过查询`requesetid`来查看发起的请求ID。 |
There was a problem hiding this comment.
Typo in 'requesetid'—it should be 'requestId' to match the code examples.
| 点击左侧`mintRandomVRF`,发起随机数请求,可以通过查询`requesetid`来查看发起的请求ID。 | |
| 点击左侧`mintRandomVRF`,发起随机数请求,可以通过查询`requestId`来查看发起的请求ID。 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
What type of PR is this (这是什么类型的PR)
Which issue(s) this PR fixes(Optional) (这个PR 修复了什么问题 (可选择))
What this PR does / why we need it (这个PR 做了什么/ 我们为什么需要这个PR)
当前Chainlink官网不支持VRF V2,获取的subId从uint64变为了uint256,需要进行迁移