Code Monkey home page Code Monkey logo

mytoken-'s Introduction

Create a Token using Solidity

The project involves the creation of a smart contract for a custom cryptocurrency in Remix IDE. The contract is designed to manage the token's properties and operations. It includes public variables to store essential details such as the Token Name, Token Abbreviation, and Total Supply of the cryptocurrency. The contract further employs a mapping structure to associate addresses with their corresponding token balances.

Here, Token Name is 'PANDA' and Token Abbreviation. The initial total supply would be 0. A mapping function is intialized named 'balances' (addresses=>uint) which will tell the current balance of the corresponding address.

Functionality

Key functionalities are implemented through two main functions:

Mint Function: This function allows the creation of new tokens. It takes two parameters: an address and a value. The value specified is added to the total supply of the cryptocurrency, consequently increasing the balance of the provided address by the same amount.

Burn Function: The burn function serves the purpose of token destruction. Similar to the mint function, it requires an address and a value. The value indicated is subtracted from the total supply, reflecting a reduction in the overall token count. Additionally, the balance of the provided address is decreased by the specified value.

Special feature

A conditional statement is implemented in burn function to make sure the balance of the address is greater than or equal to the amount that is supposed to be burnt.

if(balances[_address] >= _value){ ... ... ... }

Deployment

To deploy this smart contract follow the steps given below:

Step 1 : Open REMIX IDE Step 2 : Create a new file Step 3 : Type or paste the code in the file Step 4 : Click on compile Step 5 : Deploy it

To execute the key functions, copy the addresses provided by REMIX IDE in the deployment section and paste it in the deployed contracts UI.

License

This contract is licensed under the MIT License. See the LICENSE file for details.

Credits

This project is created by Rajat Verma.

Disclaimer

This contract is provided for educational purposes only. Use it in a controlled environment and do not use it in a production environment without proper security audits and testing.

mytoken-'s People

Contributors

thewreckingpanda 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.