1msc.xyz

How to Check if a Token Has Hidden Owner Functions in the Bytecode

Hidden owner functions in a token's bytecode can let a developer drain liquidity, mint unlimited supply, or blacklist holders after you buy. You can detect these hidden commands without reading Solidity code by examining the contract's raw bytecode and its function signatures.

Why Bytecode Matters

The bytecode is the compiled machine-readable version of a smart contract that runs on the blockchain. A developer can include functions in the bytecode that do not appear in the public source code or the verified contract on a block explorer. These hidden owner functions can be triggered by anyone who knows the function signature - often only the deployer. Checking bytecode reveals if a token has extra capabilities beyond what the verified source claims.

Step 1: Get the Contract Address

If you are considering a token, you already have its contract address from a trading platform, social media post, or a swap interface. Confirm it is correct by cross-referencing on a reputable source like CoinGecko or CoinMarketCap. Never rely on a single link.

Step 2: Verify the Contract on a Block Explorer

Open the token contract on a block explorer such as Etherscan (for Ethereum) or BscScan (for Binance Smart Chain). Look for a green checkmark or "Verified" label next to the contract address. If the contract is not verified, you cannot see the source code, and hidden functions are more likely. Unverified contracts are a red flag - consider skipping them.

Step 3: Read the Source Code (If Available)

Click the "Contract" tab, then "Read Contract" or "Read as Proxy" if applicable. Scan for suspicious functions:

These are red flags, but they are visible in the source. Hidden functions are not.

Step 4: Inspect the Bytecode for Unknown Function Signatures

To find hidden functions, you need the bytecode directly. On the block explorer, go to the "Contract" tab and click "Bytecode" (or "Contract Creation Code"). Copy the entire hex string.

Now use a tool to decode function signatures. The standard method is a 4-byte selector database like 4byte.directory or a command-line tool like cast from Foundry. Paste the bytecode into a selector finder - it will extract all 4-byte identifiers embedded in the code. Compare these to the signatures visible in the source code. Any unidentified selector is a potential hidden function.

Example: If the source shows only transfer(address,uint256) but the bytecode contains a selector for mintTo(address,uint256), the developer can mint new tokens even though the source does not show it.

Step 5: Check for Selfdestruct or Suicide Opcode

A particularly dangerous hidden function is one that calls SELFDESTRUCT (previously SUICIDE). This opcode destroys the contract and sends any remaining balance to a designated address. In bytecode, it appears as the byte 0xFF. Search the bytecode for FF - if found, the developer can potentially selfdestruct the contract and steal all locked liquidity. This is rare in modern tokens but worth checking.

Step 6: use automated bytecode scanners

Several free tools automate bytecode analysis for hidden functions:

These tools are not perfect - they miss novel hidden functions - but they catch common patterns.

Step 7: Confirm with a Test Transaction

Even after bytecode analysis, the safest final step is a small live test. Buy a tiny amount (e.g., $5 worth) and immediately try to sell it. Check if:

Hidden owner functions often trigger only when the developer wants to rug. A successful test does not guarantee safety, but a failed test is definitive.

Limitations of bytecode analysis

What to do if you find hidden functions

Stop. Do not buy the token. Report the contract address on forums like RugDoc or in community Telegram groups. Hidden owner functions are almost always a sign of planned theft. No legitimate project needs secret admin commands in the bytecode.

The combination of bytecode inspection, source code comparison, and a live test gives you the strongest protection against tokens with hidden owner functions. No single step is sufficient - use all three before committing real funds.

Not financial advice. 1msc.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to token safety