linter fixes

This commit is contained in:
Drygin 2022-01-22 03:23:33 +03:00
parent bd4500d7ff
commit 1f1964417a
6 changed files with 52 additions and 43 deletions

View File

@ -5,11 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/Ownable.sol";
contract WETH is ERC20 { contract WETH is ERC20 {
constructor(string memory name, string memory ticker) ERC20(name, ticker) {}
constructor(
string memory name,
string memory ticker
) ERC20(name, ticker) {}
function deposit() external payable { function deposit() external payable {
_mint(msg.sender, msg.value); _mint(msg.sender, msg.value);

View File

@ -276,7 +276,11 @@ contract TornadoPool is MerkleTreeWithHistory, IERC20Receiver, ReentrancyGuard,
if (_extData.extAmount < 0) { if (_extData.extAmount < 0) {
require(_extData.recipient != address(0), "Can't withdraw to zero address"); require(_extData.recipient != address(0), "Can't withdraw to zero address");
if (_extData.isL1Withdrawal) { if (_extData.isL1Withdrawal) {
token.transferAndCall(omniBridge, uint256(-_extData.extAmount), abi.encodePacked(l1Unwrapper, _extData.recipient, _extData.l1Fee)); token.transferAndCall(
omniBridge,
uint256(-_extData.extAmount),
abi.encodePacked(l1Unwrapper, _extData.recipient, _extData.l1Fee)
);
} else { } else {
token.transfer(_extData.recipient, uint256(-_extData.extAmount)); token.transfer(_extData.recipient, uint256(-_extData.extAmount));
} }

View File

@ -78,7 +78,7 @@ contract L1Unwrapper is WETHOmnibridgeRouter {
address _token, address _token,
uint256 _value, uint256 _value,
bytes memory _data bytes memory _data
) override external { ) external override {
require(_token == address(WETH)); require(_token == address(WETH));
require(msg.sender == address(bridge)); require(msg.sender == address(bridge));
require(_data.length == 52); require(_data.length == 52);

View File

@ -26,8 +26,7 @@ library BytesHelper {
* @param _start start index of slice * @param _start start index of slice
* @return x uint included in the 32 length slice of the bytes array in parameter. * @return x uint included in the 32 length slice of the bytes array in parameter.
*/ */
function sliceToUint(bytes memory _bytes, uint _start) internal pure returns (uint x) function sliceToUint(bytes memory _bytes, uint256 _start) internal pure returns (uint256 x) {
{
require(_bytes.length >= _start + 32, "slicing out of range"); require(_bytes.length >= _start + 32, "slicing out of range");
assembly { assembly {
x := mload(add(_bytes, add(0x20, _start))) x := mload(add(_bytes, add(0x20, _start)))

View File

@ -16,7 +16,17 @@ async function buildMerkleTree({ tornadoPool }) {
return new MerkleTree(MERKLE_TREE_HEIGHT, leaves, { hashFunction: poseidonHash2 }) return new MerkleTree(MERKLE_TREE_HEIGHT, leaves, { hashFunction: poseidonHash2 })
} }
async function getProof({ inputs, outputs, tree, extAmount, fee, recipient, relayer, isL1Withdrawal, l1Fee }) { async function getProof({
inputs,
outputs,
tree,
extAmount,
fee,
recipient,
relayer,
isL1Withdrawal,
l1Fee,
}) {
inputs = shuffle(inputs) inputs = shuffle(inputs)
outputs = shuffle(outputs) outputs = shuffle(outputs)