0
 function getFrom(bytes32 transferId)public returns (address ) {
    Transfer memory transfer = transfers[transferId];        
    if (msg.sender != transfer.to && msg.sender != transfer.from)  return 0x0;
    return transfer.from;
}
function getTo(bytes32 transferId)public returns (address) {
    Transfer memory transfer = transfers[transferId];
 if (msg.sender != transfer .to && msg.sender != transfer .from) return 0x0;
    return transfer.to;
}

I am getting error like this

TypeError: Return argument type int_const 0 is not implicitly convertible to expected type (type of first return variable) address. if (msg.sender != transfer.to && msg.sender != transfer.from) return 0x0; ^-^

how to resolve this issue? thank you in advance

0

Use explicit type conversion:

        return address(0x00);
  • thank you it worked – Suhas S Jan 6 at 9:40

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.