Search code examples
blockchainsoliditytruffleuniswap

Is there any way to use latest truffle version with older versions


I get this error all the time because the truffle version that I use is the newer version and some smart contracts uses the older versions. Is there any way that I can get rid of these errors?

Error: Truffle is currently using solc 0.8.12, but one or more of your contracts specify "pragma solidity 0.7.6".
Please update your truffle config or pragma statement(s).

Solution

  • Either you downgrade your contracts' solidity version to the dependencies contracts' version or, if possible, you install some newer dependencies.

    Or you can clone the contract that uses an older solidity version to your local repo and you manually change the version. (Unless of course you have a billion dependencies)

    When I was using the Aave contracts i had to manually copy them locally so I could upgrade their version from 0.6.12 to ^0.8.0.