0

Try this code

pragma solidity >=0.5.0 <0.6.0;

contract test05 {

    address payable public admin = msg.sender;

    function() payable external {}

    function getBalance() public view returns (uint) {
        return address(this).balance;
    }
}

enter image description here

getBalance is callable for free. Event reading admin address is free.

But try this

pragma solidity >=0.6.0 <0.7.0;

contract test06 {

    address payable public admin = msg.sender;

    receive() payable external {}

    function getBalance() public view returns (uint) {
        return address(this).balance;
    }
}

getBalance now requires gas to be called, and also admin is no more free to read.

Why ?!!?

enter image description here

I am asking this because I'd like to develop directly on latest version of 'everything' tool/framework/language I uses.

0
1

At the moment the current version of remix is not suited for 0.6.x solc. It is reccomended to use alpha version in the meanwhile.

Developers are fixing those problems, due to a different ABI format in 0.6.x

A new version is due in a short time. It was scheduled for 15 Jan, but some other issues are emerged and they are fixing that as well.

If you go on the official remix support channel (gitter remix) you can read this all.

Use alpha version for now.

1

I had same issue, if you try the remix alpha http://remix-alpha.ethereum.org/ you should see it generated correctly. I do not know when this fix will make it into live.

Not the answer you're looking for? Browse other questions tagged or ask your own question.