Swap contract with 1:1 transfer rate. Pls Help

I’m just a curious soul learning by doing. But im wrecking my brain around how to do this.

A smart contract that automatically receives a token and sends a different token at a 1:1 ratio.

Additional features i may want to implement are changing the ratio, and charging a transaction fee.

I’m not trying to build an exchange as there is no need for liquidity. just a simple 3rd party contract to distribute tokenA to addresses that sends tokenB to contract.

would erc777 be the standard i’m looking to use?

Any resources i can look at or anyone able to point me in the right direction? Help is much appreciated.

Hey if you need I can code for you. Otherwise I suggest to check OpenZeppelin docs:

Yes, i looked at open zeppelin but was not sure which best fit my needs. I do know a crowsale contract is not what I’m looking for.

  • i might take U up on that offer… I’m in a bootcamp learning everything but the things I want to do has not been done, or is not very popular.

If you want to swap 1:1 and end up chosing ERC-20 tokens, make sure that both tokens have the same amount of decimals :wink: