Created
January 25, 2018 22:04
-
-
Save anonymous/8aec3bc4a538381ff028b18bb7274435 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=
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.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