feat: add withdraw method to relay contract (#585)

This commit is contained in:
Richard Ramos 2020-01-07 10:47:09 -04:00 committed by GitHub
parent 754f158407
commit 55fe58bf9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -72,6 +72,16 @@ contract EscrowRelay is RelayRecipient, Ownable {
setRelayHub(IRelayHub(_relayHub));
}
/**
* @notice Withdraw the ETH used for relay trxs
* @dev Only contract owner can execute this function
*/
function withdraw() external onlyOwner {
IRelayHub rh = IRelayHub(getHubAddr());
uint balance = getRecipientBalance();
rh.withdraw(balance, msg.sender);
}
/**
* @notice Determine if the timeout for relaying a create/cancel transaction has passed
* @param _account Account to verify