mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 01:37:07 +01:00
make withdraw function external
This commit is contained in:
parent
61864ceda1
commit
4d6dca78b2
@ -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];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user