Rewriting Solidity statements on sending money

by user3509406   Last Updated April 15, 2019 07:28 AM

I want to rewrite

  - msg.sender.call.value(amount)();

into

  - msg.sender.call(abi.encodeWithSignature(???,amount));

But I am not sure what a signature string must be given for the part of the three question marks. The original statement is simply a sending of money amounting 'amount', and so if the receiver account is a contract, its fallback function must be called. This is my understanding. Then, my question seems to be what is a signature for fallback function.

The reason for the rewriting is because of this.

I have a solc compiler version 0.5.7 but the Solidity example program that I try to compile has a declaration of pragma 0.4.8.

If I simply change the version number, I will get a compilation error for

 -  msg.sender.call.value(amount).()

because the style of the statement seems to be old and it is not supported by the solidity compiler version 0.5.7.

Can you please help me out to resolve this issue?

Thanks in advance.

Tags : solidity


Related Questions


Updated October 09, 2018 12:28 PM

Updated November 28, 2018 04:28 AM

Updated December 12, 2018 08:28 AM

Updated January 10, 2019 23:28 PM

Updated July 23, 2018 00:28 AM