Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity >=0.4.0;
- contract bank{
- uint private value;
- function deposit(uint amount){
- value+=amount;
- }
- function bank(uint amount){
- value=amount;
- }
- function withdraw(uint amount){
- value-=amount;
- }
- function balance() returns(uint){
- return value;
- }
- }
- contract Myfirstcontract is bank(10){
- string private name;
- uint private age;
- function setname(string newName){
- name=newName;
- }
- function getname() returns(string){
- return name;
- }
- function setAge(uint newAge){
- age=newAge;
- }
- function getAge() returns(uint){
- return age;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement