I'm new to this and I have a question regarding the following case:
suppose I defined and deployed a coin A, so coin A publicly exists in the network. Now suppose there is another contract called "conference", and it requires coin A (instead of ether) to buy a ticket. I do have some balance in A's mapping(address --> uint) balance, then given the fact that A is already deployed, how can I send some amount of coin A to conference contract address?
I'm confused since I only know how to send ether by calling address.send(contract_address). Is there a programmatic way for self-defined currency? Thanks.
I know a indirect way to do that: I transfer some amount of A of my account to the conference address by calling A.transferFrom(myaddress, conference), then upon receiving the transaction, the conference organizer calls conference.updateBalance(myaddress, 1).
But is there a direct way to achieve that? i.e. I call conference.buy(uint amount), both balance in A's contract and conference's contract get updated.
Thanks a lot for the help.