This repository contains the smart contract implementation for the CoinDeck Token (DECK), a custom ERC20 token with burnable, permit, and voting functionalities. The project leverages OpenZeppelin's libraries and is designed for deployment on Ethereum-compatible blockchains.
The CoinDeck Token (DECK) is a utility token with the following features:
- Burnable: Token holders can burn their tokens to reduce the circulating supply.
- Permit (EIP-2612): Allows off-chain approvals for token transfers using signatures, reducing gas costs.
- Voting: Integrates token-based governance, enabling token holders to participate in on-chain decision-making.
The token has a total supply of 100 billion tokens, with 7 decimal places for improved precision.
- Minting: The total supply is minted to a specified admin address during deployment.
- Decimals: The token uses 7 decimal places instead of the default 18.
- Voting Integration: Implements ERC20Votes to enable governance functionalities.
-
Constructor
- Mints the total supply to the provided admin address.
- Ensures the admin address is not the zero address.
-
Decimals
- Overrides the default
decimals()function to set the token precision to 7 decimal places.
- Overrides the default
-
ERC20Votes Hooks
_afterTokenTransfer: Updates vote tracking post-transfer._mint: Handles minting with voting logic._burn: Handles burning with voting logic.
Ensure you have the following tools installed:
- Node.js (v14 or higher)
- Hardhat: Ethereum development environment
- NPM or Yarn: Package manager
-
Clone the repository:
git clone <repository_url>
-
Navigate to the project directory:
cd coindeck-token -
Install dependencies:
npm install
Follow these steps to deploy the CoinDeck Token contract to your preferred Ethereum-compatible network:
-
Configure your deployment details in the
hardhat.config.jsfile.- Add your network configurations (e.g., Infura/Alchemy API URL and private key).
-
Run the deployment script:
npx hardhat run scripts/deploy.js --network <network_name>
-
Provide the admin address as a parameter in the deployment script.
Once deployed, the contract can be interacted with using tools like Hardhat scripts, Ethers.js, or a blockchain explorer. Some common interactions include:
-
Token Transfers
- Transfer tokens between addresses.
-
Burn Tokens
- Reduce the total circulating supply by burning tokens.
-
Permit
- Approve token transfers off-chain using signatures.
-
Voting
- Participate in governance proposals using voting power derived from token holdings.
.
├── contracts
│ └── CoinDeck.sol # Smart contract implementation
├── scripts
│ └── deploy.js # Deployment script
├── hardhat.config.js # Hardhat configuration file
├── package.json # Project dependencies
├── README.md # Project documentation
This project is licensed under the MIT License. See the LICENSE file for details.