Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some typos #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"statusBarItem.hoverBackground": "#71C87D"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[solidity]": {
"editor.tabSize": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand All @@ -37,6 +37,6 @@ contract ZetaSwap is zContract {
targetZRC20,
minAmountOut
);
SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, receipient);
SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, recipient);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -38,6 +38,6 @@ contract ZetaSwapBtcInbound is zContract {
targetZRC20,
0
);
SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(receipient));
SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, BytesHelperLib.addressToBytes(recipient));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading