ICO Smart contract

is there any smart contract template on plutus where A tokens are locked in one transaction and exchanged for B tokens from different wallets for a specific time?

This smart contract would serve to make an ICO, I have looked at the crowfunding example of plutus playground but that example only receives tokens and does not exchange them for others if I am not mistaken