This repository contains the smart contract code for Dan Token (DTK), an ERC20 token implemented in Solidity. This contract includes standard ERC20 functionalities such as transferring tokens, approving allowances, minting new tokens, and burning tokens.
Dan Token (DTK) is an ERC20-compliant token with the following attributes:
- Name: Dan Token
- Symbol: DTK
- Decimals: 18
The contract allows for the basic operations of an ERC20 token including transfers, approvals, and allowances, as well as minting and burning of tokens.
- Name: Dan Token
- Symbol: DTK
- Decimals: 18
totalSupply
: The total supply of the token.balanceOf
: Mapping of addresses to their respective balances.allowance
: Mapping of addresses to their approved allowances for other addresses.
To work with this smart contract, you need the following installed on your system:
- Node.js (v14 or later)
- npm (v6 or later)
- Remix https://remix.ethereum.org/
- Clone the repository to Remix.
-
Compile the smart contract
-
Deploy the smart contract to a local blockchain V
Transfers amount
tokens from the caller's account to recipient
.
function transfer(address recipient, uint amount) external returns (bool)
Approves spender
to transfer up to amount
tokens from the caller's account.
function approve(address spender, uint amount) external returns (bool)
Transfers amount
tokens from sender
to recipient
using the allowance mechanism. amount
is deducted from the caller's allowance.
function transferFrom(address sender, address recipient, uint amount) external returns (bool)
Mints amount
new tokens to the caller's account, increasing the total supply.
function mint(uint amount) external
Burns amount
tokens from the caller's account, decreasing the total supply.
function burn(uint amount) external
Emitted when value
tokens are moved from one account (from
) to another (to
).
event Transfer(address indexed from, address indexed to, uint value)
Emitted when the allowance of a spender
for an owner
is set by a call to approve
. value
is the new allowance.
event Approval(address indexed owner, address indexed spender, uint value)
This project is licensed under the MIT License. See the LICENSE file for details.