Emach Token

Documentation for Emach Token Contract

Overview

The Emach token is an ERC-20 compliant cryptocurrency deployed on the Polygon (formerly Matic) network. This documentation provides an in-depth understanding of the Emach token contract and its functionalities. The contract code has several sections that govern various aspects of the token’s behavior, including token distribution, ownership, buying/selling, worker incentives, and more.

Token sales website: https://emach.vercel.app/

Contract address: 0x9c628e94f733e67b206ab9413256dad5a632245c

Contract Structure

The contract is structured into multiple sections, each serving a distinct purpose:

  • ERC-20 Interface Implementation (IERC20):

    • Defines standard functions required by an ERC-20 token.

    • Specifies functions for total supply, decimals, symbol, name, balance retrieval, token transfer, allowance management, and more.

  • Context Contract:

    • Provides contextual information for the token contract.

    • Internal functions to retrieve the sender’s address and message data.

  • SafeMath Library:

    • Library to handle safe arithmetic operations to prevent overflows/underflows.

    • Includes functions for addition, subtraction, multiplication, division, and modulo operations.

  • Ownable Contract:

    • Manages ownership functionality.

    • Contains functions to set/relinquish ownership and restrict certain functionalities to the contract owner.

  • Address Library:

    • Provides utility functions to handle Ethereum addresses.

    • Includes checks for contract existence, value transfers, and low-level function calls.

  • Emach Token Contract:

    • Implements the ERC-20 functions and inherits from Context, IERC20, and Ownable.

    • Defines token properties such as name, symbol, decimals, total supply, and token balances.

    • Manages ownership and ownership transfer.

    • Includes logic for token distribution to partners and workers.

    • Allows claiming tokens for partners and workers after a lock period.

    • Facilitates the purchase of tokens with Ether at a specified rate.

    • Handles token burning, allowance management, and utility functions.

Key Functionality

  • Token Distribution:

    • The contract allows distributing tokens to partners and workers according to predefined percentages.

  • Lock Period:

    • Tokens allocated to workers and partners have a lock period that prevents immediate claiming.

  • Token Purchase:

    • Users can buy tokens by sending Ether to the contract at a specified rate.

  • Ownership and Permissions:

    • The contract includes ownership functionality that restricts certain operations to the contract owner.

  • Worker and Partner Management:

    • Functions to update worker addresses and corresponding token amounts.

  • Marketing Wallet:

    • Allows setting a specific address as the marketing wallet for managing marketing-related tokens.

  • Withdraw Functionality:

    • Contract owner can withdraw Ether held by the contract.

Contract Management User Guide

1. constructor Function

  • Inputs:
    • _partners: Array of partner addresses.
    • _partnerAmounts: Array of corresponding token amounts for partners.
  • Expected Behavior:
    • Initializes the token contract with predefined percentages for token distribution to partners and sets a lock period.
    • Distributes tokens to partners according to the provided addresses and amounts.

2. distributeToPartners Function

  • Inputs:
    • partners: Array of partner addresses.
    • partnerAmounts: Array of corresponding token amounts for partners.
  • Expected Behavior:
    • Distributes tokens to partners based on the provided addresses and amounts.
    • Checks that the total token amount distributed to partners does not exceed the predefined percentage.

3. claimToken Function

  • Inputs: None
  • Expected Behavior:
    • Allows workers to claim tokens after a lock period.
    • Checks if the caller is a recognized worker and has not previously claimed tokens.
    • Transfers tokens to the worker’s address.
    • Checks that the total token amount claimed by workers does not exceed the predefined percentage.

4. setWorkerAndAmounts Function

  • Inputs:
    • newWorkers: Array of updated worker addresses.
    • newAmounts: Array of updated corresponding token amounts for workers.
  • Expected Behavior:
    • Updates the worker addresses and their corresponding token amounts.

5. setlockperoid Function

  • Inputs:
    • _newperoid: New lock period duration.
  • Expected Behavior:
    • Allows the contract owner to update the lock period duration.

6. claimTokenforMarketing Function

  • Inputs: None
  • Expected Behavior:
    • Allows the marketing wallet address to claim tokens after a lock period.
    • Transfers tokens to the marketing wallet.
    • Checks that the total token amount claimed for marketing purposes does not exceed the predefined percentage.

7. buyToken Function

  • Inputs:
    • _amount: Amount of tokens to be bought.
    • Conditions:
      • Checks if the amount requested for purchase is within the sale limit.
      • Checks if the total sold tokens plus the requested amount do not exceed the sale limit.
      • Checks if the caller sent enough Ether to cover the total price.
  • Expected Behavior:
    • Allows users to buy tokens by sending Ether to the contract at a specified rate.
    • Transfers the purchased tokens to the buyer’s address.
    • Emits an event to log the purchase.

8. updatePrice Function

  • Inputs:
    • _newPrice: New token purchase rate.
  • Expected Behavior:
    • Allows the contract owner to update the token purchase rate.

9. setmarketingwallet Function

  • Inputs:
    • _newAddrees: New marketing wallet address.
  • Expected Behavior:
    • Allows the contract owner to set a new address as the marketing wallet.

10. withdraw Function

  • Inputs: None
  • Expected Behavior:
    • Allows the contract owner to withdraw Ether held by the contract.
    • Transfers the Ether to the contract owner’s address.

11. receive Function

  • Inputs: None
  • Expected Behavior:
    • Receives Ether sent to the contract.
    • Does not contain any specific logic.

Next Steps

  • Deploy on mainnet aqui en entrar a polygonscan.com y en mumbai tested se pone el smartcontracto token y listo. Checar tema del logo en el coin. 

  • Register on exchange and add liquidity

  • NFT contract requirements

    • Total Supply (total number of nfts)
    • Cost of mint (Number of tokens per nft mint, in selected currency)
    • Mint currency, (Emach token, Matic or both)
    • Whitelist (yes or no)
    • Metadata 
      • Layers (Transparent pngs)
      • Rarity of layers
      • Any specific instructions/requirements

 

LAST UPDATE FEBRUARY 1 2024