2

I am getting this error while a contract compilation using online solidity compiler :

Untitled:23:19: Error: Member "value" not found or not visible after argument-dependent lookup in string storage pointer - did you forget the "payable" modifier? var amount = msg.value; ^-------^

Contract code is like this :

function transfer(address user) payable {
        var amount = msg.value;
        var sender = msg.sender;

What wrong i am doing ?

6
  • Nothing obviously wrong with this section. I got it to compile without issues by just wrapping it in contract X {}. Commented May 9, 2017 at 19:36
  • There is nothing wrong with it. What solidity compiler version you are using? Commented May 9, 2017 at 19:59
  • change the compiler and retry
    – Sig Touri
    Commented May 9, 2017 at 22:55
  • I used solidity online solidity remix browser. I also tried to change the version, but error persisted. In one other contract , i used same but it was not throwing any error on remix browser. Don't know what is wrong
    – Aniket
    Commented May 10, 2017 at 6:35
  • Have you found a solution? Commented Jul 20, 2017 at 7:52

1 Answer 1

0

I found the error later. Nothing was wrong with the remix. I have declared a string with identifier as 'msg'. And it was the source of all the causes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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