I am a DAPP Developer in Korea. I have publish my own token using eosio.token recently. I love to study eos main network system. Now I am trying to learn how swap my token with EOS. So that I was looking for the contract examples or templates swapping any EOS based token with eos or any other token. I am wodering that there are the templates or example from system contract or any other sources I can look into. Thank you.
Tokens are simply numbers stored in tables of the smart contract user that issues them.
You could even create a new "EOS" token if you deploy the
eosio.token contract to a user.
There exists no logic to swap from one token to another; but you could write it given you had some price feed that creates a "value" for each token.
If you create a self issued token that gets listed on exchanges and has a value, you could sell it and use the proceeds to purchase EOS or another token, but that isn't really what you are asking .. that's just using a currency exchange with existing markets.