mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 09:47:13 +01: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 {
|
contract Mixer is MerkleTreeWithHistory {
|
||||||
bool public isDepositsEnabled = true;
|
bool public isDepositsEnabled = true;
|
||||||
|
bool public isVerifierUpdateAllowed = true;
|
||||||
// operator can disable new deposits in case of emergency
|
// operator can disable new deposits in case of emergency
|
||||||
// it also receives a relayer fee
|
// it also receives a relayer fee
|
||||||
address payable public operator;
|
address payable public operator;
|
||||||
@ -96,6 +97,17 @@ contract Mixer is MerkleTreeWithHistory {
|
|||||||
isDepositsEnabled = !isDepositsEnabled;
|
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 {
|
function changeOperator(address payable _newAccount) external {
|
||||||
require(msg.sender == operator, "unauthorized");
|
require(msg.sender == operator, "unauthorized");
|
||||||
operator = _newAccount;
|
operator = _newAccount;
|
||||||
|
Loading…
Reference in New Issue
Block a user