From fa999688ac64e4fb04ec3b6fc9937da0b2b22f0b Mon Sep 17 00:00:00 2001 From: Santala Date: Mon, 8 Jan 2024 10:18:08 +0700 Subject: [PATCH] fix some typos --- .vscode/settings.json | 2 +- .../scripts/multi-chain-value/send-value.ts | 10 +++++----- .../contracts/multi-output/ZetaMultiOutput.sol | 6 +++--- .../contracts/shared/SwapHelperLib.sol | 4 ++-- .../contracts/zeta-swap/ZetaCurveSwapDemo.sol | 8 ++++---- .../contracts/zeta-swap/ZetaSwap.sol | 4 ++-- .../contracts/zeta-swap/ZetaSwapBtcInbound.sol | 4 ++-- .../scripts/liquidity-incentives/helpers.ts | 2 +- .../scripts/zeta-swap/stress-swap.ts | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8a8e2505..e6e32cd1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "statusBarItem.hoverBackground": "#71C87D" }, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "[solidity]": { "editor.tabSize": 4, diff --git a/packages/zeta-app-contracts/scripts/multi-chain-value/send-value.ts b/packages/zeta-app-contracts/scripts/multi-chain-value/send-value.ts index f8ecfcd5..f6c735f1 100644 --- a/packages/zeta-app-contracts/scripts/multi-chain-value/send-value.ts +++ b/packages/zeta-app-contracts/scripts/multi-chain-value/send-value.ts @@ -10,7 +10,7 @@ import { getAppAddress, getChainId } from "../address.helpers"; const networkName = network.name; -const doTranfer = async ( +const doTransfer = async ( sourceChain: ZetaProtocolNetwork, multiChainValueContract: MultiChainValue, chainId: number, @@ -46,10 +46,10 @@ const main = async () => { const destinationAddress = ethers.utils.solidityPack(["address"], [process.env.PUBLIC_KEY_1 ?? signer.address]); - await doTranfer(networkName, multiChainValueContract, getChainId("goerli_testnet"), amount, destinationAddress); - await doTranfer(networkName, multiChainValueContract, getChainId("mumbai_testnet"), amount, destinationAddress); - await doTranfer(networkName, multiChainValueContract, getChainId("bsc_testnet"), amount, destinationAddress); - await doTranfer(networkName, multiChainValueContract, getChainId("zeta_testnet"), amount, destinationAddress); + await doTransfer(networkName, multiChainValueContract, getChainId("goerli_testnet"), amount, destinationAddress); + await doTransfer(networkName, multiChainValueContract, getChainId("mumbai_testnet"), amount, destinationAddress); + await doTransfer(networkName, multiChainValueContract, getChainId("bsc_testnet"), amount, destinationAddress); + await doTransfer(networkName, multiChainValueContract, getChainId("zeta_testnet"), amount, destinationAddress); }; main().catch((error) => { diff --git a/packages/zevm-app-contracts/contracts/multi-output/ZetaMultiOutput.sol b/packages/zevm-app-contracts/contracts/multi-output/ZetaMultiOutput.sol index ec1cede1..a1970949 100644 --- a/packages/zevm-app-contracts/contracts/multi-output/ZetaMultiOutput.sol +++ b/packages/zevm-app-contracts/contracts/multi-output/ZetaMultiOutput.sol @@ -49,7 +49,7 @@ contract ZetaMultiOutput is zContract, Ownable, ZetaMultiOutputErrors { ) external virtual override onlySystem { if (_getTotalTransfers(zrc20) == 0) revert NoAvailableTransfers(); - address receipient = BytesHelperLib.bytesToAddress(message, 0); + address recipient = BytesHelperLib.bytesToAddress(message, 0); uint256 amountToTransfer = amount / _getTotalTransfers(zrc20); uint256 leftOver = amount - amountToTransfer * _getTotalTransfers(zrc20); @@ -74,8 +74,8 @@ contract ZetaMultiOutput is zContract, Ownable, ZetaMultiOutputErrors { targetZRC20, 0 ); - SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(receipient)); - emit Withdrawal(targetZRC20, outputAmount, receipient); + SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(recipient)); + emit Withdrawal(targetZRC20, outputAmount, recipient); } } } diff --git a/packages/zevm-app-contracts/contracts/shared/SwapHelperLib.sol b/packages/zevm-app-contracts/contracts/shared/SwapHelperLib.sol index 59f18880..f9dce8e8 100644 --- a/packages/zevm-app-contracts/contracts/shared/SwapHelperLib.sol +++ b/packages/zevm-app-contracts/contracts/shared/SwapHelperLib.sol @@ -42,14 +42,14 @@ library SwapHelperLib { ); } - function _doWithdrawal(address targetZRC20, uint256 amount, bytes32 receipient) internal { + function _doWithdrawal(address targetZRC20, uint256 amount, bytes32 recipient) internal { (address gasZRC20, uint256 gasFee) = IZRC20(targetZRC20).withdrawGasFee(); if (gasZRC20 != targetZRC20) revert WrongGasContract(); if (gasFee >= amount) revert NotEnoughToPayGasFee(); IZRC20(targetZRC20).approve(targetZRC20, gasFee); - IZRC20(targetZRC20).withdraw(abi.encodePacked(receipient), amount - gasFee); + IZRC20(targetZRC20).withdraw(abi.encodePacked(recipient), amount - gasFee); } function _existsPairPool(address uniswapV2Factory, address zrc20A, address zrc20B) internal view returns (bool) { diff --git a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaCurveSwapDemo.sol b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaCurveSwapDemo.sol index 856bc216..049c4e79 100644 --- a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaCurveSwapDemo.sol +++ b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaCurveSwapDemo.sol @@ -40,14 +40,14 @@ contract ZetaCurveSwapDemo is zContract, ZetaCurveSwapErrors { return 18; } - function _doWithdrawal(address targetZRC20, uint256 amount, bytes32 receipient) private { + function _doWithdrawal(address targetZRC20, uint256 amount, bytes32 recipient) private { (address gasZRC20, uint256 gasFee) = IZRC20(targetZRC20).withdrawGasFee(); if (gasZRC20 != targetZRC20) revert WrongGasContract(); if (gasFee >= amount) revert NotEnoughToPayGasFee(); IZRC20(targetZRC20).approve(targetZRC20, gasFee); - IZRC20(targetZRC20).withdraw(abi.encodePacked(receipient), amount - gasFee); + IZRC20(targetZRC20).withdraw(abi.encodePacked(recipient), amount - gasFee); } function onCrossChainCall( @@ -56,7 +56,7 @@ contract ZetaCurveSwapDemo is zContract, ZetaCurveSwapErrors { uint256 amount, bytes calldata message ) external override { - (address targetZRC20, bytes32 receipient, ) = abi.decode(message, (address, bytes32, uint256)); + (address targetZRC20, bytes32 recipient, ) = abi.decode(message, (address, bytes32, uint256)); address[] memory path = new address[](2); path[0] = zrc20; @@ -69,6 +69,6 @@ contract ZetaCurveSwapDemo is zContract, ZetaCurveSwapErrors { uint256 outAmount = ICRV3(crv3pool).exchange(i, j, amount, 0, false); - _doWithdrawal(targetZRC20, outAmount, receipient); + _doWithdrawal(targetZRC20, outAmount, recipient); } } diff --git a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwap.sol b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwap.sol index 35eacc04..64bf9bf8 100644 --- a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwap.sol +++ b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwap.sol @@ -24,7 +24,7 @@ contract ZetaSwap is zContract { uint256 amount, bytes calldata message ) external virtual override onlySystem { - (address targetZRC20, bytes32 receipient, uint256 minAmountOut) = abi.decode( + (address targetZRC20, bytes32 recipient, uint256 minAmountOut) = abi.decode( message, (address, bytes32, uint256) ); @@ -37,6 +37,6 @@ contract ZetaSwap is zContract { targetZRC20, minAmountOut ); - SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, receipient); + SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, recipient); } } diff --git a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwapBtcInbound.sol b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwapBtcInbound.sol index cd85dd00..b19735bd 100644 --- a/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwapBtcInbound.sol +++ b/packages/zevm-app-contracts/contracts/zeta-swap/ZetaSwapBtcInbound.sol @@ -25,7 +25,7 @@ contract ZetaSwapBtcInbound is zContract { uint256 amount, bytes calldata message ) external virtual override onlySystem { - address receipient = BytesHelperLib.bytesToAddress(message, 0); + address recipient = BytesHelperLib.bytesToAddress(message, 0); uint32 targetZRC20ChainId = BytesHelperLib.bytesToUint32(message, 20); address targetZRC20 = systemContract.gasCoinZRC20ByChainId(targetZRC20ChainId); @@ -38,6 +38,6 @@ contract ZetaSwapBtcInbound is zContract { targetZRC20, 0 ); - SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(receipient)); + SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(recipient)); } } diff --git a/packages/zevm-app-contracts/scripts/liquidity-incentives/helpers.ts b/packages/zevm-app-contracts/scripts/liquidity-incentives/helpers.ts index 29c0748f..3cfc3db1 100644 --- a/packages/zevm-app-contracts/scripts/liquidity-incentives/helpers.ts +++ b/packages/zevm-app-contracts/scripts/liquidity-incentives/helpers.ts @@ -23,7 +23,7 @@ export const deployRewardByToken = async ( deployer.address, deployer.address, zetaTokenAddress, - // @dev: now we send both tokens so contract calculate internaly LP address + // @dev: now we send both tokens so contract calculate internally LP address zetaTokenAddress, tokenAddress ); diff --git a/packages/zevm-app-contracts/scripts/zeta-swap/stress-swap.ts b/packages/zevm-app-contracts/scripts/zeta-swap/stress-swap.ts index 6ea9127b..81b42bae 100644 --- a/packages/zevm-app-contracts/scripts/zeta-swap/stress-swap.ts +++ b/packages/zevm-app-contracts/scripts/zeta-swap/stress-swap.ts @@ -1,6 +1,6 @@ /* ********************************* */ /* How to run this script -/* To run this script you have to setup the enviroment (yarn and setup .env) and run this command +/* To run this script you have to setup the environment (yarn and setup .env) and run this command /* ZETA_NETWORK=athens npx hardhat run scripts/zeta-swap/stress-swap.ts --network "polygon-mumbai" /* In the example we use "polygon-mumbai", that's the source network. Can be any valid source network /* Be sure to have enough gas tokens to pay all the tx