Last active
August 3, 2022 17:10
-
-
Save dicethedev/105a5f95b08bc557735192f63553c182 to your computer and use it in GitHub Desktop.
a simple contract that deposit fund into a contract and also keep track of funds transferred into the contract.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity 0.8.13; | |
contract Deposit { | |
mapping(address => uint256) balances; | |
function depositFund(address _address) public payable { | |
balances[_address] += msg.value; | |
} | |
function returnDepositFund(address _account) public view returns(uint256) { | |
return balances[_account]; | |
} | |
//function to return the balance of ether | |
function getDeposit() public view returns(uint256) { | |
return address(this).balance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment