Skip to content

Instantly share code, notes, and snippets.

@shahabvshahabi1996
Forked from anonymous/myFirstContract.sol
Created January 25, 2018 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shahabvshahabi1996/a308a78a66f264e3c18494329877d165 to your computer and use it in GitHub Desktop.
Save shahabvshahabi1996/a308a78a66f264e3c18494329877d165 to your computer and use it in GitHub Desktop.
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Bank {
uint private value;
function Bank(uint amount) public{
value = amount;
}
function deposite(uint amount) public{
value += amount;
}
function withDraw(uint amount) public{
value -= amount;
}
function balance() public view returns(uint){
return value;
}
}
contract myFirstContract is Bank(10){
string private name ;
uint private age ;
function setName(string newName) public{
name = newName;
}
function getName() public view returns(string){
return name;
}
function setAge(uint newAage) public{
age = newAage;
}
function getAge() public view returns(uint){
return age;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment