0

I'm trying to compile my code on my token smart contract on solidity but this line is causing an error:

address public immutable BUSD = address(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56); //BUSD

Error message:

contracts/Work Protocol.sol:32:20: ParserError: Expected identifier but got reserved keyword 'immutable'
address public immutable BUSD = address(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56); //BUSD
^-------^

1 Answers1

1

immutable has been introduced on 0.6.5, if you are using any version older than that, you will get the compilation error you've mentioned.

Version 0.6.5 of Solidity fixes an important bug and introduces immutable as a major feature.

https://github.com/ethereum/solidity/releases/tag/v0.6.5

regcostajr
  • 170
  • 2
  • Thank You So Much. Really Appreciate Your Response. Let Me Give It A Try – Isaiah2240 Sep 28 '21 at 10:23
  • i get this error when compiling. how do i solve it/ error below not found contracts/IUniswapV2Router.sol – Isaiah2240 Sep 28 '21 at 12:03
  • This message means that this contract path has not been found in your environment, if you are using a third party contract make sure you have all the contracts required for it in your path, also make sure the import path is correct in your contract, in any case this is hard to guess just with the info you provided, better to share more details about the contract you are using as well how you are compiling it – regcostajr Sep 28 '21 at 13:31
  • its a third party contract, and i;m using solidity to compile. Here is the link https://github.com/Loudmarket/LoudMarket/blob/main/LM.sol – Isaiah2240 Sep 28 '21 at 14:22
  • Thank you. really appreciate – Isaiah2240 Sep 28 '21 at 14:24
  • in your repo you have only LM.sol but you need all [these](https://github.com/Loudmarket/LoudMarket/blob/main/LM.sol#L11-L17) in your path to be able to compile, it would make things simpler to you if you use an development environment like hardhat or truffle, give a look to [this](https://docs.uniswap.org/protocol/guides/local-environment) maybe help you to clear this things out, if you want to do manually you will really need to download all these contracts to your path – regcostajr Sep 28 '21 at 14:41