constructor(string memory enterOrganizationName) public {
    owner = msg.sender;
    status = true;
    addUser(0, "", "");
    addUser(owner, 'Creator and Owner of Smart Contract', "");
    organizationName = enterOrganizationName;
    numberOfUsers = 0;
    addEndorsee(0, "");
    numberOfEndorsees = 0;

giving below error.

TypeError: Invalid type for argument in function call. Invalid implicit conversion from int_const 0 to address requested.
        addUser(0, "", "");

I'm still new in Ethereum platform so I'm not sure what that error means.


It seems the type of the first argument of your addUser function is an address. If you want to initialize it with the "address 0", you have to explicitly convert it like that : addUser(address(0), "", "")


This Address(0) worked for me.

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.