Created
July 2, 2018 14:45
-
-
Save snavruzov/d89e16a4b83ee5aa0b7b329b76140f2e to your computer and use it in GitHub Desktop.
Pet Adoption smart-contract in Solidity
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.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