//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.18; contract PichuCastle { uint public timeout = 60; uint private halfway = timeout/2; string private name = "Pichu"; // View functions ensure that they will not modify the state. // For an external call, all function arguments have to be copied to memory. function getHalfway() external view returns (uint) { return halfway; } function getName() public view returns (string) { return name; } } contract PichuMuffin { uint public fans = 0; int money; address private wallet; // constructor(address _wallet) public { // wallet = _wallet; // } function tip() public payable { require(msg.value > 0); wallet.transfer(msg.value); } function getBalance() public view returns (address) { return wallet; } function like() public { fans = fans + 1; } //The "constant" keyword means that function will not alter //the state of the contractthat means it won't alter //any data, and so contract state and data remain. function getFans() public constant returns (uint) { return fans; } function isBestMuffin() public pure returns (bool) { return true; } function lesserThan(uint a, uint b) public pure returns (bool){ return a <= b; } function hasLotsOfFans() public view returns (bool){ return lesserThan(1000, fans); } function notZero(uint number) internal pure returns (bool) { return number != 0; } function isRecommended() public view returns (bool) { return (hasLotsOfFans() && notZero(fans)); } }
0.4.18