Last active
August 3, 2022 17:07
-
-
Save believeohiozua/b30c2bf6e88e923e42487b04fe299cbd to your computer and use it in GitHub Desktop.
contract of transaction
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
contract StoreTransaction{ | |
address wallet; | |
uint256 amount; | |
uint256 balance; | |
uint256 total; | |
function totalDeposit() public view returns (uint256) { | |
return amount; | |
} | |
//mapping address to balance | |
mapping (address => uint256) balances; | |
//mapping address to total | |
mapping (address => uint256) totals; | |
//make payment | |
function makePayment(address _wallet, uint256 _amount) public { | |
wallet = _wallet; | |
amount = _amount; | |
balances[wallet] += amount; | |
totals[wallet] += amount; | |
} | |
//get balance of address | |
function getBalance(address _wallet) public view returns (uint256) { | |
return balances[_wallet]; | |
} | |
//get total of address | |
function getTotal(address _wallet) public view returns (uint256) { | |
return totals[_wallet]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment