Create a gist now

Instantly share code, notes, and snippets.

@AgentME /Wforcer.sol Secret
Created Feb 3, 2018

What would you like to do?
pragma solidity ^0.4.11;
contract Owned {
address owner;
function Owned() {
owner = msg.sender;
}
function kill() {
if (msg.sender == owner) suicide(owner);
}
}
contract Wforcer is Owned {
function wcf(address target) payable {
require(msg.sender == owner);
uint startBalance = this.balance;
target.call.value(msg.value)();
if (this.balance <= startBalance) revert();
owner.transfer(this.balance);
}
function withdraw() {
require(msg.sender == owner);
require(this.balance > 0);
owner.transfer(this.balance);
}
function () payable {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment