-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setLinkToken-Is-Publicly-Exposed #12504
setLinkToken-Is-Publicly-Exposed #12504
Conversation
I see you updated files related to |
I see you updated files related to |
e0a0925
to
f26a274
Compare
f26a274
to
3cf916f
Compare
function testSetLinkAndLinkNativeFeed() public { | ||
VRFV2PlusWrapper wrapper = new VRFV2PlusWrapper(address(0), address(0), address(s_testCoordinator)); | ||
function testSetLinkNativeFeed() public { | ||
VRFV2PlusWrapper wrapper = new VRFV2PlusWrapper(address(s_linkToken), address(0), address(s_testCoordinator)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: add a check that the constructor will revert with ZeroAddress
if the LINK token address is set to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I wanted to add that test but I forgot about it. Thanks for catching this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's sort of already tested through this PR
@@ -87,4 +87,6 @@ interface IVRFV2PlusWrapper { | |||
uint32 _numWords, | |||
bytes memory extraArgs | |||
) external payable returns (uint256 requestId); | |||
|
|||
function link() external returns (address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not a view
function?
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Remove setLinToken from VRFV2PlusWrapperConsumerBase * Add missing view to IVRFV2PlusWrapper link
Remove
setLinkToken
inVRFV2PlusWrapperConsumerBase
and made link immutable. Link is now retrieved fromVRFV2PlusWrapper
on constructor.Made link immutable in
VRFV2PlusWrapper
and check if address is non zero on constructor.