Skip to content

Commit

Permalink
build: dumper
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Jun 4, 2024
1 parent 26c43a9 commit b10c5d9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions contracts/splitter/Dumper.sol
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);
}
}

0 comments on commit b10c5d9

Please sign in to comment.