1) Yes.
2) See following.
Here's a wallet executed internal transaction - 0xcad1183ecf7f278713858d92c06f00934f79a75eb5c852352a3ac35de07e151c.
I use the following to firstly extract the debugging information:
user@Kumquat:~$ geth --exec 'debug.traceTransaction("0xcad1183ecf7f278713858d92c06f00934f79a75eb5c852352a3ac35de07e151c")' attach > 0xcad1183ecf7f278713858d92c06f00934f79a75eb5c852352a3ac35de07e151c.txt
Looking in the output file, I search for all "CALL" instructions and these are:
1)
}, {
depth: 2,
error: "",
gas: 25007,
gasCost: 109040,
memory: ["0000000000000000000000000040a54aa449a9a8f4e8a0641a1caf76efcc0c8e", "0000000000000000000000000000000000000000000000000000000000000102", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000040a54aa449a9a8f4e8a0641a1caf76efcc0c8e", "0000000000000000000000000000000000000000000000004563918244f40000", "000000000000000000000000bb9bc244d798123fde783fcc1c72d3bb8c189413", "0000000000000000000000000000000000000000000000000000000000000080", "0000000000000000000000000000000000000000000000000000000000000000"],
op: "CALL",
pc: 2299,
stack: ["00000000000000000000000000000000000000000000000000000000b61d27f6", "00000000000000000000000000000000000000000000000000000000000003c6", "000000000000000000000000bb9bc244d798123fde783fcc1c72d3bb8c189413", "0000000000000000000000000000000000000000000000004563918244f40000", "0000000000000000000000000000000000000000000000000000000000000084", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "000000000000000000000000bb9bc244d798123fde783fcc1c72d3bb8c189413", "0000000000000000000000000000000000000000000000004563918244f40000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000004563918244f40000", "000000000000000000000000bb9bc244d798123fde783fcc1c72d3bb8c189413", "00000000000000000000000000000000000000000000000000000000000186a0"],
storage: {
0000000000000000000000000000000000000000000000000000000000000106: "0000000000000000000000000000000000000000000000004563918244f40000",
0000000000000000000000000000000000000000000000000000000000000107: "000000000000000000000000000000000000000000000000000000000000422c"
}
}, {
2)
}, {
depth: 3,
error: "",
gas: 25007,
gasCost: 76291,
memory: ["0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060"],
op: "CALL",
pc: 2761,
stack: ["0000000000000000000000000000000000000000000000000000000000000966", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000980", "000000000000000000000000ff8fb62c8a7d3bb7b825c6b859020d4eac9ea998", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000003782dace9d900000", "000000000000000000000000807640a13483f8ac783c557fcdf27be11ea4ac7a", "0000000000000000000000000000000000000000000000000de0b6b3a7640000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060", "0000000000000000000000000000000000000000000000000de0b6b3a7640000", "000000000000000000000000807640a13483f8ac783c557fcdf27be11ea4ac7a", "00000000000000000000000000000000000000000000000000000000000106b3"],
storage: {}
}, {
The following code from github.com/bokkypoobah/TheDAOData/getTheDAOCreatedTokenEventsWithNonZeroExtraBalance_v3#L65-L85 will detect Wallet contract execute(...)
functions using the function signature 0xb61d27f6 which is on the stack of the 1) "CALL" trace above.
status.structLogs.forEach(function(e) {
if (e.op == "CALL") {
var stack = e.stack;
extraBalanceAmount = web3.toBigNumber("0x" + stack[stack.length-3]);
// baac5300 = createTokenProxy(address) - https://www.4byte.directory/signatures/?bytes4_signature=0xbaac5300
if (stack[0].substring(56) == "baac5300") {
tokenOwner = "0x" + stack[2].substring(24);
createdBy = "Proxy";
} else if (stack[0].substring(56) == "b61d27f6") {
amount = web3.toBigNumber("0x" + stack[stack.length-3]);
} else if (stack[0].substring(56) == "00000966") {
if (("0x" + stack[3].substring(24)) != tokenOwner) {
tokenOwner = "0x" + stack[3].substring(24);
createdBy = "Wallet Contract";
}
}
}
if (e.error.length > 0) {
error = e.error;
}
});
And from https://github.com/ethereum/dapp-bin/wallet/wallet.sol#L344-L360 the execute(...)
function has the following parameters:
function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 _r) {
which matches the function signature from 0xb61d27f6:
execute(address,uint256,bytes)
Note that a multisig wallet contract call is from a confirm(...)
function. From github.com/ethereum/dapp-bin/wallet/wallet.sol#L362-L371:
// confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order
// to determine the body of the transaction from the hash provided.
function confirm(bytes32 _h) onlymanyowners(_h) returns (bool) {
if (m_txs[_h].to != 0) {
m_txs[_h].to.call.value(m_txs[_h].value)(m_txs[_h].data);
MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to, m_txs[_h].data);
delete m_txs[_h];
return true;
}
}
I saw this message two days ago New in Geth: Support for server-side transaction tracing with custom JS callbacks!, but have not had time to check out the new debug.traceTransaction(...)
functionality:
[–]nickjohnsonEthereum - Nick Johnson[S] 22 points 2 days ago
tl;dr: You can now call debug.traceTransaction with a custom JavaScript function; that function gets executed for every step of the VM on the target transaction, letting you accumulate and transmit back only the details you care about from the traced transaction - for instance, you can return just the call graph, or just a list of successful value transfers.