Here I am trying to invoke fallback function of A .Is it the right ? I am trying to understand the DAO attack by simple programs.
I need to send B's contract address in constructor A() .
pragma solidity ^0.4.8;
contract A {
address destAdd;
function A(address sendContractAddress) {
destAdd = sendContractAddress;
}
function () {
uint transferAmt= this.balance;
if (!msg.sender.call.value(transferAmt)()) throw;
}
}
contract B {
function() {
// invoke fallback function of A
bool ret = msg.sender.call('0xabcdefgh');
if (!ret) throw;
}
}

