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

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.

  • 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 Mar 8 '18 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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