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

Feat/merge main dev #162

Merged
merged 78 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b802cec
update for auto wrap MNT to WMNT when depost
MickWang Apr 8, 2024
4d9cd13
unwrap weth when deposit
MickWang Apr 8, 2024
e965cb9
add weth contracts
MickWang Apr 9, 2024
bbb9ed3
fix conflicts
MickWang Apr 9, 2024
26e0260
fix lint issues
MickWang Apr 10, 2024
593cea3
fix lint issues
MickWang Apr 10, 2024
f4721ea
Merge branch 'main' into feat/wrap_mnt
MickWang Apr 12, 2024
1f27cb1
update feature.yml
MickWang Apr 12, 2024
626ff91
fix lint error
MickWang Apr 12, 2024
143b496
Merge branch 'main' into feat/wrap_mnt
MickWang Apr 12, 2024
a0245aa
Merge pull request #104 from zkLinkProtocol/feat/open_withdraw
leochw Apr 14, 2024
b935e75
Merge pull request #105 from zkLinkProtocol/feat/open_withdraw
leochw Apr 14, 2024
5a4ed69
Merge pull request #106 from zkLinkProtocol/feat/open_withdraw
leochw Apr 14, 2024
d0b3978
Merge pull request #109 from zkLinkProtocol/feat/not_withdraw_merge
leochw Apr 14, 2024
5b8a9f9
support merege token withraw
MickWang Apr 15, 2024
acc4c7a
update ui fir withdraw merge token
MickWang Apr 15, 2024
b9068ff
update estimate withdraw left time
MickWang Apr 15, 2024
1ed296b
update approve for merge token
MickWang Apr 16, 2024
6dd4166
update ui for withdraw merge token
MickWang Apr 16, 2024
1e6ed2c
Merge pull request #113 from zkLinkProtocol/feat/binance-banner
MickWang Apr 16, 2024
fa1f963
Merge pull request #115 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 16, 2024
456cdce
update ui for merge token allowance
MickWang Apr 16, 2024
1f6ff86
update ui for merge token allowance
MickWang Apr 16, 2024
79f24f6
Merge pull request #116 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 16, 2024
fc37521
fix: Fixing the issue of incorrect chain display in the withdraw feature
haymond-ZK Apr 16, 2024
f99860e
Merge pull request #117 from zkLinkProtocol/feature-withdraw
MickWang Apr 16, 2024
ce7e4bf
update switch chain for binance
MickWang Apr 16, 2024
7a3ad9e
Merge pull request #119 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 16, 2024
20e6316
add selected token check
MickWang Apr 16, 2024
be7a084
update binnace wallet display name
MickWang Apr 16, 2024
3068782
Merge pull request #120 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 16, 2024
f3c6922
fix change network text issue
MickWang Apr 17, 2024
43ea917
Merge pull request #125 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 17, 2024
ecef897
remove debugger
MickWang Apr 17, 2024
4c0d7d4
Merge pull request #126 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 17, 2024
4aaa20b
feat:wrap MNT and unwrap WETH
Apr 17, 2024
a1fb928
fix text error
MickWang Apr 17, 2024
b58afc1
Merge pull request #129 from zkLinkProtocol/feat/withdraw_merge
leochw Apr 17, 2024
65f7328
Merge branch 'main' into feat/wrap_mnt
MickWang Apr 17, 2024
2c9e54d
fix conflicts
MickWang Apr 17, 2024
966fe74
fix: change time show
haymond-ZK Apr 17, 2024
f9c9a76
Merge branch 'preview' into feat/wrap_mnt
MickWang Apr 18, 2024
00dffdc
Merge pull request #134 from zkLinkProtocol/feat/wrap_mnt
leochw Apr 18, 2024
8fe53a6
Merge pull request #131 from zkLinkProtocol/feature-change-network
MickWang Apr 18, 2024
38df7c7
fix: Adjustment of transfer status judgment
haymond-ZK Apr 18, 2024
3e9c624
Merge pull request #137 from zkLinkProtocol/feature-change-network
MickWang Apr 18, 2024
e5a5646
fix:mantle weth and icon url
zkcarl Apr 18, 2024
a721caf
Merge pull request #139 from zkLinkProtocol/feat/wrap_mnt
MickWang Apr 18, 2024
ef20adc
update ui for withdrawl limit
MickWang Apr 18, 2024
623977a
Merge branch 'preview' into feat/withdraw_merge
MickWang Apr 18, 2024
e7e8c15
Merge pull request #140 from zkLinkProtocol/feat/withdraw_merge
zkcarl Apr 18, 2024
bdf0986
fix conflicts
MickWang Apr 18, 2024
df5f4bd
filter not supported merge token on selected network
MickWang Apr 18, 2024
add8d46
Merge pull request #142 from zkLinkProtocol/feat/withdraw_merge
zkcarl Apr 18, 2024
6465e2d
add detect for binance web3 app
MickWang Apr 18, 2024
20df07d
Merge pull request #143 from zkLinkProtocol/feat/binance_wallet_detect
leochw Apr 18, 2024
c84c2a1
fix: Modify the chain name display in the claiming prompt message
haymond-ZK Apr 19, 2024
7911345
add injected in supported wallet list
MickWang Apr 19, 2024
9c9d2f0
Merge pull request #146 from zkLinkProtocol/fix/support_injected
haymond-ZK Apr 19, 2024
ca5031d
Merge pull request #144 from zkLinkProtocol/feature-change-network
Evan-zkLinkLabs Apr 19, 2024
5406046
Merge pull request #151 from zkLinkProtocol/preview
haymond-ZK Apr 19, 2024
9558725
fix change network ui issue for claim withdrawal
MickWang Apr 19, 2024
a3aef17
Merge pull request #152 from zkLinkProtocol/fix/fix_change_network_issue
leochw Apr 20, 2024
344289b
update injected binance wallet
MickWang Apr 20, 2024
8c240a9
Merge pull request #154 from zkLinkProtocol/feat/binance_wallet_detect
leochw Apr 20, 2024
b030fd3
show thrid party bridge
MickWang Apr 20, 2024
6d6eaeb
show thrid party bridge
MickWang Apr 20, 2024
220f300
fix hide blast ui issue
MickWang Apr 21, 2024
61536f7
Merge pull request #156 from zkLinkProtocol/fix/hide_blast_issue
leochw Apr 21, 2024
53bfa1c
Merge pull request #155 from zkLinkProtocol/feat/show_thrid_party_bridge
leochw Apr 21, 2024
ed2c917
fix blast ui issue
MickWang Apr 21, 2024
ab65cea
fix blast ui issue
MickWang Apr 21, 2024
a44c00b
fix blast ui issue
MickWang Apr 21, 2024
a8ae15e
Merge pull request #157 from zkLinkProtocol/fix/hide_blast_issue
leochw Apr 21, 2024
8c8e7c8
handle for url params
MickWang Apr 22, 2024
6fc4ea2
Merge pull request #159 from zkLinkProtocol/fix/hide_blast_issue
leochw Apr 22, 2024
63f4330
Merge branch 'main' into feat/merge_main_dev
MickWang Apr 22, 2024
2e32558
Merge branch 'dev' into feat/merge_main_dev
MickWang Apr 22, 2024
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 components/common/Timer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let intervalId: ReturnType<typeof setInterval> | undefined = undefined;

const formatTimeDiff = (diff: number, onlyDays = false): string => {
const day = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);

Expand Down
8 changes: 4 additions & 4 deletions components/common/button/Dropdown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<CommonButton class="dropdown-button" :class="noChevron?'noClick':''">
<CommonButton class="dropdown-button" :class="noChevron ? 'noClick' : ''">
<div v-if="$slots['left-icon']" class="left-icon-container">
<slot name="left-icon" />
</div>
Expand Down Expand Up @@ -46,10 +46,10 @@ defineProps({
}
}

.noClick{
background: transparent !important;
:hover{
.noClick {
background: transparent !important;
:hover {
background: transparent !important;
}
}
</style>
Expand Down
16 changes: 11 additions & 5 deletions components/common/input/TransactionSend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ import { computed, ref, watch } from "vue";
import { LockClosedIcon } from "@heroicons/vue/24/outline";
import { BigNumber } from "ethers";

import useNetworks from "@/composables/useNetworks";

import type { Token, TokenAmount } from "@/types";
import type { BigNumberish } from "ethers";
import type { PropType } from "vue";
import { useNetworkStore } from "@/store/network";

import { decimalToBigNumber, formatTokenPrice, parseTokenAmount, removeSmallAmountPretty } from "@/utils/formatters";
import { ETH_ADDRESS, L2_ETH_TOKEN_ADDRESS } from "~/zksync-web3-nova/src/utils";
import useNetworks from "@/composables/useNetworks";
const { zkSyncNetworks,isCustomNode,defaultNetwork } = useNetworks();
const { zkSyncNetworks } = useNetworks();
// const { selectedNetwork } = storeToRefs(useNetworkStore());
const selectedNetwork = zkSyncNetworks.filter((i:any)=>i.key === "primary")[0];
const selectedNetwork = zkSyncNetworks.filter((i) => i.key === "primary")[0];
const props = defineProps({
modelValue: {
type: String,
Expand Down Expand Up @@ -161,7 +162,12 @@ const selectedTokenAddress = computed({
});
const selectedToken = computed(() => {
const tokens = props.balances.length ? props.balances : props.tokens;
return tokens.filter((e)=> selectedNetwork.isEthGasToken || (e.address !== ETH_ADDRESS && e.address.toLowerCase() !== L2_ETH_TOKEN_ADDRESS)).find((e) => e.address === props.tokenAddress);
return tokens
.filter(
(e) =>
selectedNetwork.isEthGasToken || (e.address !== ETH_ADDRESS && e.address.toLowerCase() !== L2_ETH_TOKEN_ADDRESS)
)
.find((e) => e.address === props.tokenAddress);
});
const tokenBalance = computed(() => {
if (!props.balances.length || !selectedToken.value) {
Expand Down
115 changes: 82 additions & 33 deletions components/common/input/TransactionWithdraw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,64 @@
autocomplete="off"
autofocus
/>
<transition v-bind="TransitionOpacity()" mode="default">
<CommonInputErrorMessage v-if="amountError">
<template v-if="amountError === 'insufficient_balance' || maxDecimalAmount === '0'">
Insufficient balance
</template>
<template v-else-if="amountError === 'exceeds_balance' && !maxAmount">Amount exceeds balance</template>
<template v-else-if="amountError === 'exceeds_merge_limit'">
Input amount exceeds the merge limit.
</template>
<template v-else-if="amountError === 'exceeds_max_amount' || amountError === 'exceeds_balance'">
Max amount is
<button
type="button"
class="cursor-pointer font-medium underline underline-offset-2"
@click.prevent="setMaxAmount()"
<div class="flex justify-between">
<transition v-bind="TransitionOpacity()" mode="default">
<div class="mr-5">
<CommonButtonLabel
v-if="mergeWithdrawalLimit !== undefined"
as="div"
variant="light"
class="mt-1 text-left text-sm"
>
{{ maxDecimalAmount }}
</button>
</template>
<template v-else-if="amountError === 'exceeds_decimals'">
Max decimal length for {{ selectedToken?.symbol }} is {{ selectedToken?.decimals }}
</template>

</CommonInputErrorMessage>
<CommonButtonLabel v-else-if="inputted" as="div" variant="light" class="-mb-6 mt-1 text-right text-sm">
{{ totalAmountPrice }}
</CommonButtonLabel>
</transition>
Available for redemption: {{ mergeWithdrawalLimit }}
</CommonButtonLabel>
<CommonInputErrorMessage v-if="amountError">
<template v-if="amountError === 'insufficient_balance' || maxDecimalAmount === '0'">
Insufficient balance
</template>
<template v-else-if="amountError === 'exceeds_balance' && !maxAmount"
>Amount exceeds balance</template
>
<template v-else-if="amountError === 'exceeds_merge_limit'">
Input amount exceeds the merge limit.
</template>
<template v-else-if="amountError === 'exceeds_merge_withdrawal_limit'">
The input amount exceeds the {{ selectedToken.symbol }}.{{
selectedNetwork.l1Network?.name.split(" ")[0]
}}
amount locked in the
<a :href="MergeTokenContractUrl" target="_blank" class="underline underline-offset-2"
>Nova merge token contract.</a
>
You may want to consider withdrawing to another network or reducing the input.
</template>
<template v-else-if="amountError === 'exceeds_max_amount' || amountError === 'exceeds_balance'">
Max amount is
<button
type="button"
class="cursor-pointer font-medium underline underline-offset-2"
@click.prevent="setMaxAmount()"
>
{{ maxDecimalAmount }}
</button>
</template>
<template v-else-if="amountError === 'exceeds_decimals'">
Max decimal length for {{ selectedToken?.symbol }} is {{ selectedToken?.decimals }}
</template>
</CommonInputErrorMessage>
</div>
</transition>
<transition>
<CommonButtonLabel
v-if="!amountError && inputted"
as="div"
variant="light"
class="-mb-6 mt-1 text-right text-sm"
>
{{ totalAmountPrice }}
</CommonButtonLabel>
</transition>
</div>
</div>

<transition v-bind="TransitionOpacity(300)">
Expand All @@ -101,15 +131,18 @@
</template>

<script lang="ts" setup>
import { computed, ref, watch } from "vue";
import { computed, mergeProps, ref, watch } from "vue";

import { LockClosedIcon } from "@heroicons/vue/24/outline";
import { BigNumber } from "ethers";
import { storeToRefs } from "pinia";

import type { Token, TokenAmount } from "@/types";
import type { BigNumberish } from "ethers";
import type { PropType } from "vue";

import { useNetworkStore } from "@/store/network";
import { MergeTokenContractUrl } from "@/utils/constants";
import { decimalToBigNumber, formatTokenPrice, parseTokenAmount, removeSmallAmountPretty } from "@/utils/formatters";
import { ETH_ADDRESS, L2_ETH_TOKEN_ADDRESS } from "~/zksync-web3-nova/src/utils";
const { selectedNetwork } = storeToRefs(useNetworkStore());
Expand Down Expand Up @@ -150,8 +183,15 @@ const props = defineProps({
},
mergeLimitExceeds: {
type: Boolean,
default: false
}
default: false,
},
mergeWithdrawalLimitExceeds: {
type: Boolean,
default: false,
},
mergeWithdrawalLimit: {
type: String,
},
});

const emit = defineEmits<{
Expand All @@ -166,7 +206,13 @@ const selectedTokenAddress = computed({
});
const selectedToken = computed(() => {
const tokens = props.balances.length ? props.balances : props.tokens;
return tokens.filter((e)=> selectedNetwork.value.isEthGasToken || (e.address !== ETH_ADDRESS && e.address.toLowerCase() !== L2_ETH_TOKEN_ADDRESS)).find((e) => e.address === props.tokenAddress);
return tokens
.filter(
(e) =>
selectedNetwork.value.isEthGasToken ||
(e.address !== ETH_ADDRESS && e.address.toLowerCase() !== L2_ETH_TOKEN_ADDRESS)
)
.find((e) => e.address === props.tokenAddress);
});
const tokenBalance = computed(() => {
if (!props.balances.length || !selectedToken.value) {
Expand Down Expand Up @@ -223,8 +269,11 @@ const setMaxAmount = () => {
};

const amountError = computed(() => {
if(props.mergeLimitExceeds) {
return 'exceeds_merge_limit'
if (props.mergeLimitExceeds) {
return "exceeds_merge_limit";
}
if (props.mergeWithdrawalLimitExceeds) {
return "exceeds_merge_withdrawal_limit";
}
if (!selectedToken.value) return;
if (tokenBalance.value && totalComputeAmount.value.gt(tokenBalance.value.amount)) {
Expand Down
14 changes: 10 additions & 4 deletions components/destination/DestinationItem.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<CommonButtonLineWithImg :as="as" :icon="icon" class="destination-item" :class="{ 'disable': disabled }" v-tooltip="disabled&&'Withdrawal from Nova will be enable in April.'">
<CommonButtonLineWithImg
:as="as"
:icon="icon"
class="destination-item"
:class="{ disable: disabled }"
v-tooltip="disabled && 'Withdrawal from Nova will be enable in April.'"
>
<template #image>
<slot name="image">
<CommonImageLoader class="destination-item-icon" :src="iconUrl" />
Expand Down Expand Up @@ -50,18 +56,18 @@ defineProps({
disabled: {
type: Boolean,
default: false,
}
},
});
</script>

<style lang="scss">
.marginLeft{
.marginLeft {
display: inline-block;
position: absolute;
right: 10px;
color: #999a9c;
}
.disable{
.disable {
background: #252628 !important;
color: #999a9c !important;
position: relative;
Expand Down
8 changes: 1 addition & 7 deletions components/header/AccountDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ import { computed, ref, watch } from "vue";
import { useTippy } from "vue-tippy";

import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
import {
ArrowTopRightOnSquareIcon,
DocumentDuplicateIcon,
ExclamationCircleIcon,
PowerIcon,
Squares2X2Icon,
} from "@heroicons/vue/24/outline";
import { ArrowTopRightOnSquareIcon, DocumentDuplicateIcon, PowerIcon, Squares2X2Icon } from "@heroicons/vue/24/outline";
import { storeToRefs } from "pinia";

import useCopy from "@/composables/useCopy";
Expand Down
2 changes: 1 addition & 1 deletion components/header/AccountDropdownButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ import { storeToRefs } from "pinia";
import { useOnboardStore } from "@/store/onboard";

const onboardStore = useOnboardStore();
const { account,walletName } = storeToRefs(onboardStore);
const { account, walletName } = storeToRefs(onboardStore);
</script>
13 changes: 5 additions & 8 deletions components/header/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@
</div>
</template>
<script>
// Import Swiper Vue.js components
import { Swiper, SwiperSlide } from "swiper/vue";

// Import Swiper styles
import "swiper/css";

// import "swiper/css/pagination";
// import "swiper/css/navigation";

// import required modules
import { Autoplay, Pagination, Navigation } from "swiper/modules";

import { Autoplay, Navigation, Pagination } from "swiper/modules";
// Import Swiper Vue.js components
import { Swiper, SwiperSlide } from "swiper/vue";
// Import Swiper styles
import "swiper/css";
export default {
components: {
Swiper,
Expand Down
6 changes: 4 additions & 2 deletions components/header/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

<script lang="ts" setup>
import { ref } from "vue";
import { computed } from "vue";

import {
ArrowsRightLeftIcon,
Expand All @@ -124,13 +125,14 @@ import {
} from "@heroicons/vue/24/outline";
import { storeToRefs } from "pinia";

import Banner from "./Banner.vue";

import useColorMode from "@/composables/useColorMode";
import useNetworks from "@/composables/useNetworks";

import { useRoute } from "#imports";
import { useOnboardStore } from "@/store/onboard";
import { useZkSyncWithdrawalsStore } from "@/store/zksync/withdrawals";
import useNetworks from "@/composables/useNetworks";
import Banner from "./Banner.vue";
const { defaultNetwork, isMainnet } = useNetworks();

const route = useRoute();
Expand Down
5 changes: 4 additions & 1 deletion components/header/MobileMainNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,22 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch } from "vue";

import {
ArrowsRightLeftIcon,
ArrowsUpDownIcon,
CheckIcon,
ChevronRightIcon,
MoonIcon,
SunIcon,
WalletIcon,
} from "@heroicons/vue/24/outline";
import { storeToRefs } from "pinia";

import useColorMode from "@/composables/useColorMode";
import useNetworks from "@/composables/useNetworks";

import type { ZkSyncNetwork } from "@/data/networks";

import { useRoute } from "#imports";
import { useNetworkStore } from "@/store/network";
import { useZkSyncWithdrawalsStore } from "@/store/zksync/withdrawals";
Expand Down
4 changes: 2 additions & 2 deletions components/header/NetworkDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<CommonButtonDropdown :toggled="open">
<template #left-icon>
<!-- <IconsEra /> -->
<img class="image-loader-image loaded" :src="selectedNetwork.logoUrl">
<img class="image-loader-image loaded" :src="selectedNetwork.logoUrl" />
</template>
<span>{{ selectedNetwork.l1Network?.name }}</span>
</CommonButtonDropdown>
Expand All @@ -27,7 +27,7 @@
>
<template #left-icon>
<!-- <IconsEra /> -->
<img class="image-loader-image loaded" :src="item.logoUrl">
<img class="image-loader-image loaded" :src="item.logoUrl" />
</template>
<span>{{ item.l1Network?.name }}</span>
<template #right-icon>
Expand Down
Loading
Loading