make withdraw function external

This commit is contained in:
poma 2019-10-25 14:12:18 +03:00
parent 61864ceda1
commit 4d6dca78b2

View File

@ -61,7 +61,7 @@ contract Mixer is MerkleTreeWithHistory {
@dev Deposit funds into mixer. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this mixer.
@param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
function deposit(bytes32 _commitment) public payable {
function deposit(bytes32 _commitment) external payable {
require(!isDepositsDisabled, "deposits are disabled");
require(!commitments[_commitment], "The commitment has been submitted");
@ -83,7 +83,7 @@ contract Mixer is MerkleTreeWithHistory {
- the receiver of funds
- optional fee that goes to the transaction sender (usually a relay)
*/
function withdraw(bytes memory _proof, bytes32 _root, bytes32 _nullifierHash, address payable _receiver, address payable _relayer, uint256 _fee, uint256 _refund) public payable {
function withdraw(bytes calldata _proof, bytes32 _root, bytes32 _nullifierHash, address payable _receiver, address payable _relayer, uint256 _fee, uint256 _refund) external payable {
require(_fee <= denomination, "Fee exceeds transfer value");
require(!nullifierHashes[_nullifierHash], "The note has been already spent");
require(isKnownRoot(_root), "Cannot find your merkle root"); // Make sure to use a recent one
@ -98,7 +98,7 @@ contract Mixer is MerkleTreeWithHistory {
function _processWithdraw(address payable _receiver, address payable _relayer, uint256 _fee, uint256 _refund) internal;
/** @dev whether a note is already spent */
function isSpent(bytes32 _nullifierHash) public view returns(bool) {
function isSpent(bytes32 _nullifierHash) external view returns(bool) {
return nullifierHashes[_nullifierHash];
}