rename variables

This commit is contained in:
poma 2019-12-13 20:49:19 +07:00
parent d9f4b16076
commit 4114f7b52c
No known key found for this signature in database
GPG key ID: BA20CB01FE165657
13 changed files with 169 additions and 169 deletions

View file

@ -11,9 +11,9 @@
pragma solidity ^0.5.8;
import "./Mixer.sol";
import "./Tornado.sol";
contract ERC20Mixer is Mixer {
contract ERC20Tornado is Tornado {
address public token;
constructor(
@ -22,12 +22,12 @@ contract ERC20Mixer is Mixer {
uint32 _merkleTreeHeight,
address _operator,
address _token
) Mixer(_verifier, _denomination, _merkleTreeHeight, _operator) public {
) Tornado(_verifier, _denomination, _merkleTreeHeight, _operator) public {
token = _token;
}
function _processDeposit() internal {
require(msg.value == 0, "ETH value is supposed to be 0 for ERC20 mixer");
require(msg.value == 0, "ETH value is supposed to be 0 for ERC20 instance");
_safeErc20TransferFrom(msg.sender, address(this), denomination);
}

View file

@ -11,15 +11,15 @@
pragma solidity ^0.5.8;
import "./Mixer.sol";
import "./Tornado.sol";
contract ETHMixer is Mixer {
contract ETHTornado is Tornado {
constructor(
IVerifier _verifier,
uint256 _denomination,
uint32 _merkleTreeHeight,
address _operator
) Mixer(_verifier, _denomination, _merkleTreeHeight, _operator) public {
) Tornado(_verifier, _denomination, _merkleTreeHeight, _operator) public {
}
function _processDeposit() internal {
@ -28,8 +28,8 @@ contract ETHMixer is Mixer {
function _processWithdraw(address payable _recipient, address payable _relayer, uint256 _fee, uint256 _refund) internal {
// sanity checks
require(msg.value == 0, "Message value is supposed to be zero for ETH mixer");
require(_refund == 0, "Refund value is supposed to be zero for ETH mixer");
require(msg.value == 0, "Message value is supposed to be zero for ETH instance");
require(_refund == 0, "Refund value is supposed to be zero for ETH instance");
(bool success, ) = _recipient.call.value(denomination - _fee)("");
require(success, "payment to _recipient did not go thru");

View file

@ -18,7 +18,7 @@ contract IVerifier {
function verifyProof(bytes memory _proof, uint256[6] memory _input) public returns(bool);
}
contract Mixer is MerkleTreeWithHistory, ReentrancyGuard {
contract Tornado is MerkleTreeWithHistory, ReentrancyGuard {
uint256 public denomination;
mapping(bytes32 => bool) public nullifierHashes;
// we store all commitments just to prevent accidental deposits with the same commitment
@ -56,7 +56,7 @@ contract Mixer is MerkleTreeWithHistory, ReentrancyGuard {
}
/**
@dev Deposit funds into mixer. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this mixer.
@dev Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
@param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
function deposit(bytes32 _commitment) external payable nonReentrant {
@ -73,9 +73,9 @@ contract Mixer is MerkleTreeWithHistory, ReentrancyGuard {
function _processDeposit() internal;
/**
@dev Withdraw a deposit from the mixer. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs
@dev Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs
`input` array consists of:
- merkle root of all deposits in the mixer
- merkle root of all deposits in the contract
- hash of unique deposit nullifier to prevent double spends
- the recipient of funds
- optional fee that goes to the transaction sender (usually a relay)