Version: `0.11.0`
OS & Version: osx
Number of blocks synchronized: 5998269
the "contract IDE verification" is the solidity code compiler verification.
For example,
I was using the contract name as the function name for the contract construct function at pragma solidity ^0.4.21; and the Ethereum Wallet's inner IDE tells that *Could not compile source code. *
error message:
Could not compile source code.
Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function MYCONTRACTNAME() {
^ (Relevant source part starts here and spans across multiple lines).
,
but this feature is not a pragma solidity ^0.4.21; feature.
https://solidity.readthedocs.io/en/v0.4.21/contracts.html?highlight=construct
When a contract is created, its constructor (a function with the same name as the contract) is executed once. A constructor is optional. Only one constructor is allowed, and this means overloading is not supported.
however, this feature is showed in the newest version of solidity compiler pragma solidity ^0.4.24
https://solidity.readthedocs.io/en/v0.4.24/contracts.html?highlight=construct
When a contract is created, its constructor (a function declared with the constructor keyword) is executed once. A constructor is optional. Only one constructor is allowed, and this means overloading is not supported.
So after I change the code
function MYCONTRACTNAME()
to
constructor()
the error message disappeared.
BUT I still leave the code pragma solidity ^0.4.21; declared !
I think this is a BUG
Gooood
Hello @toby1991, can you elaborate your claim? What exactly is the contract IDE verification?
Hi @evertonfraga ,the "contract IDE verification" is the solidity code compiler verification.
For example,
I was using the contract name as the function name for the contract construct function at pragma solidity ^0.4.21; and the Ethereum Wallet's inner IDE tells that *Could not compile source code. *
error message:
Could not compile source code.
Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function MYCONTRACTNAME() {
^ (Relevant source part starts here and spans across multiple lines).
,
but this feature is not a pragma solidity ^0.4.21; feature.
https://solidity.readthedocs.io/en/v0.4.21/contracts.html?highlight=construct
When a contract is created, its constructor (a function with the same name as the contract) is executed once. A constructor is optional. Only one constructor is allowed, and this means overloading is not supported.
however, this feature is showed in the newest version of solidity compiler pragma solidity ^0.4.24
https://solidity.readthedocs.io/en/v0.4.24/contracts.html?highlight=construct
When a contract is created, its constructor (a function declared with the constructor keyword) is executed once. A constructor is optional. Only one constructor is allowed, and this means overloading is not supported.
So after I change the code
function MYCONTRACTNAME()
to
constructor()
the error message disappeared.
BUT I still leave the code pragma solidity ^0.4.21; declared !
I think this is a BUG
I ran into this issue myself while testing an old token contract. We'll see if we can get it addressed for 0.12.
Got it. we should lock Solc version at Major.Minor, instead of using ^.
https://github.com/ethereum/mist/blob/develop/yarn.lock#L6768
https://github.com/ethereum/mist/blob/develop/package.json#L60
Sent a pull request with a fix.