Sample crowdsale contracts help

I have already created my token, and now I want to make a contract. I only need to have the corresponding ETH when someone gives me the corresponding ETH, and I return the corresponding token to him, 1:1. I am really a little white, please help me with the code and deployment, thank you very much.

You just need to make a payable function that when you transfer in ETH, it gives them Token.

how to do that… really need your help, please…

how to do that… really need your help, please…

If you’re new you should walk through OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat

Then go over the learning material.

This will give you some understanding how to write any function desire.

What you want to accomplish is move ETH into a contract, then the contract dispense tokens. Have that transfer upon receiving ETH in a payable function.