mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-12-24 13:59:23 -05:00
allow verifier keys update, and an option to permanently disable it
This commit is contained in:
parent
3624cb7531
commit
5c3c78e097
@ -19,6 +19,7 @@ contract IVerifier {
|
||||
|
||||
contract Mixer is MerkleTreeWithHistory {
|
||||
bool public isDepositsEnabled = true;
|
||||
bool public isVerifierUpdateAllowed = true;
|
||||
// operator can disable new deposits in case of emergency
|
||||
// it also receives a relayer fee
|
||||
address payable public operator;
|
||||
@ -96,6 +97,17 @@ contract Mixer is MerkleTreeWithHistory {
|
||||
isDepositsEnabled = !isDepositsEnabled;
|
||||
}
|
||||
|
||||
function updateVerifier(address newVerifier) external {
|
||||
require(isVerifierUpdateAllowed, "verifier updates are disabled");
|
||||
require(msg.sender == operator, "unauthorized");
|
||||
verifier = IVerifier(newVerifier);
|
||||
}
|
||||
|
||||
function disableVerifierUpdate() external {
|
||||
require(msg.sender == operator, "unauthorized");
|
||||
isVerifierUpdateAllowed = false;
|
||||
}
|
||||
|
||||
function changeOperator(address payable _newAccount) external {
|
||||
require(msg.sender == operator, "unauthorized");
|
||||
operator = _newAccount;
|
||||
|
Loading…
Reference in New Issue
Block a user