This project is a basic ERC20 token contract built using Solidity and OpenZeppelin libraries. It demonstrates how to create a simple token with ownership features and an initial supply. The token is deployed on the Ethereum blockchain and can be interacted with using Truffle.
- ERC20 Token: Implements the ERC20 standard for fungible tokens.
- Ownership: The contract deployer is set as the initial owner.
- Initial Supply: Mints an initial supply of tokens to the owner’s address.
- Decimal Precision: Supports a precision of up to 18 decimal places.
Ensure you have the following installed:
-
Clone the Repository
git clone https://github.com/yourusername/yourrepository.git cd yourrepository
-
Install Dependencies
npm install
-
Compile Contracts
truffle compile
-
Deploy Contracts
Ensure Ganache or another Ethereum development network is running. Then deploy the contracts:
truffle migrate --reset
-
Test Contracts
truffle test
contracts/
: Contains Solidity smart contracts. IncludesMyToken.sol
.migrations/
: Contains migration scripts for deploying contracts. Includes2_deploy_contracts.js
.test/
: JavaScript test files for smart contract testing. IncludesMyToken.test.js
.truffle-config.js
: Configuration file for Truffle.
- ERC20 Implementation:
MyToken.sol
inherits from OpenZeppelin’s ERC20 implementation, providing standard token functionality. - Ownership Management: Includes functions to transfer ownership and check the current owner.
- Minting: Mints tokens to the owner’s address during deployment with a precision of 18 decimal places.
Feel free to fork the repository and submit pull requests. If you encounter any issues, please open an issue on GitHub.
This project is licensed under the MIT License.