diff --git a/contracts/TornadoPool.sol b/contracts/TornadoPool.sol index 0968103..53deb3e 100644 --- a/contracts/TornadoPool.sol +++ b/contracts/TornadoPool.sol @@ -19,6 +19,10 @@ interface IVerifier { function verifyProof(bytes memory _proof, uint256[24] memory _input) external view returns (bool); } +interface ERC20 { + function transfer(address to, uint256 value) external returns (bool); +} + contract TornadoPool { uint256 public constant FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617; uint256 public constant MAX_EXT_AMOUNT = 2**248 - 1; @@ -90,13 +94,15 @@ contract TornadoPool { } else if (extAmount < 0) { require(msg.value == 0, "Sent ETH amount should be 0 for withdrawal"); require(_extData.recipient != address(0), "Can't withdraw to zero address"); - _extData.recipient.transfer(uint256(-extAmount)); + // _extData.recipient.transfer(uint256(-extAmount)); + ERC20(0x4200000000000000000000000000000000000006).transfer(_extData.recipient, uint256(-extAmount)); } else { require(msg.value == 0, "Sent ETH amount should be 0 for transaction"); } if (_fee > 0) { - _extData.relayer.transfer(_fee); + // _extData.relayer.transfer(_fee); + ERC20(0x4200000000000000000000000000000000000006).transfer(_extData.relayer, _fee); } emit NewCommitment(_outputCommitments[0], currentCommitmentIndex++, _extData.encryptedOutput1); diff --git a/hardhat.config.js b/hardhat.config.js index 6dae415..ca031e1 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -13,7 +13,7 @@ const config = { }, }, ovm: { - solcVersion: '0.7.6', // Your version goes here. + solcVersion: '0.7.6+commit.3b061308', }, networks: { // goerli: { diff --git a/package.json b/package.json index cae445f..af27b2c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "circuit": "./scripts/buildCircuit.sh 2 && ./scripts/buildCircuit.sh 16", "compile": "npx hardhat compile", "build": "npm run circuit && npm run compile", + "deploy": "npx hardhat run scripts/deploy.js --network optimism", "download": "curl -L https://github.com/tornadocash/tornado-pool/releases/download/tmp/ptau15 --create-dirs -o artifacts/circuits/ptau15", "test": "npx hardhat test", "eslint": "eslint --ext .js --ignore-path .gitignore .", diff --git a/scripts/deploy.js b/scripts/deploy.js index be84658..41c6916 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -1,6 +1,6 @@ const { ethers } = require('hardhat') -const MERKLE_TREE_HEIGHT = 5 +const MERKLE_TREE_HEIGHT = 32 const MerkleTree = require('fixed-merkle-tree') const { poseidon } = require('circomlib') const poseidonHash = (items) => ethers.BigNumber.from(poseidon(items).toString())