Created
November 28, 2018 11:09
-
-
Save birdca/57e72ec568370c268ecdaeb2342f1896 to your computer and use it in GitHub Desktop.
for workshop slide
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.24; | |
contract Adoption { | |
address[16] public adopters; | |
// Adopting a pet | |
function adopt(uint petId) public returns (uint) { | |
require(petId >= 0 && petId <= 15); | |
adopters[petId] = msg.sender; | |
return petId; | |
} | |
// Retrieving the adopters | |
function getAdopters() public view returns (address[16]) { | |
return adopters; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment