When calling to start()
function in a Smart Contract, transaction fails with this message:
Warning! Error encountered during contract execution [Bad jump destination]
According to Error During Token Contract Execution ... an invalid array index definitely generates this message. So I have been thinking about it, trying to figure out when my code is using an invalid index, but I can't find it.
This is the method requested:
function start(address seller, address thirdParty) returns (uint escrowId) {
escrowId = numEscrows;
numEscrows++;
escrow e;
e.thirdParty = thirdParty;
e.seller = seller;
e.buyer = msg.sender;
e.amount = msg.value;
e.recipient = seller;
e.status = 1; // started
escrows[escrowId] = e;
return escrowId;
}
The only array there is escrows[]
declared as mapping (uint => escrow) escrows;
After trying different things, I came to conclusion that problem surely is located at last line: escrows[escrowId] = e;
Is not possible to make such an assignment escrows[0] = e;
? Why not?
What am I doing wrong? How can I debug it?