Skip to content

Instantly share code, notes, and snippets.

@snavruzov
Created July 2, 2018 14:45
Show Gist options
  • Save snavruzov/d89e16a4b83ee5aa0b7b329b76140f2e to your computer and use it in GitHub Desktop.
Save snavruzov/d89e16a4b83ee5aa0b7b329b76140f2e to your computer and use it in GitHub Desktop.
Pet Adoption smart-contract in Solidity
pragma solidity ^0.4.17;
contract Adoption {
address[16] public adopters;
function owners() public view returns (address) {
return adopters;
}
function adopt(uint hamId) public returns (uint) {
require(hamId >= 0 && hamId <= 15);
adopters[hamId] = msg.sender;
return hamId;
}
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