Isaiah2240
Isaiah2240

Reputation: 1

ParserError in solidity, Expected identifier but got reserved keyword 'immutable'

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
^-------^

Upvotes: 0

Views: 271

Answers (1)

regcostajr
regcostajr

Reputation: 170

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

Upvotes: 1

Related Questions