Skip to content

sterling-d/Smart-Contract-Using-Solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Contract Using Solidity

Overview

This application is based on a Solidity smart contract that automates the financial process and features of joint saving accounts. This smart contract accepts two user addresses that controls a joint savings account by using ether management function to implement financial institutions requirements for providing the ability to deposit and withdraw the funds from the account.

Technology

This project leverages Solidity and Remix IDE.

Usage

To use this application first open the Remix IDE https://remix.ethereum.org/#optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.7+commit.e28d00a7.js. In the Featured Plugins area,click the Solidity button.

Now execute the following steps:

  • In the IDE click the "File explorers" button.
  • In the File Explorers pane, on the toolbar,click the Create New File button and create a file named joint_saving.sol.
  • Next, clone the repo and copy the code from joint_savings.sol file.Navigate to the “Deploy & run transactions” pane and select Remix VM(London) execution environment.
  • Now click the Deploy button to deploy the smart contract, and then confirm that it successfully deployed.

Interact with Your Deployed Smart Contract

To interact with your deployed smart contract, complete the following steps:

  1. Use the setAccounts function to define the authorized Ethereum address that will be able to withdraw funds from your contract.

    You can create new, dummy addresses on the Vanity-ETH https://vanity-eth.tk website, which includes an Ethereum vanity address generator.

  2. Test the deposit functionality of your smart contract by sending the some amounts of ether. After each transaction, use the contractBalance function to verify that the funds were added to your contract.

  3. Once you’ve successfully deposited funds into your contract, test the contract’s withdrawal functionality by withdrawing some ether into accountOne and accountTwo. After each transaction, use the contractBalance function to verify that the funds were withdrawn from your contract. Also, use the lastToWithdraw and lastWithdrawAmount functions to verify that the address and amount were correct.

Execution Results:

today

Deployed Contract

Screenshot 2022-11-23 at 7 39 16 PM

1st Transaction: Depositing 1 Ether

Screenshot 2022-11-23 at 7 43 54 PM

Balance after depositing 1st ether:

Screenshot 2022-11-23 at 7 44 52 PM

2nd Transaction: Depositing 10 Ether

Screenshot 2022-11-23 at 7 46 07 PM

Balance after depositing 10 ether:

Screenshot 2022-11-23 at 7 47 14 PM

3rd Transaction: Depositing 5 Ether:

Screenshot 2022-11-23 at 7 48 51 PM

Balance after depositing 10 ether:

Screenshot 2022-11-23 at 7 49 38 PM

Using our withdraw function between Account 1 and Account 2:

Withdrawing 5 ether into Account 1:

Screenshot 2022-11-23 at 7 52 07 PM

Withdrawing 10 ether into Account 2:

Screenshot 2022-11-23 at 7 54 20 PM

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published