feat: withdraw and change relay hub address (#11)

This commit is contained in:
RichΛrd 2020-03-30 11:57:50 -04:00 committed by GitHub
parent 915caf4b33
commit bd4a85db01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import "./StakingPool.sol";
import "./common/Controlled.sol";
import "@openzeppelin/contracts/drafts/ERC20Snapshot.sol";
import "@openzeppelin/contracts/GSN/GSNRecipient.sol";
import "@openzeppelin/contracts/GSN/IRelayHub.sol";
contract StakingPoolDAO is StakingPool, GSNRecipient, ERC20Snapshot, Controlled {
@ -246,4 +247,15 @@ contract StakingPoolDAO is StakingPool, GSNRecipient, ERC20Snapshot, Controlled
function _postRelayedCall(bytes memory context, bool, uint256 actualCharge, bytes32) internal {
}
function withdraw() external onlyController {
IRelayHub rh = IRelayHub(getHubAddr());
uint balance = rh.balanceOf(address(this));
_withdrawDeposits(balance, msg.sender);
}
function setRelayHubAddress(address _relayHub) external onlyController {
_upgradeRelayHub(_relayHub);
}
}