Sub topic 6
Liquidity Removal, Hidden Minting, and Honeypots
This chapter assumes you understand wallets, blockchain transactions, and the basic purpose of a token. You should also know that an automated market maker (AMM) prices tokens from the assets held in a liquidity pool. The examples use simple Python and Solidity.
Three Ways a Token Can Trap Buyers
A rug pull is an abuse of a token project or its market that transfers value from buyers to insiders. The mechanism matters because each type leaves different evidence on-chain.
| Type | Main mechanism | What buyers experience |
|---|---|---|
| Liquidity removal | An insider withdraws the pool's valuable asset | The token price collapses and selling receives little value |
| Hidden minting | An authorized account creates more tokens | Supply expands, causing dilution or a large insider sale |
| Honeypot | Contract rules block or penalize selling | Buyers can purchase but cannot exit normally |
A pump-and-dump can happen without a contract flaw. A rug pull often uses privileged control over liquidity or token rules. The categories can overlap.
Liquidity Removal
A liquidity pool might contain ETH and a project token. In a constant-product AMM, the pool tries to preserve:
x * y = k
Here, x and y are the two reserves. A trader's purchase changes the reserves and therefore changes the quoted price. A trader also pays a fee and suffers price impact, which is the price change caused by the trade itself.
If the creator controls the liquidity-provider (LP) tokens, the creator may withdraw the ETH, stablecoins, or other valuable asset. The token can remain in the pool, but the pool is then too shallow to support meaningful trades.
def amount_out(amount_in, reserve_in, reserve_out, fee=0.003):
amount_in_after_fee = amount_in * (1 - fee)
return reserve_out * amount_in_after_fee / (
reserve_in + amount_in_after_fee
)
# Selling tokens into a healthy pool.
print(amount_out(100_000, 1_000_000, 100))
# The same sale after 90% of both reserves are removed.
print(amount_out(100_000, 100_000, 10))Removing the same percentage from both reserves does not remove the price impact caused by the trade, but it reduces the amount of value available to withdraw. In real pools, the attacker may first sell tokens, withdraw liquidity, or perform both actions in a sequence.
Check whether LP tokens are held by a known time lock, burned address, multisignature wallet, or an ordinary externally owned account. A lock reduces one risk but does not guarantee that the project is safe. The lock may expire, cover only part of the liquidity, or allow other privileged actions.
Hidden Minting
A mint function creates new units of a token after deployment. Minting may be legitimate when it follows a documented schedule, but an unrestricted owner-controlled mint is a major risk.
An insider can mint a large balance and sell it into the pool. Even if the sale does not immediately remove all liquidity, the new supply can dilute existing holders and push the price down. A contract may hide this risk behind upgradeable contracts, multiple administrative roles, or a proxy whose implementation can be changed.
Look for:
mint,_mint, or supply-increasing functions- An owner, role, or proxy administrator that can call them
- No maximum supply or schedule enforced by the contract
- Transfers of newly created tokens from a privileged address
A large total supply is not automatically dangerous. The important questions are who can increase it, under what conditions, and whether those conditions can be verified.
Honeypots and Transfer Restrictions
A honeypot allows purchases but prevents ordinary sales. The restriction may be an owner-controlled blacklist, a trading switch, a maximum sell amount, a high sell fee, or a rule that applies only to addresses interacting with the pool.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract RedFlagToken {
address public owner;
mapping(address => bool) public blocked;
mapping(address => uint256) public balanceOf;
constructor() {
owner = msg.sender;
}
function setBlocked(address account, bool value) external {
require(msg.sender == owner, "not owner");
blocked[account] = value;
}
function transfer(address to, uint256 amount) external returns (bool) {
require(!blocked[msg.sender], "blocked");
balanceOf[msg.sender] -= amount;
balanceOf[to] += amount;
return true;
}
}This simplified contract is not a complete token, but it shows the central danger: one address can stop a holder from transferring. A scanner or simulated sale can miss restrictions that activate only after a time, a block number, or a particular trade size. Test the contract's verified source, permissions, buy and sell paths, and current tax settings before treating a token as tradable.
> callout note > A successful purchase proves very little. The critical test is whether an ordinary holder can sell a small amount under the same rules that apply to everyone else.
Common Errors
Do not treat burned LP tokens as proof that the contract is harmless. The creator may still mint tokens, change fees, blacklist holders, or use another pool.
Do not judge safety from market capitalization alone. A small pool can support a high displayed market cap while offering very little exit liquidity.
Do not assume that a failed sale is temporary network congestion. Compare the transaction's revert reason, contract permissions, and successful sells by unrelated wallets.
Exercise
A token has locked liquidity, but its owner can mint unlimited tokens and blacklist holders. Is the liquidity lock sufficient protection?
Show answer
No. It reduces liquidity-removal risk but leaves supply inflation and honeypot risks. The owner can still dilute holders or prevent selected accounts from selling.