This file contains hidden or 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.5.0; | |
contract MessageBoard { | |
string public message; | |
function setMessage(string memory newMessage) public { | |
message = newMessage; | |
} | |
} | |
This file contains hidden or 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.5.0; | |
contract MessageBoard { | |
string public message; | |
function setMessage(string memory newMessage) public { | |
message = newMessage; | |
} | |
} | |
This file contains hidden or 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
contract C { | |
address person1; | |
address person2; | |
bool person1Agreement = false; | |
bool person2Agreement = false; | |
function doWeAgree() constant returns (bool) { | |
if (person1Agreement == true && person2Agreement == true) | |
return true; |
This file contains hidden or 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
contract TicTacToe { | |
address player_one; | |
address player_two; | |
address public next_player; | |
address public winner; | |
mapping (uint => address) game_board; | |
uint total_moves; | |
bool public game_in_progress; | |
/// @notice Creates a tictactoe game for first player (first up) and second player |
This file contains hidden or 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
contract owned { | |
function owned() { owner = msg.sender; } | |
address owner; | |
modifier onlyowner { if (msg.sender != owner) throw; _ } | |
} | |
contract forDiana is owned { | |
event getPoem(string indexed message); | |
string[18] poem; | |
function forDiana() { |
This file contains hidden or 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
//These are the current name and type resolution tests and what we should be checking for whenever default arguments are invoked | |
BOOST_AUTO_TEST_CASE(default_args_calling_function) | |
{ | |
char const* text = R"( | |
contract C { | |
function def(uint x = 123, string b = "Hello") returns (uint, string, string a = "World") { | |
return (x, b, a); //maybe make it so we can leave a off? That might be getting ahead of ourselves | |
} | |
function check() { |