Skip to content

Instantly share code, notes, and snippets.

@ylv-io
Created October 27, 2019 16:07
Show Gist options
  • Save ylv-io/bb00fb7630c1af16dc4ccb15de12a717 to your computer and use it in GitHub Desktop.
Save ylv-io/bb00fb7630c1af16dc4ccb15de12a717 to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.0;
contract Fomo3d {
address public winner;
bool public gameover;
function win(address contender) public {
winner = contender;
}
}
contract BlockPacker {
Fomo3d public fomo3d;
constructor(Fomo3d target) public {
fomo3d = target;
}
function stuffBlock(address winner) public {
// burn gas only if the game is still running
require(!fomo3d.gameover(), "Game is over");
// burn all the gas if we are winning
assert(winner != fomo3d.winner());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment