Skip to content

RodgersChayuga/erc20-token-smart-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERC20 TOKEN STANDARD SMART CONTRACT

This smart contract defines a basic ERC20 token named "Cryptos" with the symbol "CRPT". Here's a breakdown of what the contract does:

1. SETTING UP THE TOKEN:

Defines the total supply of tokens (1,000,000 in this case).
Tracks the founder's address and assigns the entire supply to the founder initially.
Stores the token information like name, symbol, and decimals (currently set to 0, whole tokens).

2. TRACKING BALANCES:

Uses a mapping to keep track of each address's token balance.

3. TRANSFERING TOKENS:

Allows users to transfer tokens to another address if they have sufficient balance.
Updates the balances of the sender and receiver accordingly.
Emits a "Transfer" event to record the transaction on the blockchain.

4. APPROVALS AND ALLOWANCES:

Enables users to approve another address (spender) to transfer tokens on their behalf (a form of delegation).
Tracks the allowed amount for each spender in a separate mapping.
The "approve" function lets the owner define the spending limit for a spender.
The "transferFrom" function allows the spender to transfer tokens up to the approved limit from the owner's balance.

5. SECURITY:

The contract includes checks to ensure sufficient balance before transfers and prevent unauthorized spending.
Overall, this smart contract creates a basic ERC20 token that allows users to transfer and manage their holdings while enabling controlled spending through approvals.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published