Token

0xe5ef93da12492f87ad0bf387e5f1c06aa9fb4162

Verification
Verified
v0.8.24+commit.e11b9ed9
Type
Contract
3,604 bytes
ABI entries
35
11 read · 8 write
License
none

Contract information

Address
0xe5ef93da12492f87ad0bf387e5f1c06aa9fb4162
Chain
Robinhood Chain (4663)
Compiler
v0.8.24+commit.e11b9ed9
Optimization
Enabled
Creation tx
0xb186fab1e3…48b7f47855

Token

Name
Token
Symbol
TOKEN
Decimals
18
Holders
1

Read contract (11)

MIN_ANTI_WHALE_RATIO()uint256
allowance(address, address)uint256
balanceOf(address)uint256
cap()uint256
decimals()uint8
isExemptFromAntiWhale(address)bool
maxWalletHolding()uint256
name()string
owner()address
symbol()string
totalSupply()uint256

Events (5)

ApprovalExemptFromAntiWhaleUpdatedMaxWalletHoldingUpdatedOwnershipTransferredTransfer

ABI

[
  {
    "inputs": [
      {
        "internalType": "string",
        "name": "name",
        "type": "string"
      },
      {
        "internalType": "string",
        "name": "symbol",
        "type": "string"
      },
      {
        "internalType": "uint256",
        "name": "totalSupply",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "uint8",
        "name": "decimals_",
        "type": "uint8"
      },
      {
        "internalType": "uint256",
        "name": "_cap",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "_maxWalletHolding",
        "type": "uint256"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "increasedSupply",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "cap",
        "type": "uint256"
      }
    ],
    "name": "ERC20ExceededCap",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "allowance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientAllowance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientBalance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "approver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidApprover",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "cap",
        "type": "uint256"
      }
    ],
    "name": "ERC20InvalidCap",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "receiver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidReceiver",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSender",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSpender",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      }
    ],
    "name": "OwnableInvalidOwner",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "OwnableUnauthorizedAccount",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "exempt",
        "type": "bool"
      }
    ],
    "name": "ExemptFromAntiWhaleUpdated",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "maxHolding",
        "type": "uint256"
      }
    ],
    "name": "MaxWalletHoldingUpdated",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "previousOwner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "OwnershipTransferred",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Transfer",
    "type": "event"
  },
  {
    "inputs": [],
    "name": "MIN_ANTI_WHALE_RATIO",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "allowance",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "approve",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "balanceOf",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "cap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "decimals",
    "outputs": [
      {
        "internalType": "uint8",
        "name": "",
        "type": "uint8"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "isExemptFromAntiWhale",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxWalletHolding",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "mint",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "name",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "owner",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "renounceOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "exempt",
        "type": "bool"
      }
    ],
    "name": "setExemptFromAntiWhale",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_maxHolding",
        "type": "uint256"
      }
    ],
    "name": "setMaxWalletHolding",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "symbol",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "totalSupply",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transferFrom",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "transferOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
* @title Token
* @notice ERC20 token with customizable features
* @dev Generated by Tokenry.tools
*/
contract Token is ERC20, ERC20Capped,
Ownable {
/// @notice Custom decimals (immutable, set at deployment)
uint8 private immutable _decimals;

/// @notice Mapping for addresses exempt from anti-whale restrictions
mapping(address => bool) public isExemptFromAntiWhale;

/// @notice Events
event ExemptFromAntiWhaleUpdated(address indexed account, bool exempt);
event MaxWalletHoldingUpdated(uint256 maxHolding);


/// @notice Anti-whale configuration
uint256 public maxWalletHolding;


/**
* @param name Token name
* @param symbol Token symbol
* @param totalSupply Initial total supply
* @param owner Token owner address
* @param decimals_ Number of decimals (0-18)
* @param _cap Maximum supply cap
* @param _maxWalletHolding Maximum tokens per wallet (0 to disable, must be >= 0.5% of supply if > 0)
*/
constructor(
string memory name,
string memory symbol,
uint256 totalSupply,
address owner,
uint8 decimals_
,
uint256 _cap
,
uint256 _maxWalletHolding
) ERC20(name, symbol) ERC20Capped(_cap) Ownable(owner) {
require(decimals_ <= 18, "Token: decimals must be <= 18" ); _decimals=decimals_; _mint(owner, totalSupply);  if (_maxWalletHolding > 0) { uint256 minLimit = (totalSupply * MIN_ANTI_WHALE_RATIO) / 100000; require(_maxWalletHolding >= minLimit, "Token: max holding too low (min 0.5% of supply)"); } maxWalletHolding=_maxWalletHolding; isExemptFromAntiWhale[owner]=true; isExemptFromAntiWhale[address(this)]=true;   }  /** * @notice Set exempt addresses from anti-whale restrictions (owner
        only) */ function setExemptFromAntiWhale(address account, bool exempt) external onlyOwner {
        isExemptFromAntiWhale[account]=exempt; emit ExemptFromAntiWhaleUpdated(account, exempt); }  /** * @notice
        Returns the number of decimals used for token amounts * @return The number of decimals (0-18) */ function
        decimals() public view virtual override returns (uint8) { return _decimals; }  /** *
        @notice Mint new tokens (owner only) */ function mint(address to, uint256 amount) external onlyOwner {  require(totalSupply() + amount <=cap(), "Token: exceeds cap" );  _mint(to, amount);
        }   
uint256 public constant MIN_ANTI_WHALE_RATIO=500;
function setMaxWalletHolding(uint256 _maxHolding) external onlyOwner { if (_maxHolding> 0) {
                    uint256 minLimit = (totalSupply() * MIN_ANTI_WHALE_RATIO) / 100000;
                    require(_maxHolding >= minLimit, "Token: max holding too low (min 0.5% of supply)");
                    }
                    maxWalletHolding = _maxHolding;
                    emit MaxWalletHoldingUpdated(_maxHolding);
                    }


                    /**
                    * @notice Override transfer to apply features
                    * @dev Applies anti-whale restrictions and fee calculations before executing transfer
                    */
                    function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Capped) {
                    require(value > 0, "Token: transfer amount must be greater than zero");

                    if (maxWalletHolding > 0 && to != address(0) && !isExemptFromAntiWhale[to]) {
                    require(balanceOf(to) + value <= maxWalletHolding, "Token: exceeds max wallet holding" ); } 
                        
                        super._update(from, to, value);
                        }

 }
Chain explorer2846msChain node74ms