Giter Club home page Giter Club logo

banking_with_solidity's Introduction

Banking_With_Solidity

In this repo, we will be developing a Personal Bank Account using Ethereum smart contracts. This contract will also let you deposit money, earn interest and even withdraw your returns!

Start by selecting the appropriate compiler version, then name the contract.

We must then create a function that retrieves the contract balance. See below for reference.

balance

There will be two mappings, one for the balances and one for the deposit timestamps.

Next, another function is needed to initiate the deposit. We will do this by adding two uint variables principal and timeElapsed.

function

Now that the user can deposit funds into the contract, we need the funds to begin earning interest on the deposited amount. Do this by creating another function called 'getBalance' or any other name you like. This will increase your balance by the assigned interest given when creating the contract. Simply click 'getBalance' as shown below to see your balance increase!

interest

Keep in mind the interest earned can't be coming out of nowhere, there needs to be funds into the smart contract so the interest can be earned from the deposited amount instead of from the depositor. Create another function that adds funds to the smart contract.

Lastly, there needs to be a withdraw function so we can take out the funds we deposited with the earned interest.

Solidity Joyride Quest on Questbook: https://questbook.notion.site/Questbook-Learn-Web3-a5f4be8b107f4647a91fe84e6aa7e722

banking_with_solidity's People

Contributors

bfree22 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.