I've been experimenting with some generic copy-paste codes on the Ropsten Test Net and I am able to create a token and have the creator receive all the tokens. However, when I try to buy these test tokens on a second account, the Ether is sent, and no tokens ever come back my way. I'm just wondering where I should be looking in the code for this function since nothing anywhere else online seems to have my answer.
2 Answers
Check the following conditions
- You have default function as payable so that it accepts ETH
- You have the buy/sell price in the token contract
The crowdsale functionality can be separated from the token.
Suggest reading the OpenZeppelin documentation on creating tokens and crowdsales https://docs.openzeppelin.com/contracts/2.x/tokens https://docs.openzeppelin.com/contracts/2.x/crowdsales