How did my tokens disappear? GoPlus Security explains the new token risk of “Contract Self-Destruction”!

GoPlus Security
3 min readAug 10, 2022

--

You may not expect that the assets you bought can suddenly disappear from the blockchain, not just the token amount disappears, but the Token with its name together no longer exists. So how could this happen?

GoPlus Security’s researchers came across such feedback from a user recently. The user had previously bought a Token with the following contract address 0xB8c9817F1d9F473B974FF96F2D102D049B6EDAb1.

When the user checked it one day, he found that the Token disappeared from his wallet, and it could not be found when he tried to add the token to the wallet again. It shows “The token does not exist” in the wallet, and also could not be found on Etherscan.

GoPlus’s security researchers have conducted a study and found that the Token contract the user mentioned had self-destructed! Here is a quick overview of what contract self-destruction is.

1. Definition

First, let’s define what self-destruction is. Contract self-destruction simply means that the contract can be destroyed. And after the destruction, the contract and the assets corresponding to the contract will no longer exist.

2. Implementation method

Let’s take this disappeared Token as an example to see how to implement this function, the Token contract address is 0xB8c9817F1d9F473B974FF96F2D102D049B6EDAb1.

See a self-destruct function in this contract

We can see that the contract has a self-destruct logic that will self-destruct when this function is enabled.

And we see that the contract has activated the self-destruct logic. After the contract self-destructs, then the Token of this contract will be gone.

3. How to avoid self-destruction tokens?

We recommend that users check the source contract code and see if there is a self-destructing feature associated with it before buying if they have a dev background or know how to code.

If you do not read code or you want to save time on it, GoPlus’ Token Security Detection API is a good choice, which has already supported this field — selfdestruct — in GoPlus V1.1.12.

If the value of this field is 1, that means the contract contains self-destruct function, and this token is an absolute high-risk asset. We recommend not to buy it.

--

--

GoPlus Security
GoPlus Security

Written by GoPlus Security

Empowering a #SaferWeb3 with user-driven, open access security solutions. Championing user education for a fortified front against adversaries.

No responses yet