final test

This commit is contained in:
Alexey 2019-07-13 00:50:26 +03:00
parent 1194e76b9a
commit 0db7be23b5
4 changed files with 27 additions and 7 deletions

View file

@ -3,7 +3,7 @@ pragma solidity ^0.5.8;
import "./MerkleTreeWithHistory.sol";
contract IVerifier {
function verify(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public returns(bool);
function verifyProof(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public returns(bool);
}
contract Mixer is MerkleTreeWithHistory {
@ -56,7 +56,7 @@ contract Mixer is MerkleTreeWithHistory {
require(fee < transferValue, "Fee exceeds transfer value");
require(!nullifiers[nullifier], "The note has been already spent");
require(isKnownRoot(root), "Cannot find your merkle root"); // Make sure to use a recent one
require(verifier.verify(a, b, c, input), "Invalid withdraw proof");
require(verifier.verifyProof(a, b, c, input), "Invalid withdraw proof");
nullifiers[nullifier] = true;
receiver.transfer(transferValue - fee);