Advertisement
Guest User

ad

a guest
Jan 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. pragma solidity >=0.4.0;
  2.  
  3. contract bank{
  4. uint private value;
  5. function deposit(uint amount){
  6. value+=amount;
  7. }
  8. function bank(uint amount){
  9. value=amount;
  10. }
  11. function withdraw(uint amount){
  12. value-=amount;
  13. }
  14. function balance() returns(uint){
  15. return value;
  16. }
  17. }
  18. contract Myfirstcontract is bank(10){
  19. string private name;
  20. uint private age;
  21.  
  22. function setname(string newName){
  23.  
  24. name=newName;
  25. }
  26. function getname() returns(string){
  27. return name;
  28. }
  29. function setAge(uint newAge){
  30. age=newAge;
  31. }
  32. function getAge() returns(uint){
  33. return age;
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement