Skip to main content
added 415 characters in body
Source Link
BokkyPooBah
  • 40.4k
  • 14
  • 123
  • 193

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear. The compiler checks the checksummed address for validity.

But I just checked your code with the checksummed address in Remix and I get a new warning message:

Untitled4:4:39: Warning: Initial value for constant variable has to be compile-time constant. This will fail to compile with the next breaking version change.
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
                                      ^----------------------------------------^

This second error will disappear if you remove the constant modifier.

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear.

But I just checked your code in Remix and I get a new warning message:

Untitled4:4:39: Warning: Initial value for constant variable has to be compile-time constant. This will fail to compile with the next breaking version change.
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
                                      ^----------------------------------------^

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear. The compiler checks the checksummed address for validity.

But I just checked your code with the checksummed address in Remix and I get a new warning message:

Untitled4:4:39: Warning: Initial value for constant variable has to be compile-time constant. This will fail to compile with the next breaking version change.
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
                                      ^----------------------------------------^

This second error will disappear if you remove the constant modifier.

added 415 characters in body
Source Link
BokkyPooBah
  • 40.4k
  • 14
  • 123
  • 193

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear.

But I just checked your code in Remix and I get a new warning message:

Untitled4:4:39: Warning: Initial value for constant variable has to be compile-time constant. This will fail to compile with the next breaking version change.
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
                                      ^----------------------------------------^

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear.

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear.

But I just checked your code in Remix and I get a new warning message:

Untitled4:4:39: Warning: Initial value for constant variable has to be compile-time constant. This will fail to compile with the next breaking version change.
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
                                      ^----------------------------------------^
Source Link
BokkyPooBah
  • 40.4k
  • 14
  • 123
  • 193

Enter your address in https://etherscan.io/ and copy the uppercase/lowercase checksummed version and paste it into your solidity code.

contract Sample {
  address constant public myAddress = 0xE0f5206BBD039e7b0592d8918820024e2a7437b9;
  uint public vari;
  function setVari(uint a) {
    if(msg.sender == myAddress) {
      vari = a;
    }
  }  
}

And the warning message will disappear.