I have this:

contract Diary {
    string[] private facts;
    mapping (address => bool) approvedAddresses;
    address owner;

    constructor() public {
        owner = msg.sender;
        approvedAddresses[0xca35b7d915458ef540ade6068dfe2f44e8fa733c] = true;

I get this error:

SyntaxError: This looks like an address but has an invalid checksum. Correct checksummed address: "0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c". If this is not used as an address..

Which is the correct way to do this? I'm new to solidity..

  • 2
    Solidity doesn't like addresses that aren't in their proper checksummed form. Just use the checksummed version of the address that they gave you: 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c. – user19510 Sep 18 '19 at 23:42

The error message gives you both the reason for error (incorrect checksum) and the way to fix the error (the letters in your address must be uppercase).
Just copy paste the address provided by the error message in your code.
See this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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