Skip to content

Instantly share code, notes, and snippets.

@birdca
Created November 28, 2018 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birdca/57e72ec568370c268ecdaeb2342f1896 to your computer and use it in GitHub Desktop.
Save birdca/57e72ec568370c268ecdaeb2342f1896 to your computer and use it in GitHub Desktop.
for workshop slide
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