diff --git a/src/components/bridge/BridgeSelection.vue b/src/components/bridge/BridgeSelection.vue index 7ccc5c5cc..cfaed5e10 100644 --- a/src/components/bridge/BridgeSelection.vue +++ b/src/components/bridge/BridgeSelection.vue @@ -45,9 +45,9 @@
-
+
+ + {{ $t('bridge.underMaintenance') }} + +
+
{{ $t('approve') }} {{ $t('bridge.bridge') }} @@ -162,7 +172,7 @@ import { truncate } from '@astar-network/astar-sdk-core'; import { isHex } from '@polkadot/util'; import TokenBalance from 'src/components/common/TokenBalance.vue'; -import { useAccount } from 'src/hooks'; +import { useAccount, useNetworkInfo } from 'src/hooks'; import { EthBridgeNetworkName, LayerZeroToken, lzBridgeIcon } from 'src/modules/zk-evm-bridge'; import { useStore } from 'src/store'; import { PropType, computed, defineComponent, ref, watch } from 'vue'; @@ -250,6 +260,7 @@ export default defineComponent({ }, setup(props) { const { currentAccount } = useAccount(); + const { isBridgeMaintenanceMode } = useNetworkInfo(); const nativeTokenSymbol = computed(() => { return props.fromChainName === LayerZeroNetworkName.AstarEvm ? 'ASTR' : 'ETH'; }); @@ -310,6 +321,7 @@ export default defineComponent({ truncate, bridge, approve, + isBridgeMaintenanceMode, }; }, }); diff --git a/src/hooks/useInflation.ts b/src/hooks/useInflation.ts index ef0e60ecd..f28245981 100644 --- a/src/hooks/useInflation.ts +++ b/src/hooks/useInflation.ts @@ -76,7 +76,11 @@ export function useInflation(): UseInflation { } const balancesRepository = container.get(Symbols.BalancesRepository); - const initialTotalIssuance = await balancesRepository.getTotalIssuance(period1StartBlock - 1); + const initialTotalIssuance = + (await balancesRepository.getTotalIssuance(period1StartBlock - 1)) - + (networkNameSubstrate.value.toLowerCase() === 'astar' + ? BigInt('350000000000000000000000000') + : BigInt(0)); // Quick fox for token burning event. TODO make a proper solution const realizedTotalIssuance = await balancesRepository.getTotalIssuance(); const { diff --git a/src/hooks/useNetworkInfo.ts b/src/hooks/useNetworkInfo.ts index 0f414fac0..a98af9c6f 100644 --- a/src/hooks/useNetworkInfo.ts +++ b/src/hooks/useNetworkInfo.ts @@ -113,7 +113,7 @@ export function useNetworkInfo() { }); const isBridgeMaintenanceMode = computed(() => { - return isZkyoto.value; + return false; }); return { diff --git a/src/hooks/xcm/useTransferRouter.ts b/src/hooks/xcm/useTransferRouter.ts index 676b90de4..1d3e833ae 100644 --- a/src/hooks/xcm/useTransferRouter.ts +++ b/src/hooks/xcm/useTransferRouter.ts @@ -26,7 +26,7 @@ export type TransferMode = 'local' | 'xcm'; export const astarNetworks = ['astar', 'shiden', 'shibuya']; export const astarNativeTokens = ['sdn', 'astr', 'sby']; // e.g.: endpointKey.SHIDEN; -const disabledXcmChain: endpointKey | undefined = endpointKey.SHIDEN; +const disabledXcmChains: endpointKey[] | undefined = [endpointKey.SHIDEN, endpointKey.ASTAR]; export interface NetworkFromTo { from: string; @@ -376,7 +376,9 @@ export function useTransferRouter() { return false; } - const isDisabledXcmChain = disabledXcmChain === currentNetworkIdx.value; + const isDisabledXcmChain = Boolean( + disabledXcmChains && disabledXcmChains.some((it) => it === currentNetworkIdx.value) + ); const originChain = token.value?.originChain || ''; return checkIsDisabledToken(originChain) || isDisabledXcmChain; }); diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 09111007c..d9d1c486e 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -1114,6 +1114,8 @@ export default { warningHighTraffic: 'High bridge traffic may delay withdrawal transactions up to 5 hours. We appreciate your patience.', warningHighTrafficMore: '(read more)', + underMaintenance: + 'Astar zkEVM is currently under the maintenance. We apologize for any inconvenience.', modals: { highTraffic: { text1: diff --git a/src/modules/zk-evm-bridge/l1-bridge/index.ts b/src/modules/zk-evm-bridge/l1-bridge/index.ts index 6b13bbc14..949cfda96 100644 --- a/src/modules/zk-evm-bridge/l1-bridge/index.ts +++ b/src/modules/zk-evm-bridge/l1-bridge/index.ts @@ -4,8 +4,8 @@ export * from './utils'; export const ZK_EVM_AGGREGATED_BRIDGE_ABI = ABI_ZK_EVM_AGGREGATED_BRIDGE; export const zkEvmApi = { - testnet: 'https://bridge-api.zkyoto.gelato.digital', - mainnet: 'https://bridge-api.astar-zkevm.gelato.digital', + testnet: 'https://zkyoto-bridge-api.astar.network', + mainnet: 'https://bridge-api.mainnet-astar.com', }; export enum EthBridgeNetworkName { diff --git a/src/staking-v3/logic/services/DappStakingService.ts b/src/staking-v3/logic/services/DappStakingService.ts index 0a734edba..6632ba61c 100644 --- a/src/staking-v3/logic/services/DappStakingService.ts +++ b/src/staking-v3/logic/services/DappStakingService.ts @@ -746,7 +746,7 @@ export class DappStakingService extends SignerService implements IDappStakingSer const formattedBonusRewardsPoolPerPeriod = weiToToken( inflationConfiguration.bonusRewardPoolPerPeriod ); - const voteAmount = this.getStakeAmount(protocolState, eraInfo); + const voteAmount = this.getVoteAmount(protocolState, eraInfo); const bonusPercentPerPeriod = formattedBonusRewardsPoolPerPeriod / voteAmount; const simulatedBonusPerPeriod = simulatedVoteAmount * bonusPercentPerPeriod; const periodsPerYear = eraLengths.periodsPerCycle * cyclesPerYear; @@ -839,4 +839,14 @@ export class DappStakingService extends SignerService implements IDappStakingSer return currentStakeAmount; } + + private getVoteAmount(protocolState: ProtocolState, eraInfo: EraInfo): number { + const currentVoteAmount = weiToToken( + protocolState.periodInfo.subperiod === PeriodType.Voting + ? eraInfo.nextStakeAmount?.voting ?? BigInt(0) + : eraInfo.currentStakeAmount.voting + ); + + return currentVoteAmount; + } }