SHIMA
HomePresaleDAppDAOGamiFiedBlog
  • White Paper
  • Introducing
    • Welcome to ShimaNest
    • The SHIM Token
    • Overview of Core Functions
  • Security and Transparency
    • Smart Contract
    • SHIMA Roadmap
    • Smart Contract Security
    • Ownership and Control
    • Trusted Transparency
    • The Team
  • Tokenomics
    • SHIM Tokenomics
    • Token Allocation
    • GSHIM Tokenomics
  • The ShimaNest Ecosystem
    • Gamified Platform
  • Decentralized application
  • SHIMA Launchpad
  • SHIMA Community
  • SHIMA GamiFied
    • Introducing Shima Game
    • GSHIM Role
    • Area 51
    • Scoreboard
  • SHIMA DApp
    • Presale Participation
    • Staking SHIM
  • SHIMA BlockChat
  • ShimaSwap
  • SHIMA DAO
  • Market Analysis
  • SHIMA ID
  • Security and Transparency
    • Terms & Policies
    • Forward-Looking Statements
    • Risk Factors
Powered by GitBook
LogoLogo

Social Networks

  • X.com
  • TG Channel
  • TG Group
  • Youtube Channel
  • SHIMA Blog

SHIMA Features

  • SHIMA Token
  • SHIMA ID
  • SHIMA GamiFied
  • SHIMA Staking
  • SHIMA DAO

Copyright © 2024 SHIMA A Gamified DeFi ecosystem

On this page
  • Contract Overview
  • Core Functions
  • 1. Constructor
  • 2. Fee Management Functions
  • 3. Wallet Management Functions
  • 4. Trading Functions
  • 5. Liquidity Functions
  • 6. Limit Management Functions
  • Max Transaction Limits:
  • 7. Utility Functions
  • Key Features
  • Events
Export as PDF
  1. Security and Transparency

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

constructor () ERC20("ShimaNest", "SHIM")
  • 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()

function updateBuyFees(uint256 _liquidityFeeOnBuy, uint256 _marketingFeeOnBuy)
  • Allows owner to update buy fees

  • Ensures total fees don't exceed 10%

  • Emits UpdateBuyFees event

updateSellFees()

function updateSellFees(uint256 _liquidityFeeOnSell, uint256 _marketingFeeOnSell)
  • Similar to updateBuyFees but for sell transactions

  • Also caps total fees at 10%

updateWalletToWalletTransferFee()

function updateWalletToWalletTransferFee(uint256 _walletToWalletTransferFee)
  • Sets fee for wallet-to-wallet transfers (non-dex transactions)

  • Maximum fee capped at 5%

3. Wallet Management Functions

changeMarketingWallet()

function changeMarketingWallet(address _marketingWallet)
  • Allows owner to change marketing wallet address

  • Prevents setting to zero address

  • Emits MarketingWalletChanged event

excludeFromFees()

function excludeFromFees(address account, bool excluded)
  • Excludes/includes account from fees

  • Only callable by owner

  • Emits ExcludeFromFees event

4. Trading Functions

enableTrading()

function enableTrading()
  • Activates trading (initially disabled)

  • Also enables swapping functionality

  • Can only be called once

_transfer() (Internal)

function _transfer(address from, address to, uint256 amount)
  • 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()

function swapAndLiquify(uint256 tokens)
  • Internal function that:

    1. Swaps half of tokens for ETH

    2. Adds liquidity with other half of tokens and received ETH

    3. Sends LP tokens to dead address

  • Emits SwapAndLiquify event

swapAndSendMarketing()

function swapAndSendMarketing(uint256 tokenAmount)
  • Swaps tokens for ETH

  • Sends ETH to marketing wallet

  • Emits SwapAndSendMarketing event

6. Limit Management Functions

Max Wallet Limits:

function setEnableMaxWalletLimit(bool enable)
function setMaxWalletAmount(uint256 _maxWalletAmount)
function excludeFromMaxWallet(address account, bool exclude)
  • Enable/disable wallet limit

  • Set max wallet amount (min 1% of supply)

  • Exclude addresses from limit

Max Transaction Limits:

function setEnableMaxTransactionLimit(bool enable)
function setMaxTransactionAmounts(uint256 _maxTransactionAmountBuy, uint256 _maxTransactionAmountSell)
function excludeFromMaxTransactionLimit(address account, bool exclude)
  • Similar to wallet limits but for transactions

  • Minimum 0.1% of supply for both buy/sell limits

7. Utility Functions

claimStuckTokens()

function claimStuckTokens(address token)
  • Allows owner to recover accidentally sent tokens

  • Cannot recover the token itself

setSwapTokensAtAmount()

function setSwapTokensAtAmount(uint256 newAmount)
  • Sets threshold for auto-swapping accumulated fees

  • Must be > 0.0001% of total supply

setSwapEnabled()

function setSwapEnabled(bool _enabled)
  • Toggles whether fee auto-swapping is active

Key Features

  1. Fee Mechanism:

    • Different fees for buying/selling (default 5% total)

    • Separate wallet-to-wallet transfer fee

    • Fees are split between liquidity and marketing

  2. Anti-Whale Protection:

    • Max wallet limit (default 2%)

    • Max transaction limits (default 1% buy/sell)

  3. Liquidity Management:

    • Automatic LP creation from fees

    • Marketing fees converted to ETH

  4. Security Measures:

    • Trading initially disabled

    • Owner can exclude addresses from limits/fees

    • Prevents setting dangerous limits (<0.1%)

  5. 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.

PreviousOverview of Core FunctionsNextSHIMA Roadmap

Last updated 27 days ago

Page cover image