I would like to create two types of tokens:
- Let's call them ND, about 10 contracts with non-divisible tokens (so far) in the mapping uint => address
- Let's call it DV, one contract with divisible ether-like tokens
In my contract users can buy DV for ether, it's working. But the problem is that I want to make an automatic way to buy ND with DV, for example with function.
For example I set price 0.1 of ND (3rd from the array of 10 total), and when user want to buy ND and send 0.1 of DV, will recive 1 ND.
I would need to implement cross trade between contracts somehow. Does anybody have any kind of help how can I make such thing?
For now two tokens are pretty basic from tutorial with simple buy for ether function and decimals difference, as said above, so I don't think there is any need to share that extremely basic code.