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 ?

  • Nothing obviously wrong with this section. I got it to compile without issues by just wrapping it in contract X {}. – Rob Hitchens - B9lab May 9 '17 at 19:36
  • There is nothing wrong with it. What solidity compiler version you are using? – Prashant Prabhakar Singh May 9 '17 at 19:59
  • change the compiler and retry – Sig Touri May 9 '17 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 May 10 '17 at 6:35
  • Have you found a solution? – NineCattoRules Jul 20 '17 at 7:52
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, privacy policy and cookie policy

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