Simple burnFrom function only owner

-but limit it to onlyOwner and only the contract address!

:computer: Environment



:1234: Code to reproduce

function burnFrom(address account, uint256 amount) onlyOwner {
      uint256 decreasedAllowance = _allowances[account][_msgSender()].sub(amount, "BEP20: burn amount exceeds allowance");

      _approve(account, _msgSender(), decreasedAllowance);
      _burn(account, amount);

Hi, welcome! :wave:

Why would you want to add the modifier onlyOwner for this function? And what is your purpose?

so my Audi is not finished yet I have another possibility to burn my lp fee with the function!

function _burnFrom (uint256 value) external onlyOwner {
         _burn (address (this), amount);

but I get an error when compiling



Ohhh, I see, maybe you should rename the this function name, such as burnFee() or something else, _burnFrom() is really a confusing function name for your actual purpose.

Could you please share the whole source code?

i new user / i can only 2 links hm

thx for the help

Never mind, we all grew from baby.

And for your shared code, it can not be compiled, there are some errors, if you write this contract, try to fix the errors, if not, so what is the original source code?

you can raise up your rank in league of legends using