KWAG (Kwagarelly Token) is an ERC-20-like fungible token implemented in Solidity. The contract allows users to transfer tokens, approve allowances, and perform delegated transfers using transferFrom
.
- Token Details:
- Name: Kwagarelly Token
- Symbol: KWAG
- Decimals: 18
- Total Supply: 1,000,000 KWAG
- Functionalities:
- Token balance retrieval (
balanceOf
) - Token transfers (
transfer
) - Allowance approvals (
approve
) - Delegated transfers (
transferFrom
)
- Token balance retrieval (
- Custom Errors:
InsufficientBalance
: Raised when a user tries to transfer or approve more tokens than they own.InsufficientAllowance
: Raised when a spender attempts to transfer tokens beyond the approved amount.
- Events:
Transfer
: Emitted on successful transfers.Approval
: Emitted on successful approvals.
Ensure you have Hardhat installed and configured.
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js --network <network>
The contract is fully tested using Hardhat and Chai. The test cases cover:
- Deployment validation (owner, total supply, token metadata)
- Balance checks
- Transfers and failed transfers
- Approvals and allowances
- TransferFrom operations and failure cases
To run tests:
npx hardhat test
This project is licensed under the UNLICENSED SPDX identifier.