The idea is simple: you can send transactions using any ethereum wallet, and every such wallet has an additional data to send called "transaction data". For example, I want users to be able to type in that data field name of the product they are purchasing, a simple string or maybe an integer value (index of a product). Is that possible? I just want users be able to not only interact with my contract using metamask or mist, but also just using their maybe online wallets or etc.
As I read in docs, I have to use a standard fallback payable function, like
contract Test {
function() payable {}
}
and somehow read the msg.data
. How is that possible to read it?
I searched the questions but none of them had the right answer.
But there is more: fallback function executes only 2300 gas
, so how can I handle it then?