2019-08-20 22:39:21 +02:00
|
|
|
// https://tornado.cash
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
pragma solidity ^0.5.8;
|
|
|
|
|
|
|
|
import "./Mixer.sol";
|
|
|
|
|
|
|
|
contract ETHMixer is Mixer {
|
|
|
|
constructor(
|
|
|
|
address _verifier,
|
2019-10-04 16:27:47 +02:00
|
|
|
uint256 _denomination,
|
2019-08-20 22:39:21 +02:00
|
|
|
uint8 _merkleTreeHeight,
|
|
|
|
uint256 _emptyElement,
|
|
|
|
address payable _operator
|
2019-10-04 16:27:47 +02:00
|
|
|
) Mixer(_verifier, _denomination, _merkleTreeHeight, _emptyElement, _operator) public {
|
2019-08-20 22:39:21 +02:00
|
|
|
}
|
|
|
|
|
2019-10-17 15:35:23 +02:00
|
|
|
function _processWithdraw(address payable _receiver, address payable _relayer, uint256 _fee, uint256 _refund) internal {
|
2019-10-07 06:15:06 +02:00
|
|
|
require(msg.value == 0, "Message value is supposed to be zero for ETH mixer");
|
|
|
|
require(_refund == 0, "Message value is supposed to be zero for ETH mixer");
|
|
|
|
|
2019-10-04 16:27:47 +02:00
|
|
|
_receiver.transfer(denomination - _fee);
|
2019-09-06 23:22:30 +02:00
|
|
|
if (_fee > 0) {
|
2019-09-06 22:54:37 +02:00
|
|
|
_relayer.transfer(_fee);
|
2019-08-20 22:39:21 +02:00
|
|
|
}
|
2019-09-06 23:22:30 +02:00
|
|
|
}
|
2019-08-20 22:39:21 +02:00
|
|
|
|
2019-09-06 23:22:30 +02:00
|
|
|
function _processDeposit() internal {
|
2019-10-04 16:27:47 +02:00
|
|
|
require(msg.value == denomination, "Please send `mixDenomination` ETH along with transaction");
|
2019-08-20 22:39:21 +02:00
|
|
|
}
|
|
|
|
}
|