Why call.value()() is used in smart contracts instead of send? Can someone help me to understand importance of call.value()()?

  • Your question was already answered here : ethereum.stackexchange.com/questions/8270/… Commented Mar 25, 2018 at 11:45
  • I got the first two point but third point is not yet clear. How can we call the function without knowing it's signature with the help of call()? In the example that you have mentioned, we are still taking the help of function's signature. One more thing, is it at all possible not to know the function's signature? Since the contract is deployed why the function's signature is not visible? Please help me to understand these points regarding call().
    – snehal
    Commented Mar 25, 2018 at 20:14
  • Well, I suppose it's an edge case and rarely used, but for example, let's say a dapp gives you some data to send to their contract if you want to, let's say, register your address. They give you the data in hex, so you don't know anything about the function called. Then, if you want to whitelist a contract instead of a "normal address", it's possible by using the call function, passing the data they gave to you. Commented Mar 25, 2018 at 20:25

2 Answers 2


EDIT Dec 2019: call.value()() should now be used for transferring ether.

See: Is transfer() still safe after the Istanbul update (2300 gas limitation)?


I don't have enough reputation to comment voluntarily so I will answer here. You may want to use call for several, it depends on your needs, although I don't see alot of them.

  • the function you call is payable and you want to send ETH as well.
  • you want to set the gas "given" to the function (21k gas default limit)
  • you do not know the function's signature in the called contract, so you use call with data (in bytes)

Edit : Here's an example.

contract Called{
    uint public myuint;

    function set(uint _var) {
        myuint = _var;

    function get() view returns (uint){
        return myuint;

interface Called{
    function set(uint);
    function get() view returns (uint);

contract Caller {

    Called public called_address;

    function set_address(address _addy) {
        called_address = Called(_addy);

    function set(uint256 _var) {

    function set_call(address _called, uint256 _var) {
        _called.call(bytes4(sha3("set(uint256)")), _var);

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.