So, I figured out the issue. My "payable" function is called buy(). I assumed that the contract would automatically select the payable function when sending ether, but it looks like you need the catch-all payable function, instead of a named one, to receive arbitrary ether payments. Once I removed the function name, it all worked.
Edit: Although the below information was part of the issue, the specific solution is above.
So as best I can tell here is the issue...
- On create, the contract code gives the owner account the initial supply of tokens
- So implicitly the contract account has zero tokens
- The buy() operations are expected to pull from the contract account
So for buy() to work there are a couple options (in order of increasing complexity)
- Add the initial supply to the contract account instead of the owner account. (requires contract code change)
- Transfer some tokens to the contract account from the owner, post creation. (Requires 1 extra transactions, no code)
- Send some ether to the contract account and sell tokens from the owner back to the contract (Requires 1 extra transaction and spending ether)
It makes perfect sense looking at the code in detail, just didnt catch the aspect of the owner address, referenced as "msg.sender" as opposed to the contract address, referenced as "this".