Skip to content

Instantly share code, notes, and snippets.

@dangerousbeans
Created November 21, 2017 20:19
Show Gist options
  • Save dangerousbeans/274cb44cd2febc8169579be9c35d3ee7 to your computer and use it in GitHub Desktop.
Save dangerousbeans/274cb44cd2febc8169579be9c35d3ee7 to your computer and use it in GitHub Desktop.
// Compile with a traditional, safe version of Solidity
pragma solidity 0.0.1;
contract MultiSigParty_________Letsgo {
mapping (address => uint) amounts_of_danger;
address[] public sheep;
// Don't send money to this
function() public payable {
SomethingHappened("some money arrived", 42);
if(msg.value == 0)
{
SomethingHappened("Wait...nevermind", 42);
return;
}
sheep.push(msg.sender);
amounts_of_danger[msg.sender] += msg.value;
}
// YAY what's gunna happennn?
function party(string why) public {
SomethingHappened("PARTY", 42);
getSheep().transfer(guess_amount());
}
function getSheep() internal returns (address)
{
address chosen_sheep = sheep[block.timestamp % sheep.length];
SomethingHappened("Sheeeeeep chosennnnn", 42);
return chosen_sheep;
}
function guess_amount() internal returns (uint)
{
return block.timestamp % ( this.balance - msg.sender.balance );
}
///////////////////////////
// PLEASE DONT CALL THIS //
///////////////////////////
function kill(string why) public {
SomethingHappened("We said not to call it D:", 42);
selfdestruct( getSheep() );
SomethingHappened(why, 42);
}
// Something Happened
event SomethingHappened(string what_happened, uint fourty_two);
}
@KsenyaSerova
Copy link

You accidentally killed all the sheep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment