Sam 3
Sam 3
Sam 3
Roll no – 60
PRN no - 2043110151
Branch - CSE
Subject - Block Chain and Digital Currency
Experiment - 3
1 - Deposit money
2 - Withdraw Money
3 - Show balance
Theory -
collection of code (its functions) and data (its state) that resides at
a specific address
Ethereum state.
Step 1:
Step 2:
Write the Smart contract in the code section, and click the
To execute the code, click on the Deploy button under Deploy and
Run Transactions window.
Step 4:
After deploying the code click on the method calls under the
drop-down of
Step 5:
Debug button
the console. Here you can check each function call and variable
assignments.
U
Program -
contract SimpleBank {
address owner;
/// @return The balance of the user after the deposit is made
balances[msg.sender] += depoamount;
payable(msg.sender).transfer(depoamount);
return balances[msg.sender];
}
/// @notice Withdraw ether from bank
balances[msg.sender] -= withdrawAmount;
payable(msg.sender).transfer(withdrawAmount);
return balances[msg.sender];
}
function balance() public view returns (uint) {
return balances[msg.sender];
Output -
Deploy
Deposit Money