ESH

ESHCoin

Coin that can airdrop another ERC20 tokens based on holders amount

  • Publish Date

    Oct 31, 2025

  • Licenses

    MIT, Apache-2.0, Copyright (c) 2024 ultimatedeal.net Osher Haim Glick.

ESH Smart Contract

Overview

ESH is an advanced ERC20-compatible token contract with additional features for distribution, voting, and platform fees. It combines functionality from various OpenZeppelin contracts and custom implementations to provide a robust and flexible token ecosystem.

Key Features

1. Token Distribution

  • Efficient batch distribution of tokens to multiple recipients
  • Support for large-scale distributions through batching and multicall functionality
  • Tracking of distribution progress and completion

2. Governance and Voting

  • Delegation of voting power
  • Historical vote tracking
  • Checkpointing system for accurate vote counting

3. Platform Fees

  • Integration with ThirdWeb's PlatformFee extension

4. Multiple Token Balance Tracking

  • Ability to track balances of multiple tokens for each holder

5. Ownership and Access Control

  • Contract owner functionality
  • Distributor roles for controlled token distribution

6. Metadata Management

  • Contract URI management for storing off-chain metadata

Main Functions

Token Management

  • burn(uint256 amount): Allows users to burn their own tokens
  • burnFrom(address account, uint256 amount): Allows burning tokens from a specific account (with restrictions)

Distribution

  • createDistribution(address paymentToken, uint256 amount): Creates a new distribution event
  • initializeDistribution(bytes32 distributionId): Initializes a distribution
  • distributeBatch(bytes32 distributionId, uint256 batchSize): Executes a batch of the distribution
  • distributeMulticall(bytes32 distributionId, uint256 maxCalls): Executes multiple batches of the distribution

Voting and Delegation

  • delegate(address delegatee): Delegates voting power to another address
  • getVotes(address account): Gets the current voting power of an account
  • getPastVotes(address account, uint256 blockNumber): Gets the voting power of an account at a specific block

Balance Tracking

  • getHolderTokenBalance(address holder, string memory symbol): Gets the balance of a specific token for a holder
  • getAllHolderTokenBalances(address holder): Gets all token balances for a holder

Administrative Functions

  • changeOwner(address _newOwner): Changes the contract owner
  • adjustBATCHSize(uint256 _newBATCHSIZE): Adjusts the maximum batch size for distributions
  • setSellerStoreContract(address _ERCUltraStore): Sets the seller store contract address
  • setRentingStoreContract(address _ERCUltraStore): Sets the renting store contract address

Benefits

  1. Flexibility: Supports various token-related operations, from simple transfers to complex distributions and voting mechanisms.
  2. Scalability: Batch processing and multicall functionality allow for efficient large-scale operations.
  3. Governance Ready: Built-in voting and delegation features make it suitable for DAO-like structures.
  4. Multi-token Support: Ability to track balances of multiple tokens, making it versatile for complex ecosystems.
  5. Security: Incorporates reentrancy guards and access controls to enhance contract security.
  6. Upgradability: Contract metadata can be updated, allowing for some degree of future-proofing.
  7. Transparency: Events are emitted for key actions, providing clear off-chain tracking of contract activities.

Getting Started

To interact with this contract, you'll need to:

  1. Deploy the contract, providing the initial parameters (name, symbol, total supply, and contract owner).
  2. Use a Web3 provider or a blockchain interaction tool to call the contract functions.
  3. For distributions, ensure that the distributor roles are properly set up.
  4. For voting, users will need to delegate their voting power before it can be used.

Always ensure you're interacting with the correct contract address and have the necessary permissions for restricted functions.

INIT_BATCH_SIZE

view

No inputs required