Smart Contract
SHIM Token Smart Contract Analysis
Contract Overview
The SHIM token is an ERC-20 token with additional features like fee mechanisms, trading limits, and liquidity functions. It's designed to work with Uniswap V2 and includes anti-whale measures.
Core Functions
1. Constructor
Initializes the token with name "ShimaNest" and symbol "SHIM"
Sets up router addresses for different chains (BSC mainnet/testnet, ETH mainnet/testnet)
Transfers ownership to
0x4F69F9cEDC6Cf0db1AF4DdCE364DcD9EEB1408dF
Creates Uniswap V2 pair
Sets initial fees (3% liquidity, 2% marketing on both buy/sell)
Configures wallet/transaction limits
Mints 20 billion tokens to owner
Disables trading initially
2. Fee Management Functions
updateBuyFees()
Allows owner to update buy fees
Ensures total fees don't exceed 10%
Emits
UpdateBuyFees
event
updateSellFees()
Similar to
updateBuyFees
but for sell transactionsAlso caps total fees at 10%
updateWalletToWalletTransferFee()
Sets fee for wallet-to-wallet transfers (non-dex transactions)
Maximum fee capped at 5%
3. Wallet Management Functions
changeMarketingWallet()
Allows owner to change marketing wallet address
Prevents setting to zero address
Emits
MarketingWalletChanged
event
excludeFromFees()
Excludes/includes account from fees
Only callable by owner
Emits
ExcludeFromFees
event
4. Trading Functions
enableTrading()
Activates trading (initially disabled)
Also enables swapping functionality
Can only be called once
_transfer()
(Internal)
Main transfer function with all fee logic
Checks trading status and limits
Handles fee collection and redistribution
Implements anti-whale measures
Processes swaps when thresholds are met
5. Liquidity Functions
swapAndLiquify()
Internal function that:
Swaps half of tokens for ETH
Adds liquidity with other half of tokens and received ETH
Sends LP tokens to dead address
Emits
SwapAndLiquify
event
swapAndSendMarketing()
Swaps tokens for ETH
Sends ETH to marketing wallet
Emits
SwapAndSendMarketing
event
6. Limit Management Functions
Max Wallet Limits:
Enable/disable wallet limit
Set max wallet amount (min 1% of supply)
Exclude addresses from limit
Max Transaction Limits:
Similar to wallet limits but for transactions
Minimum 0.1% of supply for both buy/sell limits
7. Utility Functions
claimStuckTokens()
Allows owner to recover accidentally sent tokens
Cannot recover the token itself
setSwapTokensAtAmount()
Sets threshold for auto-swapping accumulated fees
Must be > 0.0001% of total supply
setSwapEnabled()
Toggles whether fee auto-swapping is active
Key Features
Fee Mechanism:
Different fees for buying/selling (default 5% total)
Separate wallet-to-wallet transfer fee
Fees are split between liquidity and marketing
Anti-Whale Protection:
Max wallet limit (default 2%)
Max transaction limits (default 1% buy/sell)
Liquidity Management:
Automatic LP creation from fees
Marketing fees converted to ETH
Security Measures:
Trading initially disabled
Owner can exclude addresses from limits/fees
Prevents setting dangerous limits (<0.1%)
Multi-Chain Support:
Detects chain ID to use correct router addresses
Supports BSC and Ethereum mainnets/testnets
Events
The contract emits several events for important state changes:
Fee updates
Wallet/limit changes
Swap activities
Exclusions from limits/fees
Ownership transfers (from Ownable)
This comprehensive token contract includes robust features for DeFi trading while implementing protections against common issues like whale manipulation and providing flexibility for fee adjustments.
Last updated