-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26c43a9
commit b10c5d9
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: GNU AGPLv3 | ||
pragma solidity >=0.8.18; | ||
|
||
import {Governance} from "@periphery/utils/Governance.sol"; | ||
import {Accountant, ERC20, SafeERC20} from "../accountants/Accountant.sol"; | ||
|
||
contract Dumper is Governance { | ||
using SafeERC20 for ERC20; | ||
|
||
address public immutable accountant; | ||
|
||
address public tf; | ||
|
||
constructor( | ||
address _governance, | ||
address _accountant, | ||
address _tf | ||
) Governance(_governance) { | ||
accountant = _accountant; | ||
tf = _tf; | ||
} | ||
|
||
function setTf(address _tf) external onlyGovernance { | ||
tf = _tf; | ||
} | ||
|
||
function distribute(address _token) external onlyGovernance { | ||
Accountant(accountant).distribute(_token); | ||
uint256 balance = ERC20(_token).balanceOf(address(this)); | ||
ERC20(tf).safeTransfer(tf, balance); | ||
} | ||
|
||
function distribute( | ||
address _token, | ||
uint256 _amount | ||
) external onlyGovernance { | ||
Accountant(accountant).distribute(_token, _amount); | ||
ERC20(_token).safeTransfer(tf, _amount); | ||
} | ||
} |