Guest User

Untitled

a guest
Jan 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. contract Adoption {
  2. address[16] public adopters;
  3.  
  4. function adopt(uint petId) public returns (uint) {
  5. require(petId >= 0 && petId <= 15);
  6. adopters[petId] = msg.sender;
  7. return petId;
  8. }
  9.  
  10. function getAdopters() public returns (address[16]) {
  11. return adopters;
  12. }
  13. }
  14.  
  15. App.contracts.Adoption.deployed().then(function(instance) {
  16. adoptionInstance = instance;
  17. return adoptionInstance.adopt(petId, {from: account});
  18. })
Add Comment
Please, Sign In to add comment