Created
February 21, 2021 21:55
-
-
Save gptshubham595/481d1b2d506ed67ab76d341fda136c9f to your computer and use it in GitHub Desktop.
blockchain smart contract solidity file
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
pragma solidity 0.4.25; | |
contract Bank{ | |
int bal; | |
constructor() public{ | |
bal=1; | |
} | |
function getBal() view public returns(int){ | |
return bal; | |
} | |
function withdraw(int amt) public{ | |
if(bal>=amt && amt>0){ | |
bal=bal-amt; | |
} | |
} | |
function deposit(int amt) public{ | |
bal=bal+amt; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment