Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [version-pragma]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
15 views

I updated Solidity to version to 0.6.12. Now the code is broken, how to fix?

How can I fix my code, the chainid is 9999.I tried changing chainId := chainid to chainId := chainid() but it doesn't work. Here is the whole code: pragma solidity 0.6.12; import './interfaces/...
Mr. arikodus's user avatar
0 votes
1 answer
25 views

The Solidity version pragma statement in these files doesn't match any of the configured compilers in your config. hardhat-deployment

in trying to compile a contract i keep getting this error: The Solidity version pragma statement in these files doesn't match any of the configured compilers in your config. Change the pragma or ...
kattyd's user avatar
  • 3
0 votes
0 answers
23 views

Multiple Solidity Versions in flattened file

I have deployed a contract to Mumbai Polygon testnet. While verifying and publishing source code, the flattened file has multiple solidity versions. I got the error below. The OpenZeppelin contracts ...
Valli Nayaki's user avatar
1 vote
0 answers
84 views

Handling Conflicting @openzeppelin/contracts Versions in Hardhat Project

I am currently working on a Hardhat project that requires the integration of two custom dependencies, namely custom-dep-a and custom-dep-b. Unfortunately, these two dependencies rely on different ...
MShakeG's user avatar
  • 1,703
0 votes
0 answers
25 views

These files import other files that use a different and incompatible version of Solidity

I encountered a problem with VSCode suddenly. It didn't have any problems yesterday, but suddenly this error appeared. When I run the compile command, I receive the following error. I'll send the ...
Elyas Sarjoghi's user avatar
4 votes
1 answer
975 views

How to Resolve Compiler Version Conflicts in Foundry Test Contracts?

I'm working on a Foundry project, and I'm encountering issues with compiler versions when trying to deploy Uniswap V3 core and periphery contracts in a test contract(i.e. UniswapTest shown below). The ...
MShakeG's user avatar
  • 1,703
1 vote
0 answers
12 views

Problem with veryfing contract

Hi I had my smart contract previously deployed and verified. However mythril warned me of floating pragma so I changed version explicitly to pragma solidity 0.8.1; I deployed it tot testnet using ...
Łukasz Johnnie Wolski's user avatar
1 vote
1 answer
50 views

The simplest way to return a list of items + gas limits on long lists when using pragma experimental ABIEncoderV2?

This question has two parts. I would like to return a list of items from my smart contract in a simple way, ideally a one-liner solution, something that I consume on the front-end. I tried some of the ...
Mars Robertson's user avatar
0 votes
1 answer
213 views

Compiler version error in Visual Studio Code

I started getting this error... Source file requires different compiler version (current compiler is 0.7.3+commit.9bfce1f6.Emscripten.clang) - note that nightly builds are considered to be strictly ...
Falcon Stakepool's user avatar
1 vote
2 answers
71 views

What issues can arise from calling contracts across different solidity versions?

What issues can arise from calling contracts across different solidity versions? For my purposes, Contract A has been deployed with pragma solidity 0.7.4; and Contract B is deployed with 0.8.19. Do ...
Milk's user avatar
  • 443
1 vote
1 answer
142 views

Solc: Source file requires different compiler version

in my brownie project i have imported LinkTokenReceiver.sol contract which its pragma solidity is pragma solidity ^0.7.0;, which means that it requires compiler version equal or greater than 0.7.0, ...
noro meb's user avatar
  • 368
0 votes
1 answer
223 views

My Openzepplin ERC-721 import is not compiling

Creating a minting capability for my dApp. Cannot compile due to solidity version error I believe. // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/...
Harry Chaklader's user avatar
0 votes
1 answer
38 views

VS Code Error - Won't compile my contract

VS code does not seem to recognise my pragma line in the contract and keeps throwing an error suggesting I use a the v 0.8.17 but this is written in my contract as per the image? Also, I have checked ...
Wattlebird's user avatar
0 votes
1 answer
1k views

I am unable to import the safe math library in my 0.6.12 version of my compiler

// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import &...
Mohindar Amarnadh's user avatar
0 votes
1 answer
71 views

openzeppelin dependencies pragma conflict

I am working with the nice old pancakeswap "Lottery.sol" contract. I am trying to compile it but the lottery contract im working with is kinda old. Hello there, Open zeppelin contracts have ...
Daniel Martinez's user avatar
2 votes
2 answers
1k views

How to specify a range of solidity versions?

How would I specify in the pragma solidity a range of acceptable solidity versions. If I want to specify that it should be gte(greater than equal) for example I could use pragma solidity >=0.8.0, ...
MShakeG's user avatar
  • 1,703
0 votes
1 answer
986 views

Failing to resolve solidity versions even though the intersection exists

I am writing my contracts in solidity version defined as ^0.8.0. I want to use Uniswap router interface, which is using >=0.7.5. Why is the compilation failing even though a compiler version ^0.8.0 ...
Jan Beneš's user avatar
1 vote
1 answer
1k views

What could go wrong if I change the version pragma of a third-party contract to make it importable with a newer Solidity compiler?

What are the consequences of changing compiler versions in dependency contracts to the same version as the main contract? I have one main contract that inherits some other contracts to interact with ...
Sevamove's user avatar