Skip to content

Paraass/Token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

MYTOKEN SMART CONTRACT

Introduction

'MyToken' Smart Contract is the implementation of a custom-made token on the Ethereum blockchain. It contains functionalities for minting and burning tokens. It also maintains the total supply and keeps track of balances for each address.

Features

  1. Public Token Information: The contract stores and provides public access to the token's name, abbreviation, and total supply.
  2. Mapping of Addresses to Balances: A mapping is used to associate each address with its respective balance of tokens.
  3. Mint Function: Allows new tokens to be created and assigned to a specified address.
  4. Burn Function: Allows tokens to be destroyed from a specified address, provided the address has enough tokens.

Public Variables

  1. TokenName: The name of the token.
  2. TokenAbbrv: The abbreviation (symbol) of the token.
  3. TotalSupply: The total supply of tokens currently in circulation.

Mapping

BalanceOf: Maps each address to its balance of tokens.

Functions

mint(address _address, uint _value)

Mints new tokens to the specified address and increases the total supply.

burn(address _address, uint _value)

Burns tokens from the specified address and decreases the total supply, ensuring the address has enough tokens.

Parameters:

  • _address: The address from which the tokens will be burned.
  • _value: The amount of tokens to burn.

Condition:

The function checks if the address has a balance greater than or equal to the amount to be burned. If the address has sufficient balance, the tokens are burned and the total supply is reduced. If the balance is insufficient, the burn operation is not executed.

Usage

Deploying the Contract

  1. Open the Remix IDE or any other Solidity-compatible IDE.
  2. Copy and paste the contract code into a new Solidity file.
  3. Compile the contract using the Solidity compiler version 0.8.18.
  4. Deploy the contract to an Ethereum network (e.g., Ethereum mainnet, testnet, or local blockchain).

Authors

Paras Aggarwal
Parasaggarwal7172gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published