Skip to content

Instantly share code, notes, and snippets.

@gptshubham595
Created February 21, 2021 21:55
Show Gist options
  • Save gptshubham595/481d1b2d506ed67ab76d341fda136c9f to your computer and use it in GitHub Desktop.
Save gptshubham595/481d1b2d506ed67ab76d341fda136c9f to your computer and use it in GitHub Desktop.
blockchain smart contract solidity file
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