Skip to content
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

SubscriptionAPI.sol appears to be missing a ^ symbol, displaying: pragma solidity 0.8.19; #32

Open
simon-masterclass opened this issue Jul 14, 2024 · 4 comments

Comments

@simon-masterclass
Copy link

Devs,
I'm trying to build a Raffle project implementing chainlink VRF and I'm having trouble compiling with any version of solidity higher than 0.8.19 - I submitted this issue to the Cyfrin team and @PatrickAlphaC but I figured I'd post it here as well.

It appears that the issue is in a Chainlink-Brownie-Contract file related to vrf contracts - specifically one of the inherited contracts.

SubscriptionAPI.sol
@chainlink-brownie-contracts/contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol

It appears that the pragma solidity version is missing a "^" (Carot) symbol, thereby hampering the ability to compile with any version of solidity greater than 0.8.19 - which might be intentional or a bug.

Here's the code:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {EnumerableSet} from "../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/structs/EnumerableSet.sol";
import {LinkTokenInterface} from "../../shared/interfaces/LinkTokenInterface.sol";
import {ConfirmedOwner} from "../../shared/access/ConfirmedOwner.sol";
import {AggregatorV3Interface} from "../../shared/interfaces/AggregatorV3Interface.sol";
import {IERC677Receiver} from "../../shared/interfaces/IERC677Receiver.sol";
import {IVRFSubscriptionV2Plus} from "./interfaces/IVRFSubscriptionV2Plus.sol";

abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscriptionV2Plus {
  using EnumerableSet for EnumerableSet.UintSet;

Is this a bug or a feature?
Let me know, thanks!

-Simon

@PatrickAlphaC
Copy link
Contributor

Can you make this an issue in the chainlink repo? This repo just clones the code in that repo.

@simon-masterclass
Copy link
Author

simon-masterclass commented Jul 22, 2024

@PatrickAlphaC
Does it just clone the repo? Because the original Chainlink repo doesn't have a missing ^
as you can see at this link...
https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol
NOTE: This "original" chainlink/contracts repo uses version ^0.8.4

Only the Chainlink-brownie-contracts repo seems to have these issues.
as you can see at this link...
https://github.com/smartcontractkit/chainlink-brownie-contracts/blob/main/contracts/src/v0.8/vrf/dev/SubscriptionAPI.sol

Let me know, thanks.
-Simon

@PatrickAlphaC
Copy link
Contributor

PatrickAlphaC commented Jul 25, 2024

@simon-masterclass it uses the "official" package from npm. So whatever they are uploading to NPM is what this package uses.

Also, it looks like both repos have the ^?

@simon-masterclass
Copy link
Author

@PatrickAlphaC
Oh, that's interesting.
It looks like they fixed it. It used to be missing a ^ 🧐
I copied the code in the issue report above (version 0.8.19) directly from the second link in the comment above - but now both are synced up to the same version ^0.8.4
All clear. 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants