Skip to content

Instantly share code, notes, and snippets.

View VoR0220's full-sized avatar

RJ Catalano VoR0220

View GitHub Profile
@VoR0220
VoR0220 / contracts...message_board.sol
Created July 30, 2021 00:24
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.17+commit.d19bba13.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
contract MessageBoard {
string public message;
function setMessage(string memory newMessage) public {
message = newMessage;
}
}
@VoR0220
VoR0220 / contracts...message_board.sol
Created July 30, 2021 00:23
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.17+commit.d19bba13.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
contract MessageBoard {
string public message;
function setMessage(string memory newMessage) public {
message = newMessage;
}
}
contract C {
address person1;
address person2;
bool person1Agreement = false;
bool person2Agreement = false;
function doWeAgree() constant returns (bool) {
if (person1Agreement == true && person2Agreement == true)
return true;
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
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() {
@VoR0220
VoR0220 / SolidityNameAndTypeResolution.cpp
Last active January 24, 2016 08:08
Documentation for Solidity Default Parameters in Function and Return calls
//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() {