Merge pull request #11 from logos-co:3esmit/issue4

add claimTokens
This commit is contained in:
Ricardo Guilherme Schmidt 2023-09-26 12:15:29 -03:00 committed by GitHub
commit 93bcf1c5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -62,6 +62,21 @@ contract SNTPlaceHolder is TokenController, Owned {
return true;
}
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(MiniMeToken _token) public onlyOwner {
if (address(_token) == address(0)) {
payable(owner).transfer(address(this).balance);
return;
}
uint256 balance = _token.balanceOf(address(this));
_token.transfer(owner, balance);
emit ClaimedTokens(address(_token), owner, balance);
}
event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);
event ControllerChanged(address indexed _newController);
}