0

I know there are plenty of questions like this but I believe this is different.

Based on this question, I wrote this

pragma solidity ^0.4.11;

contract Registry {
    mapping(string => address) ID;
    mapping(address => address) Contract;

    function addID(string _id, address publicAddress) {
        ID[_id] = publicAddress;
    }

    function addContract(address _owner) {
        Contract[_owner] = msg.sender;
    }
}

contract User {
    // The GMC contract
    address regAddress = 0xf70ce669d4fa2bdeae1c4c61021627fc4b1d463c;
    address owner = msg.sender;

    function addID(string _id){
        // Get the GMC contract
        Registry registry = Registry(regAddress);
        registry.addID(_id, owner);
    }

    function addContract(address _owner) {
        Registry registry = Registry(regAddress);
        registry.addContract(owner);
    }
}

Also, I'm 100% sure that the contract Registry has been mined at address 0xf70ce669d4fa2bdeae1c4c61021627fc4b1d463c.

Pasting as is on Remix returns an error

This looks like an address but has invalid checksum

Following this answer, I tried converting the address to upper case. That returns

TypeError: Invalid literal value

One suggestion in the question is to use import. I'm not doing that because of another (unanswered) question I asked here (can't use import when deploying with NodeJS).

Help would be much appreciated!

1

use address regAddress =0xF70ce669d4FA2BdEae1c4C61021627fC4b1d463C and the error will be dismissed.

the trick is to use https://etherscan.io/ to give you back the address with the checksum.

  • The answer worked but could you explain why this is? – mcansado Aug 16 '17 at 14:59

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.