0

Newbie here - I launched a contract in Remix with a burn feature and a revoke feature. If I revoke the contract, will I still be able to initiate burns in Remix?

3
  • Please be more specific Commented Aug 1, 2023 at 5:04
  • In Remix, if I press the orange button that says revoke, can I still enter a token amount next to the orange button that says burn? Many desire for the contract to be revoked, I am just not sure what impact that would have on my ability to maintain my burn schedule
    – user124436
    Commented Aug 1, 2023 at 5:11
  • Man, this totally depends on what contract are you talking about. How do we know what's written on the contract. Remix is just an IDE. Can you please paste the contract code or tell what does the contract is supposed to do. Commented Aug 1, 2023 at 11:23

1 Answer 1

0

I guess you mean renounceOwnership()? The function basically sets a zero address as the owner of the contract. Considering the burn function, yes it will still work in the standard ERC20 contract.

Here's the burn function:

function burn(uint256 amount) public virtual {
    _burn(_msgSender(), amount);
}

As you can see, the function doesn't have any onlyOwner checks. All it needs is that the caller has a token balance to burn. That's it. So yes, it will work.

3
  • function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; }
    – user124436
    Commented Aug 1, 2023 at 13:41
  • not sure why it looses the formatting after I post the comment.
    – user124436
    Commented Aug 1, 2023 at 13:42
  • thank you for reviewing
    – user124436
    Commented Aug 1, 2023 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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