Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jvc-byte/simple-bank-using-solidity
This project includes Solidity smart contracts for a decentralized bank that operates using a custom ERC-20 token, JVCToken, as its official currency.
https://github.com/jvc-byte/simple-bank-using-solidity
banking customization defi erc20-smart-contract smart-contracts solidity solidity-contracts
Last synced: 16 days ago
JSON representation
This project includes Solidity smart contracts for a decentralized bank that operates using a custom ERC-20 token, JVCToken, as its official currency.
- Host: GitHub
- URL: https://github.com/jvc-byte/simple-bank-using-solidity
- Owner: jvc-byte
- License: mit
- Created: 2024-07-25T16:18:21.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-22T19:30:58.000Z (3 months ago)
- Last Synced: 2024-10-12T11:09:36.416Z (about 1 month ago)
- Topics: banking, customization, defi, erc20-smart-contract, smart-contracts, solidity, solidity-contracts
- Language: Solidity
- Homepage: https://sepolia.basescan.org/address/0xCf812b5595a03819Bd23Cb904F0c4237D894221A
- Size: 3.01 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](#introduction)
- [Features](#features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Deploying the Contracts](#deploying-the-contracts)
- [Registering Users](#registering-users)
- [Depositing and Withdrawing Tokens](#depositing-and-withdrawing-tokens)
- [Contract Details](#contract-details)
- [Bank Contract](#bank-contract)
- [JVCToken Contract](#jvctoken-contract)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)## 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
- [Remix IDE](https://remix.ethereum.org/)
- [Metamask](https://metamask.io/)### Installation
1. **Clone the repository:** Check [here](https://medium.com/@jvc-byte/how-to-clone-a-github-repository-in-remix-ide-two-steps-218d820824b1) 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
3. **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](LICENSE) file for details.
## Contact
- **Author**: JVC-Byte
- **Email**: [Send a mail](mailto:[email protected])
- **Twitter**: [jvc_byte](https://x.com/jvc_byte)---