I want to create a presale system. Can you help me?

Hello, I have created an ERC20 token. I want to create a new contract called Presale and collect it here presale. The token can be purchased on both ETH and USDT.
There is one problem.

How can I set up selling with both ETH and USDT. So if the token price is 0.1USDT, if the person makes the payment with ETH, do I have to calculate it based on the ETH price over solidity?

What should the process be like here?


You will need to either use a price oracle to tell you the current exchange rate, or you will need to directly access a Dex/swap pool to get the current price. Just keep in mind to use an average price over several blocks to prevent any flash loans from changing the exchange rate in the same block.

I can help you.
Please contact me.