0

Is it possible to destroy ERC20 tokens held in a specific address? We can write a method in contract using Ownable so only contract owner can execute it but my doubt is whether owner will actually be able to execute the method since tokens are held by a different account and smart contract owner can't sign the transaction for setting the balance of that address to 0?

How can this be done? This is needed in eventuality of stolen tokens. Are there any alternatives to described approach?

1 Answer 1

1

Certainly this can be done. The token contract can change whatever balance it's programmed to change. It's hard to give exact code without seeing your contract, but something like this:

function destroyTokens(addr) onlyOwner {
    balanceOf[addr] = 0;
}

But hopefully people would refuse to use a token containing a backdoor like this. If you're asking people to trust you completely, I don't see the point of having a smart contract.

1
  • I see your point but we have a different use case where our token isn't listed on public exchanges. It's a standard ERC20 token but meant to be used by a "closed" circle. In any case, what do you suggest as a more open approach for handling stolen tokens. I know making the system as secure as possible and hoping nothing bad happens is one thing but one must be prepared for any such eventuality. Right?
    – eth.block
    Commented Mar 8, 2018 at 2:39

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.