mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-07 16:55:02 -04:00
process deposit after changing state to prevent reentrancy
This commit is contained in:
parent
1d258715e0
commit
b8d22464e3
1 changed files with 1 additions and 1 deletions
|
@ -65,9 +65,9 @@ contract Mixer is MerkleTreeWithHistory {
|
|||
function deposit(uint256 commitment) public payable {
|
||||
require(isDepositsEnabled, "deposits are disabled");
|
||||
require(!commitments[commitment], "The commitment has been submitted");
|
||||
_processDeposit();
|
||||
_insert(commitment);
|
||||
commitments[commitment] = true;
|
||||
_processDeposit();
|
||||
|
||||
emit Deposit(commitment, next_index - 1, block.timestamp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue