Burn and mint tokens

i was thinking if there was possibly a way to write a code that reads market prices of a particular token

then the token is able to be burnt and replaced with a stable coin pegged at the dollar
scenario ( I drop $280 worth of BNB in this contract
the bnb is sent to a burn address and is replaced with a stable coin worth $280 at that instance

is this possible and how do I go through it

I need guidance on my project

There are things you’ll need to research on your own. Burning BNB though is a bad idea. It would be better to have the BNB locked in the stablecoin contract and mint the stablecoin on deposit of BNB. Then it’s possible to reverse the transaction by calling a function that burns the stablecoin and returns the BNB.

There are many contract security issues that need to be taken into consideration that are beyond the scope of a forum post. I’d recommend joining the Ivan on Tech Academy. Take the Solidity Programming courses and the Smart Contract Security course. That will be a good start.

2 Likes