Last active
October 10, 2019 03:13
-
-
Save max-blaushild/009b431d23a14addccef986161df00ef to your computer and use it in GitHub Desktop.
Edgeware Signal Proxy Smart Contract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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