tornado-contracts/contracts/Classic/cTornado.sol

42 lines
1.7 KiB
Solidity
Raw Normal View History

2024-03-30 12:40:05 +03:00
// https://tornadocash.website
2024-03-30 00:52:45 +03:00
/*
* d888888P dP a88888b. dP
* 88 88 d8' `88 88
* 88 .d8888b. 88d888b. 88d888b. .d8888b. .d888b88 .d8888b. 88 .d8888b. .d8888b. 88d888b.
* 88 88' `88 88' `88 88' `88 88' `88 88' `88 88' `88 88 88' `88 Y8ooooo. 88' `88
* 88 88. .88 88 88 88 88. .88 88. .88 88. .88 dP Y8. .88 88. .88 88 88 88
* dP `88888P' dP dP dP `88888P8 `88888P8 `88888P' 88 Y88888P' `88888P8 `88888P' dP dP
* ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { IVerifier, IHasher, ERC20Tornado } from "./ERC20Tornado.sol";
import { IERC20 } from "./interfaces/IERC20.sol";
contract cTornado is ERC20Tornado {
2024-03-30 09:10:48 +03:00
address public immutable governance;
2024-03-30 00:52:45 +03:00
IERC20 public immutable comp;
constructor(
2024-03-30 09:10:48 +03:00
address _governance,
2024-03-30 00:52:45 +03:00
IERC20 _comp,
IVerifier _verifier,
IHasher _hasher,
uint256 _denomination,
uint32 _merkleTreeHeight,
IERC20 _token
) ERC20Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight, _token) {
require(address(_comp) != address(0), "Invalid COMP token address");
2024-03-30 09:10:48 +03:00
governance = _governance;
2024-03-30 00:52:45 +03:00
comp = _comp;
}
/// @dev Moves earned yield of the COMP token to the tornado governance contract
/// To make it work you might need to call `comptroller.claimComp(cPoolAddress)` first
function claimComp() external {
comp.transfer(governance, comp.balanceOf(address(this)));
}
}