0

How can we convert ( via smart contract coding ) any erc20 token like BAT back to ETH or USDC ? I am very new to smart contract programming and I want to write the smart contract for the conversion. Can anyone please help with the logic I should start with for the conversion?

1
  • what do you mean by "convert"? like get the price of your ERC20 token in ETH or USDC? or swap your token for eth or usdc?
    – Foxxxey
    Aug 2 '21 at 12:35
1

You should use Uniswap in your contract, it's the most popular decentralized exchange, and you can view their documentation

https://uniswap.org/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.