What's the difference between these two forms of calling methods on external contracts?
contract A {
function foo() {
}
}
contract B {
function createFoo (address _contractAddress){
Contract A = A(_contractAddress);
A.foo();
}
function callFoo (address _contractAddress) {
address newAddress = _contractAddress;
newAddress.call(bytes4(sha3("foo()")));
}
}
createFoo
and callFoo
seem to do the same thing. How are they different?
CALL
s. On Solidity level, they are different when it comes to error propagation