Skip to content

Instantly share code, notes, and snippets.

@kevinbluer
Last active November 26, 2018 21:36
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 kevinbluer/224f98b7098d4a2c4b83f4c207cda130 to your computer and use it in GitHub Desktop.
Save kevinbluer/224f98b7098d4a2c4b83f4c207cda130 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.0+commit.1d4f565a.js&optimize=false&gist=
pragma solidity ^0.4.19;
/// @title A simulator for Bug Bunny, the most famous Rabbit
/// @author Warned Bros
/// @notice You can use this contract for only the most basic simulation
/// @dev All function calls are currently implement without side effects
contract BugsBunny {
/// @author Bob Clampett
/// @notice Determine if Bugs will accept `(_food)` to eat
/// @dev String comparison may be inefficient
/// @param _food The name of a food to evaluate (English)
/// @return true if Bugs will eat it, false otherwise
function doesEat(string _food) external pure returns (bool) {
return keccak256(_food) == keccak256("carrot");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment