Skip to content

This project includes Solidity smart contracts for a decentralized bank that operates using a custom ERC-20 token, JVCToken, as its official currency.

License

Notifications You must be signed in to change notification settings

jvc-byte/Simple-Bank-Using-solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JVCToken Bank

Overview

This project includes Solidity smart contracts for a decentralized bank that operates using a custom ERC-20 token, JVCToken, as its official currency. The bank contract allows user registration, token minting, burning, ownership transfer, deposits, and withdrawals. The JVCToken contract manages token minting, transferring, and burning, and provides token-related information.

Table of Contents

Introduction

The JVCToken Bank is a decentralized application (dApp) where users can manage their funds using the custom ERC-20 token JVCToken. The bank supports user registration, token management (minting, burning, ownership transfer), and secure token-based transactions.

Features

  • Custom ERC-20 Token: JVCToken, a fully compliant ERC-20 token, used as the official currency.
  • User Management: Register users and manage their token balances.
  • Token Minting: Mint new tokens to the bank or other users.
  • Secure Transactions: Safeguard deposits and withdrawals with built-in checks and balances.

Getting Started

Prerequisites

Installation

  1. Clone the repository: Check here for how to clone repository on Remix IDE.

Usage

Deploying the Contracts

  1. Deploy the contracts: Deploy the contract on remix IDE on sepolia testnet using injected provider - Metamask

  2. Interact with the contracts: You can interact with the contracts right there on remix IDE.

Registering Users

  • Users can register by calling the registerUser function in the Bank contract. The function automatically checks the user's token balance and records it.

Depositing and Withdrawing Tokens

  • Users can deposit tokens from their account to the bank using the deposit function.
  • Users can withdraw tokens from the bank to their account using the withdraw function.

Contract Details

Bank Contract

  • Functions:
    • registerUser: Registers a new user and records their token balance.
    • deposit: Deposits tokens into the user's bank account.
    • withdraw: Withdraws tokens from the user's bank account.
    • getUserByAddress: Returns the user's information based on their address.
    • mintToken: Mints new tokens to the bank's address.
    • burnToken: Burns tokens from the bank's address.
    • changeOwnership: Changes the ownership of the bank.
    • getContractBalance: Returns the token balance of the bank contract.
    • getBalanceOf: Returns the token balance of a specified user.
    • isContractAddr: Checks if a given address is a contract address.

JVCToken Contract

  • Functions:
    • mint: Mints new tokens to the specified address.
    • burn: Burns tokens from a specified address.
    • transfer: Transfers tokens between addresses.
    • checkBalanceOf: Returns the token balance of a specified address.
    • tokenInfo: Returns the total supply, name, decimals, and symbol of the token.
    • _update: Handles the internal logic for minting, burning, and transferring tokens.

Contributing

Any form of contributions are welcome!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact


About

This project includes Solidity smart contracts for a decentralized bank that operates using a custom ERC-20 token, JVCToken, as its official currency.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published