DBank

所属分类:以太坊
开发工具:Others
文件大小:0KB
下载次数:0
上传日期:2023-08-28 15:12:05
上 传 者sh-1993
说明:  去中心化银行(DBank)智能合约,
(Decentralized Bank (DBank) Smart Contract,)

文件列表:
dfx.json (595, 2023-08-29)
dist/ (0, 2023-08-29)
dist/dbank_assets/ (0, 2023-08-29)
dist/dbank_assets/dbank_logo.png (35902, 2023-08-29)
dist/dbank_assets/favicon.ico (15406, 2023-08-29)
dist/dbank_assets/index.html (873, 2023-08-29)
dist/dbank_assets/index.js (644102, 2023-08-29)
dist/dbank_assets/index.js.map (681726, 2023-08-29)
dist/dbank_assets/logo.png (25397, 2023-08-29)
dist/dbank_assets/main.css (2089, 2023-08-29)
dist/dbank_assets/sample-asset.txt (24, 2023-08-29)
index.html (835, 2023-08-29)
package-lock.json (300447, 2023-08-29)
package.json (1188, 2023-08-29)
src/ (0, 2023-08-29)
src/dbank/ (0, 2023-08-29)
src/dbank/main.mo (1257, 2023-08-29)
src/dbank_assets/ (0, 2023-08-29)
src/dbank_assets/assets/ (0, 2023-08-29)
src/dbank_assets/assets/dbank_logo.png (35902, 2023-08-29)
src/dbank_assets/assets/favicon.ico (15406, 2023-08-29)
src/dbank_assets/assets/main.css (2089, 2023-08-29)
src/dbank_assets/assets/sample-asset.txt (24, 2023-08-29)
src/dbank_assets/src/ (0, 2023-08-29)
src/dbank_assets/src/index.html (835, 2023-08-29)
src/dbank_assets/src/index.js (1095, 2023-08-29)
src/declarations/ (0, 2023-08-29)
src/declarations/dbank/ (0, 2023-08-29)
src/declarations/dbank/dbank.did (150, 2023-08-29)
src/declarations/dbank/dbank.did.d.ts (270, 2023-08-29)
src/declarations/dbank/dbank.did.js (342, 2023-08-29)
src/declarations/dbank/dbank.old.did (150, 2023-08-29)
src/declarations/dbank/index.js (1409, 2023-08-29)
src/declarations/dbank_assets/ (0, 2023-08-29)
src/declarations/dbank_assets/assetstorage.did (3763, 2023-08-29)
src/declarations/dbank_assets/dbank_assets.did (3763, 2023-08-29)
src/declarations/dbank_assets/dbank_assets.did.d.ts (3720, 2023-08-29)
src/declarations/dbank_assets/dbank_assets.did.js (4663, 2023-08-29)
src/declarations/dbank_assets/index.js (1458, 2023-08-29)
... ...

# DBank Decentralized Bank (DBank) Smart Contract The Decentralized Bank (DBank) is a simple example of a smart contract for a decentralized banking application running on a blockchain platform. It allows users to perform basic financial operations such as topping up their account, withdrawing funds, and earning interest on their balance over time. This readme file provides an overview of the DBank smart contract, its functionalities, and how to interact with it. Introduction The DBank smart contract is designed to simulate a decentralized bank on a blockchain. Users can deposit funds, withdraw funds, and observe their balance grow through interest accrual over time. The contract is written in a language compatible with the chosen blockchain platform and follows best practices for secure and efficient code execution. Features Topping Up: Users can add funds to their bank account by using the topUp function, providing the amount they wish to deposit. Withdrawing Funds: Users can withdraw funds from their account using the withDraw function. Withdrawals are only allowed if the account has sufficient balance. Checking Bank Balance: Users can query their account balance using the bankBalance function, which returns the current balance asynchronously. Interest Calculation: The compound function allows the bank's balance to grow over time through compound interest. The interest rate is currently fixed at 1% and is applied based on the time elapsed since the last compound operation. Getting Started Prerequisites Blockchain Environment: You need access to a compatible blockchain environment that supports the programming language and features used in the smart contract code. Deploying the Smart Contract Compile the smart contract code to the format required by your blockchain platform. Deploy the compiled contract to the blockchain of your choice, following the deployment guidelines specific to your platform. Interest Calculation The compound function calculates and applies interest to the account balance. The interest rate is fixed at 1%, and the interest is calculated based on the time elapsed since the last compound operation. This mechanism allows the balance to grow over time through compound interest. Contributing Contributions to the DBank smart contract project are welcome. If you'd like to contribute, please follow these steps: Fork the repository and create a new branch. Make your changes and ensure they adhere to coding standards. Create a pull request describing the changes you've made.

近期下载者

相关文件


收藏者