Skip to content

Instantly share code, notes, and snippets.

@critesjosh
Created January 10, 2018 21:52
Show Gist options
  • Save critesjosh/fbabcaec8ec19d0bad0dba9983810402 to your computer and use it in GitHub Desktop.
Save critesjosh/fbabcaec8ec19d0bad0dba9983810402 to your computer and use it in GitHub Desktop.
Truffle pet shop tutorial contract
pragma solidity ^0.4.4;
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 constant returns (address[16]) {
return adopters;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment