$GHST Contract IDE
View, copy, and deploy the real $GHST smart contracts directly to BSC, Polygon, or TRON. One-click launch to the official chain IDE — no setup required.
REAL DEPLOYMENT WARNING: Deploying these contracts creates a real token on a live blockchain. You will need real MATIC, BNB, or TRX for gas fees. The token only has market value after you add liquidity to a DEX. Test on a testnet first if unsure.
GHSTToken.solSolidity 0.8.20 · 148 lines
GHSTToken.sol
1// SPDX-License-Identifier: MIT
2pragma solidity ^0.8.20;
3
4/**
5 * @title GHSTToken — SLS Ghost Faucet Token
6 * @notice ERC-20 / BEP-20 compatible token deployable on Polygon or BSC.
7 *
8 * TOKENOMICS:
9 * Name: SLS Ghost Token | Symbol: GHST | Decimals: 18
10 * Supply: 1,000,000,000 GHST (1 billion)
11 * 50% Faucet Treasury · 20% Liquidity · 15% Community · 10% Team · 5% Marketing
12 */
13
14interface IERC20 {
15 function totalSupply() external view returns (uint256);
16 function balanceOf(address account) external view returns (uint256);
17 function transfer(address to, uint256 amount) external returns (bool);
18 function allowance(address owner, address spender) external view returns (uint256);
19 function approve(address spender, uint256 amount) external returns (bool);
20 function transferFrom(address from, address to, uint256 amount) external returns (bool);
21 event Transfer(address indexed from, address indexed to, uint256 value);
22 event Approval(address indexed owner, address indexed spender, uint256 value);
23}
24
25abstract contract Context {
26 function _msgSender() internal view virtual returns (address) { return msg.sender; }
27}
28
29abstract contract Ownable is Context {
30 address private _owner;
31 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
32 constructor(address initialOwner) {
33 _owner = initialOwner;
34 emit OwnershipTransferred(address(0), initialOwner);
35 }
36 modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; }
37 function owner() public view returns (address) { return _owner; }
38 function transferOwnership(address newOwner) public onlyOwner {
39 require(newOwner != address(0), "Ownable: new owner is the zero address");
40 emit OwnershipTransferred(_owner, newOwner);
41 _owner = newOwner;
42 }
43}
44
45contract GHSTToken is IERC20, Ownable {
46 string public constant name = "SLS Ghost Token";
47 string public constant symbol = "GHST";
48 uint8 public constant decimals = 18;
49 uint256 private constant HARD_CAP = 1_000_000_000 * 10**18;
50
51 uint256 private _totalSupply;
52 mapping(address => uint256) private _balances;
53 mapping(address => mapping(address => uint256)) private _allowances;
54
55 address public faucetTreasury;
56 uint256 public faucetTreasuryBalance;
57 uint256 public maxTransferAmount = HARD_CAP / 100;
58 bool public antiWhaleEnabled = true;
59 bool public paused = false;
60
61 event Mint(address indexed to, uint256 amount);
62 event Burn(address indexed from, uint256 amount);
63 event FaucetPayout(address indexed recipient, uint256 amount);
64 event TreasuryFunded(uint256 amount);
65
66 constructor() Ownable(msg.sender) {
67 _mint(msg.sender, HARD_CAP);
68 faucetTreasury = msg.sender;
69 }
70
71 function totalSupply() public view override returns (uint256) { return _totalSupply; }
72 function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
73
74 function transfer(address to, uint256 amount) public override returns (bool) {
75 _transfer(_msgSender(), to, amount); return true;
76 }
77 function allowance(address owner_, address spender) public view override returns (uint256) {
78 return _allowances[owner_][spender];
79 }
80 function approve(address spender, uint256 amount) public override returns (bool) {
81 _approve(_msgSender(), spender, amount); return true;
82 }
83 function transferFrom(address from, address to, uint256 amount) public override returns (bool) {
84 uint256 currentAllowance = _allowances[from][_msgSender()];
85 require(currentAllowance >= amount, "ERC20: insufficient allowance");
86 unchecked { _allowances[from][_msgSender()] = currentAllowance - amount; }
87 _transfer(from, to, amount); return true;
88 }
89
90 function _transfer(address from, address to, uint256 amount) internal {
91 require(!paused, "GHST: transfers paused");
92 require(from != address(0) && to != address(0), "ERC20: zero address");
93 require(_balances[from] >= amount, "ERC20: insufficient balance");
94 if (antiWhaleEnabled && from != owner() && to != owner())
95 require(amount <= maxTransferAmount, "GHST: exceeds anti-whale limit");
96 unchecked { _balances[from] -= amount; _balances[to] += amount; }
97 emit Transfer(from, to, amount);
98 }
99
100 function _mint(address to, uint256 amount) internal {
101 require(_totalSupply + amount <= HARD_CAP, "GHST: hard cap exceeded");
102 _totalSupply += amount; _balances[to] += amount;
103 emit Transfer(address(0), to, amount); emit Mint(to, amount);
104 }
105
106 function _approve(address owner_, address spender, uint256 amount) internal {
107 require(owner_ != address(0) && spender != address(0), "ERC20: zero address");
108 _allowances[owner_][spender] = amount;
109 emit Approval(owner_, spender, amount);
110 }
111
112 function burn(uint256 amount) external {
113 require(_balances[_msgSender()] >= amount, "ERC20: insufficient balance");
114 unchecked { _balances[_msgSender()] -= amount; _totalSupply -= amount; }
115 emit Transfer(_msgSender(), address(0), amount); emit Burn(_msgSender(), amount);
116 }
117
118 function fundTreasury(uint256 amount) external onlyOwner {
119 require(_balances[_msgSender()] >= amount, "Insufficient balance");
120 unchecked { _balances[_msgSender()] -= amount; faucetTreasuryBalance += amount; }
121 emit Transfer(_msgSender(), address(this), amount); emit TreasuryFunded(amount);
122 }
123
124 function faucetPayout(address recipient, uint256 amount) external onlyOwner {
125 require(faucetTreasuryBalance >= amount, "GHST: treasury insufficient");
126 unchecked { faucetTreasuryBalance -= amount; _balances[recipient] += amount; }
127 emit Transfer(address(this), recipient, amount); emit FaucetPayout(recipient, amount);
128 }
129
130 function batchFaucetPayout(address[] calldata recipients, uint256[] calldata amounts) external onlyOwner {
131 require(recipients.length == amounts.length, "Length mismatch");
132 uint256 total; for (uint256 i = 0; i < amounts.length; i++) { total += amounts[i]; }
133 require(faucetTreasuryBalance >= total, "GHST: treasury insufficient for batch");
134 unchecked { faucetTreasuryBalance -= total; }
135 for (uint256 i = 0; i < recipients.length; i++) {
136 _balances[recipients[i]] += amounts[i];
137 emit Transfer(address(this), recipients[i], amounts[i]);
138 emit FaucetPayout(recipients[i], amounts[i]);
139 }
140 }
141
142 function setAntiWhale(bool enabled, uint256 newMax) external onlyOwner {
143 antiWhaleEnabled = enabled; maxTransferAmount = newMax;
144 }
145 function setPaused(bool _paused) external onlyOwner { paused = _paused; }
146 function hardCap() external pure returns (uint256) { return HARD_CAP; }
147 function treasuryBalance() external view returns (uint256) { return faucetTreasuryBalance; }
148}
STEP AFTER DEPLOY
Add GHST liquidity to make the token tradeable
Deploy Checklist
0/10Token Details
NameSLS Ghost Token
Symbol$GHST
Decimals18
Total Supply1,000,000,000
StandardERC-20
CompilerSolidity 0.8.20