If my contract calls suicide() referencing a contract as the recipient of funds, and that recipient contract default function calls back into my contract, will the call succeed?
contract A {
function die(address _recipient) external {
suicide(_recipient);
}
}
contract B {
A a;
function () {
a.die(this);
}
}
More importantly, does it matter? Won't all the remaining ETH have been sent as part of the call into B?
Follow-up:
The yellow paper shows that balances are manipulated directly, and not through a call. (pg 29 under the SUICIDE instruction)
The core/vm/instructions.go file in the master branch of the Go client defines the opSuicide() method which looks like it's the one called during execution, and it looks like it doesn't even transfer the balance. It just adds it to the recipient and deletes the calling contract.
func opSuicide(instr instruction, pc *uint64, env Environment, contract *Contract, memory *Memory, stack *stack) {
balance := env.Db().GetBalance(contract.Address())
env.Db().AddBalance(common.BigToAddress(stack.pop()), balance)
env.Db().Delete(contract.Address())
}
Can anyone confirm their understanding of this?