updates all functions so they can be easily overriden

This commit is contained in:
Alexey 2021-08-13 17:05:23 +03:00
parent 6d219e19ee
commit 9f095bfcb2
3 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0; pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
@ -55,7 +55,7 @@ contract TornadoProxy {
ITornadoInstance _tornado, ITornadoInstance _tornado,
bytes32 _commitment, bytes32 _commitment,
bytes calldata _encryptedNote bytes calldata _encryptedNote
) external payable { ) public virtual payable {
Instance memory instance = instances[_tornado]; Instance memory instance = instances[_tornado];
require(instance.state != InstanceState.DISABLED, "The instance is not supported"); require(instance.state != InstanceState.DISABLED, "The instance is not supported");
@ -79,7 +79,7 @@ contract TornadoProxy {
address payable _relayer, address payable _relayer,
uint256 _fee, uint256 _fee,
uint256 _refund uint256 _refund
) external payable { ) public virtual payable {
Instance memory instance = instances[_tornado]; Instance memory instance = instances[_tornado];
require(instance.state != InstanceState.DISABLED, "The instance is not supported"); require(instance.state != InstanceState.DISABLED, "The instance is not supported");
@ -89,17 +89,17 @@ contract TornadoProxy {
} }
} }
function backupNotes(bytes[] calldata _encryptedNotes) external { function backupNotes(bytes[] calldata _encryptedNotes) external virtual {
for (uint256 i = 0; i < _encryptedNotes.length; i++) { for (uint256 i = 0; i < _encryptedNotes.length; i++) {
emit EncryptedNote(msg.sender, _encryptedNotes[i]); emit EncryptedNote(msg.sender, _encryptedNotes[i]);
} }
} }
function updateInstance(Tornado calldata _tornado) external onlyGovernance { function updateInstance(Tornado calldata _tornado) external virtual onlyGovernance {
_updateInstance(_tornado); _updateInstance(_tornado);
} }
function setTornadoTreesContract(ITornadoTrees _tornadoTrees) external onlyGovernance { function setTornadoTreesContract(ITornadoTrees _tornadoTrees) external virtual onlyGovernance {
tornadoTrees = _tornadoTrees; tornadoTrees = _tornadoTrees;
emit TornadoTreesUpdated(_tornadoTrees); emit TornadoTreesUpdated(_tornadoTrees);
} }
@ -109,7 +109,7 @@ contract TornadoProxy {
IERC20 _token, IERC20 _token,
address payable _to, address payable _to,
uint256 _amount uint256 _amount
) external onlyGovernance { ) external virtual onlyGovernance {
require(_to != address(0), "TORN: can not send to zero address"); require(_to != address(0), "TORN: can not send to zero address");
if (_token == IERC20(0)) { if (_token == IERC20(0)) {

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0; pragma solidity >=0.6.0 <0.8.0;
interface ITornadoInstance { interface ITornadoInstance {
function token() external view returns (address); function token() external view returns (address);

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.6.0; pragma solidity >=0.6.0 <0.8.0;
interface ITornadoTrees { interface ITornadoTrees {
function registerDeposit(address instance, bytes32 commitment) external; function registerDeposit(address instance, bytes32 commitment) external;