Code Monkey home page Code Monkey logo

metaevm's Introduction

MyToken Solidity Smart Contract

Table of Contents:

  1. Introduction
  2. Contract Overview
  3. Public Variables
  4. Mapping Variable
  5. Mint Function
  6. Burn Function

Introduction

This repository contains a Solidity smart contract named "MyToken" that implements a basic ERC20-like token functionality. The contract includes features such as minting and burning tokens, as well as maintaining token balances for addresses.

Contract Overview

The "MyToken" contract is a simple example of a token contract in Solidity. It provides basic functionalities to mint and burn tokens, along with tracking balances for different addresses. The contract is based on the ERC20 token standard but is a minimal implementation for educational purposes.

Public Variables

  • tokenName: A public string variable that represents the name of the token (e.g., "META").
  • tokenAbbrv: A public string variable that represents the abbreviation of the token (e.g., "MTA").
  • totalSupply: A public uint variable that tracks the total supply of tokens in circulation.

Mapping Variable

  • balances: A mapping that associates Ethereum addresses with their respective token balances. This mapping is used to keep track of how many tokens each address holds.

Mint Function

The mint function allows the contract owner to mint new tokens and allocate them to a specified address. The function increases the total supply of tokens and updates the balance of the target address accordingly.

Burn Function

The burn function enables token holders to burn (destroy) a certain amount of their tokens. This function decreases both the total supply of tokens and the balance of the burning address.

metaevm's People

Contributors

haranms22 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.