Is is possible to call a Smart Contract from an existing Smart Contract? Lets say you are an function and want to call an other smart Contract - is this possible? How?
1 Answer
This is covered in the documentation under External Function Calls:
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)(); }
}
Though not an exact duplicate, this thread may be of use in creating a working example: How to make external contract function calls from one contract to another?