Guest User

Untitled

a guest
Apr 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. contract Factory {
  2. address[] newContracts;
  3.  
  4. function createContract(uint num) {
  5. address newContract = new Contract(num);
  6. newContracts.push(newContract);
  7. }
  8.  
  9. function getContract() view public returns(address[]) {
  10. return newContracts;
  11. }
  12.  
  13. function getNum(address _add) view public returns(uint) {
  14. return Contract(_add).getNum();
  15. }
  16. }
  17.  
  18.  
  19. contract Contract {
  20. uint public Num;
  21.  
  22. function Contract(uint num) {
  23. Num = num;
  24. }
  25.  
  26. function getNum() public returns(uint) {
  27. return Num;
  28. }
  29. }
Add Comment
Please, Sign In to add comment