The MyToken smart contract is an ERC-20 compatible token contract that allows users to mint, burn, transfer, and track the balance of tokens.
Mint new tokens to a provided address. Burn tokens, reducing the total supply. Transfer tokens from one address to another. Keep track of token balances for each address. Emit events for token transfers, burning, and minting.
These instructions will guide you on how to deploy and interact with the MyToken smart contract.
Node.js and npm installed on your machine.
Clone this repository:
git clone <repository-url>
Install the project dependencies:
cd myToken
npm install
Edit the hardhat.config.js file and configure the desired network under the networks section.
Deploy the contract to the chosen network using Hardhat:
npx hardhat run scripts/deploy.js --network <network-name>
The contract address will be logged to the console upon successful deployment.
To interact with the deployed MyToken contract, you can use tools like Remix or write custom scripts using the Ethereum JavaScript libraries.
Minting Tokens The contract owner can mint new tokens to a provided address using the mint function.
Burning Tokens Any user can burn their own tokens using the burn function. This reduces the total supply.
Transferring Tokens Users can transfer their tokens to another address using the transfer function.
To run the test suite for the MyToken contract, execute the following command:
npx hardhat test
The test suite includes various scenarios to ensure the proper functioning of the contract.
This project is licensed under the MIT License.
This contract is based on the ERC-20 token standard. The contract was developed using the Hardhat framework.
Akanksha Teja