Has anyone gotten Smart Lottery to work with the latest version of OpenZeppelin and Chainlink? #955
-
I've been trying to upgrade the tutorial to use the latest versions of OpenZeppelin and Chainlink contracts. The biggest issue I'm finding is related to the Mock files we create while doing our development testing of the
My next step is to create a new version of the I wanted to get others' opinions on all of this. Has anyone successfully updated the mock files (specifically the LinkToken.sol contract) to run using a higher version of solidity that what is found in the tutorial? You can take a look at my progress in my github here. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello @freddie71010 are you using the latest version on chainlink repo o the one on chainlink-brownie-contracts? |
Beta Was this translation helpful? Give feedback.
-
As we already talked privately and the error is solved, I'm closing this thread now, however @freddie71010 could you please share the solution for the community? |
Beta Was this translation helpful? Give feedback.
-
@cromewar and I figured out the issue. It seems there's an issue with Brownie. In Broken: // SPDX-License-Identifier: MIT
// pragma solidity ^0.6.6;
// import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
pragma solidity ^0.7.0;
import "@chainlink/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.7/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Lottery is VRFConsumerBase, Ownable {
....
} Rerunning // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@chainlink/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.7/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Lottery is VRFConsumerBase, Ownable {
....
} |
Beta Was this translation helpful? Give feedback.
@cromewar and I figured out the issue. It seems there's an issue with Brownie. In
Lottery.sol
,brownie compile
was reading my commented outpragma solidity ^0.6.6;
declaration instead of my declaredpragma solidity ^0.7.0;
statement. Once I removed the commented out code, I was able to compile my project even with the LinkToken.sol script that's runningpragma solidity ^0.4.11;
.Broken: