We started to work on smart contract project on BEP20 tokens and we deployed a smart contract , now one of my customer wants to burn some tokens but in our contract i saw that _burn and _burnFrom both are interal functions and couldn't able to call them from outside, so now my question is- how come we burn the tokens since both are internal functions, please let us know.
1 Answer
Use at your own risk
You cannot call those internal methods if your contract is deployed and it does not have a public method that can invoke those 2 functions.
However, there is another way to burn tokens and it is by sending them to an inaccessible address or contract. This has the same effect as burning but it will not reduce the value that is stored "totalsupply" variable
On the Ethereum mainnet developers/people usually send their tokens to one of these 2 addresses (some contracts don't let you send it to the zero address and therefore you must use the dead address or any other inaccessible one)
Zero Address: 0x0000000000000000000000000000000000000000
Dead Address: 0x000000000000000000000000000000000000dEaD
-
Thank you for your reply, believe the second option will help us! Commented Jul 21, 2022 at 7:59