Understanding token smart contracts and presale smart contracts

How do I connect the token ive created with a presale smart contract so it knows, when people send their ether/BNB to the presale contract, its going to take the tokens from my token contract and not any old contract on the blockchain. Do I just send some of the tokens to the presale contract address? Then send remaining tokens to token contract address and some to liquidity? And if so do I write the total supply into presale contract or just the amount I want to sell in the presale?if so can I even send just a percentage to the presell contract or do I have to send it all and have the remaining tokens sent back to me. Wouldnt that mean theoreticlly I could have multiple presales with the same token at once with different presale token addresses if i could only send a small percentage to each presale contract(i know it wouldnt make sense to do i just want a better understanding of how contracts work). If not how do I write/import my token code into the presale contract? Do i write the token address into the code of presale before deployment? Can I use remix or do I need truffle? Ive seen so many information with no straight forward answer to this any input would be greatly appreciated.

1 Like