Questions tagged [version-pragma]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 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
20 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,408
0 votes
0 answers
11 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
2 votes
1 answer
283 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,408
0 votes
0 answers
9 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
40 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
69 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
54 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
  • 391
1 vote
1 answer
77 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
  • 328
0 votes
1 answer
190 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
29 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
883 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
56 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
778 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,408
0 votes
1 answer
684 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 ...
Sevasoft's user avatar