Skip to content

Instantly share code, notes, and snippets.

@naterush
Created July 11, 2017 03:46
Show Gist options
  • Save naterush/00a5e7339d189a88c4480adc1c01829a to your computer and use it in GitHub Desktop.
Save naterush/00a5e7339d189a88c4480adc1c01829a to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.8;
//Allows for decentralized incentivization of initilizing storage
//to pay lower fees overall.
contract FuelEfficient {
uint maxGasPrice;
address contractAdd;
function FuelEfficient(uint _maxGasPrice, address add) {
maxGasPrice = _maxGasPrice;
contractAdd = add;
}
function poke() {
if (tx.gasprice > maxGasPrice) throw;
if (msg.gas * tx.gasprice < this.balance / 2) throw;
contractAdd.call(bytes4(sha3("poke()")));
msg.sender.send(this.balance);
}
function deposit() payable {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment