Is this (syntax 1):
feed.info.value(10).gas(800)();
equivalent to (syntax 2):
feed.sendTransaction({value: 10, gas: 800, from: address(this)})
?
In which case, how will the Consumer
contract have the 10 eth in the first place since it has no payable function?
I saw the first of these lines in the infofeed example here:
contract InfoFeed {
function info() payable returns (uint ret) { return 42; }
}
contract Consumer {
InfoFeed feed;
function setFeed(address addr) { feed = InfoFeed(addr); }
function callFeed() { feed.info.value(10).gas(800)(); }
}
If there are equivalent, suppose InfoFeed.info()
were to take some arguments. How could we send the value of these argument using the first syntax please?
Thanks