Skip to content

Instantly share code, notes, and snippets.

@max-blaushild
Last active October 10, 2019 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max-blaushild/009b431d23a14addccef986161df00ef to your computer and use it in GitHub Desktop.
Save max-blaushild/009b431d23a14addccef986161df00ef to your computer and use it in GitHub Desktop.
Edgeware Signal Proxy Smart Contract
contract EdgewareSignalProxy {
address payable public fundDst;
address public fundSrc;
address public admin;
bytes public edgewareAddr;
Lockdrop public lockdrop;
constructor(
Lockdrop _lockdrop,
address _fundSrc,
address payable _fundDst,
address _admin,
bytes memory _edgewareAddr
) public {
lockdrop = _lockdrop;
fundSrc = _fundSrc;
fundDst = _fundDst;
admin = _admin;
edgewareAddr = _edgewareAddr;
}
modifier auth() {
require(msg.sender == admin || msg.sender == fundDst, "Sender must be the fund destination or admin address");
_;
}
function () external payable {
require(msg.sender == fundSrc, "Sender must be the fund source address");
signal();
}
function signal() internal {
lockdrop.signal(address(this), 0, edgewareAddr);
}
function release() external auth {
address(fundDst).transfer(address(this).balance);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment