This contract implements a basic token system with minting and burning capabilities.
- The contract has public variables that store the details about the coin: token name, token abbreviation, and total supply.
- The contract uses a mapping to track the token balances of addresses (
address => uint
). - The contract has a
mint
function that increases the total supply by a given value and increases the balance of a specified address. - The contract has a
burn
function that decreases the total supply by a given value and decreases the balance of a specified address. - The
burn
function includes conditionals to ensure that the balance of the sender is greater than or equal to the amount being burned.
- Deploy the
MyToken
contract on the Ethereum blockchain. - Access the public variables to get information about the token:
tokenName
: The name of the token (e.g., "META").tokenAbbrv
: The abbreviation of the token (e.g., "MAT").totalSupply
: The total supply of the token.
- Use the
mint
function to create new tokens:- Parameters:
_address
(address) - The address to receive the minted tokens._value
(uint) - The amount of tokens to mint. - Example:
MyToken myToken = MyToken(address); myToken.mint(receiverAddress, amount);
- Parameters:
- Use the
burn
function to destroy tokens:- Parameters:
_address
(address) - The address from which the tokens will be burned._value
(uint) - The amount of tokens to burn. - Example:
MyToken myToken = MyToken(address); myToken.burn(senderAddress, amount);
- Parameters:
Contributions to this project are welcome. If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and test thoroughly.
- Commit your changes and push the branch to your forked repository.
- Submit a pull request, providing a clear description of your changes.
This project is licensed under the MIT License.