I'm trying to get a first smart contract working. I started more ambitions but now I've retreated to the simplest thing I can think of:
In LLL, this contract just receives an amount and refunds it to the sender.
(mktx (txsender) (txvalue) 0)
It produces this EVM which looks fine:
PUSH 0x0 TXVALUE TXSENDER MKTX
Using OSX AlethZero, I send 1000 finney to an empty address with the above code as the data. After the next block is mined, I see my contract is created at 929ec83f.. and is has a balance of 1000finney as expected. Checking it's contents in the contracts pane, I see my code. So far so good.
Now to test it, I send 100finney to the 929ec83f.. contract (data field left empty). After the next block is mined, I see that transaction. The contract's new balance is 980finney. This suggests that the contract received the finney, sent it back, and consumed another 20finney in execution fees. I expect to see a transaction refunding 100finney back to my sending address on the next block. However, this doesn't appear.
What went wrong?