Skip to content

Instantly share code, notes, and snippets.

@johnson86tw
Created June 14, 2021 08:07
Show Gist options
  • Save johnson86tw/62da103b847dcd5cde8153d7352d7427 to your computer and use it in GitHub Desktop.
Save johnson86tw/62da103b847dcd5cde8153d7352d7427 to your computer and use it in GitHub Desktop.
function deposit(bytes32 _commitment) external payable nonReentrant {
require(!commitments[_commitment], "The commitment has been submitted");
uint32 insertedIndex = _insert(_commitment);
commitments[_commitment] = true;
_processDeposit();
emit Deposit(_commitment, insertedIndex, block.timestamp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment