Skip to content

This repository contains the project CREATE AND MINT TOKENS , which I developed as part of my coursework at Metacrafters

Notifications You must be signed in to change notification settings

Paraass/CreateMint_Token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

Create and Mint Tokens

Overview

This Solidity smart contract implements a custom ERC20 token named "Paras" with the symbol "PRS". The token has several features, including minting new tokens, burning existing tokens, and transferring tokens between addresses. The contract utilizes the OpenZeppelin ERC20 implementation to ensure compliance with the ERC20 standard and to provide secure, well-tested functionalities.

Features

  • Minting Tokens: The contract owner can mint new tokens and assign them to any address.
  • Burning Tokens: Any token holder can burn (destroy) their tokens, reducing the total supply.
  • Transferring Tokens: Tokens can be transferred between addresses, with a check to prevent transfers to the zero address.
  • Initial Supply: The contract owner receives an initial supply of 5,000 tokens upon deployment.

Contract Details

Imports

  • ERC20: Standard ERC20 token functionality from OpenZeppelin.

State Variables

  • contractOwner: The address of the contract owner who has special privileges such as minting new tokens.

Constructor

  • Name: "Paras"
  • Symbol: "PRS"
  • Initial Supply: 5,000 tokens (adjusted for decimals) minted to the deployer's address.
  • Ownership: The deployer of the contract is set as the owner.

Functions

  • mint(address recipient, uint256 amount): Allows the contract owner to mint new tokens to a specified address. Ensures that only the owner can call this function.
  • burn(uint256 amount): Allows any token holder to burn a specified amount of their tokens, reducing the total supply.
  • transfer(address recipient, uint256 amount): Overrides the standard ERC20 transfer function to include an additional check. Ensures that tokens cannot be transferred to the zero address.
  • Author

    Paras Aggarwal
    [email protected]

About

This repository contains the project CREATE AND MINT TOKENS , which I developed as part of my coursework at Metacrafters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published