DegenToken (DGN) is a decentralized ERC-20 token deployed on Avalanche blockchain. The token allows for easy transfer and burning of tokens and implements a time-based lock mechanism for redeeming tokens.
- Token Name: DegenToken
- Symbol: DGN
- Decimals: 18
The token can be minted by the contract owner using the mintDegen
function. Minting creates new tokens and adds them to the balance of the specified account.
function mintDegen(address account, uint256 amount) public onlyOwner
Tokens can be transferred from one address to another using the transferDegen
function. The function checks for valid recipient addresses, ensures the sender has sufficient balance, and performs the transfer.
function transferDegen(address account, uint256 amount) external
The token implements a time-based lock for redeeming tokens. After a specific duration (REDEEM_LOCK_DURATION
), users can redeem their tokens using the redeemDegen
function, provided they have sufficient unlocked tokens in their balance.
function redeemDegen(uint256 amount) public
Token holders can burn their tokens, removing them from the total supply, using the burnDegen
function. The function checks for valid token amounts and sufficient balance before burning tokens.
function burnDegen(uint256 amount) external
To retrieve the balance of DGN tokens for a specific account, you can use the balanceDegen
function.
function balanceDegen(address account) external view returns (uint256)
This smart contract is released under the MIT License. Please refer to the SPDX-License-Identifier comment at the beginning of the contract for more details.
The @openzeppelin/contracts
library is used for this smart contract. Make sure to include the correct version in your project to avoid any compatibility issues.