chainlink-brownie-contracts icon indicating copy to clipboard operation
chainlink-brownie-contracts copied to clipboard

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

Open simon-masterclass opened this issue 1 year ago • 4 comments

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

simon-masterclass avatar Jul 14 '24 22:07 simon-masterclass

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

PatrickAlphaC avatar Jul 20 '24 18:07 PatrickAlphaC

@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

simon-masterclass avatar Jul 22 '24 21:07 simon-masterclass

@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 ^?

PatrickAlphaC avatar Jul 25 '24 23:07 PatrickAlphaC

@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. 👍🏼

simon-masterclass avatar Jul 26 '24 17:07 simon-masterclass

Closing since @simon-masterclass got a solution.

thodges-gh avatar Apr 02 '25 16:04 thodges-gh