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: mantle #2481

Merged
merged 10 commits into from
Mar 22, 2024
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@kybernetwork/oauth2": "1.0.1",
"@kyberswap/krystal-walletconnect-v2": "0.0.1",
"@kyberswap/ks-sdk-classic": "^1.0.3",
"@kyberswap/ks-sdk-core": "1.1.2",
"@kyberswap/ks-sdk-core": "1.1.3",
"@kyberswap/ks-sdk-elastic": "^1.1.2",
"@lingui/macro": "^4.6.0",
"@lingui/react": "^4.6.0",
Expand Down Expand Up @@ -206,7 +206,7 @@
"vite-tsconfig-paths": "^4.0.8"
},
"resolutions": {
"@kyberswap/ks-sdk-core": "1.1.2",
"@kyberswap/ks-sdk-core": "1.1.3",
"babel-plugin-lodash/@babel/types": "~7.20.0",
"react-error-overlay": "6.0.9"
}
Expand Down
9 changes: 8 additions & 1 deletion src/components/ClassicElasticTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ function ClassicElasticTab() {

const upToMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`)

const dontShowLegacy = [ChainId.ZKEVM, ChainId.BASE, ChainId.LINEA, ChainId.SCROLL, ChainId.BLAST].includes(chainId)
const dontShowLegacy = [
ChainId.ZKEVM,
ChainId.BASE,
ChainId.LINEA,
ChainId.SCROLL,
ChainId.BLAST,
ChainId.MANTLE,
].includes(chainId)

const showLegacyExplicit =
upToMedium || dontShowLegacy ? false : isFarmPage ? shouldShowFarmTab : shouldShowPositionTab
Expand Down
3 changes: 1 addition & 2 deletions src/components/Header/web3/NetworkModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ButtonAction } from 'components/Button'
import Column from 'components/Column'
import Modal from 'components/Modal'
import Row, { RowBetween } from 'components/Row'
import { mantle, x1 } from 'constants/networks/index'
import { x1 } from 'constants/networks/index'
import { NetworkInfo } from 'constants/networks/type'
import { Z_INDEXS } from 'constants/styles'
import { useActiveWeb3React } from 'hooks'
Expand Down Expand Up @@ -204,7 +204,6 @@ export default function NetworkModal({
.map((networkInfo: NetworkInfo) => {
return renderNetworkButton(networkInfo)
})}
<DraggableNetworkButton networkInfo={mantle} isComingSoon />
<DraggableNetworkButton networkInfo={x1} isComingSoon />
</>
</NetworkList>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SwapForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const SwapForm: React.FC<SwapFormProps> = props => {
</Flex>

<Flex sx={{ gap: '12px' }}>
{!isPartnerSwap && chainId !== ChainId.BLAST && (
{!isPartnerSwap && ![ChainId.BLAST, ChainId.MANTLE].includes(chainId) && (
<PriceAlertButton
onClick={() =>
navigate(
Expand Down
1 change: 1 addition & 0 deletions src/constants/bases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const WETH_ONLY: ChainTokenList = {
[ChainId.BASE]: [WETH[ChainId.BASE]],
[ChainId.SCROLL]: [WETH[ChainId.SCROLL]],
[ChainId.BLAST]: [WETH[ChainId.BLAST]],
[ChainId.MANTLE]: [WETH[ChainId.MANTLE]],
}

// used to construct intermediary pairs for trading
Expand Down
3 changes: 3 additions & 0 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
fantom,
görli,
linea,
mantle,
matic,
mumbai,
optimism,
Expand Down Expand Up @@ -46,6 +47,7 @@ const NETWORKS_INFO_CONFIG: NETWORKS_INFO_CONFIG_TYPE = {
[ChainId.BASE]: base,
[ChainId.SCROLL]: scroll,
[ChainId.BLAST]: blast,
[ChainId.MANTLE]: mantle,
} as const

//this Proxy helps fallback undefined ChainId by Ethereum info
Expand Down Expand Up @@ -75,6 +77,7 @@ export const MAINNET_NETWORKS = [
ChainId.BTTC,
ChainId.CRONOS,
ChainId.BLAST,
ChainId.MANTLE,
] as const

// These option of walletconnect is not support by wallets properly
Expand Down
12 changes: 6 additions & 6 deletions src/constants/networks/mantle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ const mantle: NetworkInfo = {
iconSelected: NOT_SUPPORT,

defaultBlockSubgraph: '',
etherscanUrl: '',
etherscanUrl: 'https://explorer.mantle.xyz',
etherscanName: 'Mantle scan',
bridgeURL: 'https://bridge.mantle.xyz',
nativeToken: {
symbol: 'MNT',
name: 'MNT',
logo: 'https://storage.googleapis.com/ks-setting-1d682dca/2bccd96f-b100-4ca1-858e-d8353ab0d0861710387147471.png',
decimal: 18,
minForGas: 10 ** 16,
minForGas: 2 * 10 ** 17,
},
defaultRpcUrl: '',
defaultRpcUrl: 'https://rpc.ankr.com/mantle',
multicall: '0xcA11bde05977b3631167028862bE2a173976CA11',
classic: {
defaultSubgraph: '',
Expand Down Expand Up @@ -63,10 +63,10 @@ const mantle: NetworkInfo = {
helper: '0x214061F0e250A27a49f609d9caf2987a7bC8fA6B',
},
},
limitOrder: NOT_SUPPORT,
limitOrder: '*',
averageBlockTimeInSeconds: 2.0, // dont use for base
coingeckoNetworkId: 'blast',
coingeckoNativeTokenId: 'ethereum',
coingeckoNetworkId: 'mantle',
coingeckoNativeTokenId: 'mnt',
deBankSlug: EMPTY,
dexToCompare: NOT_SUPPORT,
geckoTermialId: NOT_SUPPORT,
Expand Down
5 changes: 5 additions & 0 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const STABLE_COIN_ADDRESSES_TO_TAKE_FEE: Record<ChainId, string[]> = {
[ChainId.BASE]: [],
[ChainId.SCROLL]: [],
[ChainId.BLAST]: [],
[ChainId.MANTLE]: [],
}

// This is basically the same as STABLE_COIN_ADDRESSES_TO_TAKE_FEE,
Expand Down Expand Up @@ -139,6 +140,7 @@ export const SUPER_STABLE_COINS_ADDRESS: { [chainId in ChainId]: string[] } = {
[ChainId.SCROLL]: [],
[ChainId.SCROLL]: [],
[ChainId.BLAST]: [],
[ChainId.MANTLE]: [],
}

export const CORRELATED_COINS_ADDRESS: { [chainId in ChainId]: string[][] } = {
Expand Down Expand Up @@ -187,6 +189,7 @@ export const CORRELATED_COINS_ADDRESS: { [chainId in ChainId]: string[][] } = {
[ChainId.BASE]: [],
[ChainId.SCROLL]: [],
[ChainId.BLAST]: [],
[ChainId.MANTLE]: [],
}

export const KNC_ADDRESS = '0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202'
Expand All @@ -213,6 +216,7 @@ export const KNC: { [chainId in ChainId]: Token } = {
[ChainId.SCROLL]: new Token(ChainId.SCROLL, KNC_ADDRESS, 18, 'KNC', 'KNC'),
[ChainId.ZKSYNC]: new Token(ChainId.ZKSYNC, KNC_ADDRESS, 18, 'KNC', 'KNC'),
[ChainId.BLAST]: new Token(ChainId.BLAST, KNC_ADDRESS, 18, 'KNC', 'KNC'),
[ChainId.MANTLE]: new Token(ChainId.MANTLE, KNC_ADDRESS, 18, 'KNC', 'KNC'),

[ChainId.AVAXTESTNET]: new Token(ChainId.AVAXTESTNET, KNC_ADDRESS, 18, 'KNC', 'KNC'),
[ChainId.MUMBAI]: new Token(ChainId.MUMBAI, '0xFD1f9381Cb641Dc76Fe8087dbcf8ea84a2c77cbE', 18, 'KNC', 'KNC'),
Expand Down Expand Up @@ -241,6 +245,7 @@ export const DEFAULT_OUTPUT_TOKEN_BY_CHAIN: Partial<Record<ChainId, Token>> = {
[ChainId.BASE]: new Token(ChainId.BASE, '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', 6, 'USDC', 'USD Coin'),
[ChainId.SCROLL]: new Token(ChainId.SCROLL, '0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df', 6, 'USDT', 'Tether USD'),
[ChainId.BLAST]: new Token(ChainId.BLAST, '0x4300000000000000000000000000000000000003', 18, 'USDB', 'USDB'),
[ChainId.MANTLE]: new Token(ChainId.MANTLE, '0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE', 18, 'USDT', 'USDT'),
}

export const DEFAULT_SWAP_FEE_STABLE_PAIRS = 4
Expand Down
2 changes: 2 additions & 0 deletions src/pages/About/AboutKyberSwap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ function AboutKyberSwap() {
/>

<img src="https://blastscan.io/images/logo-ether.svg?v=0.1.0" alt="Blast" width="100%" />

<img src="https://www.mantle.xyz/logo-lockup.svg" alt="mantle" width="100%" />
</Powered>
</Text>
</Wrapper>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3735,10 +3735,10 @@
tiny-warning "^1.0.3"
toformat "^2.0.0"

"@kyberswap/ks-sdk-core@1.1.2", "@kyberswap/ks-sdk-core@^1.0.5":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@kyberswap/ks-sdk-core/-/ks-sdk-core-1.1.2.tgz#9a6c5bc5c087c1a6acce3d9c9fb831cf0e22b0f5"
integrity sha512-P7bWLn9DsGWtVS4VMs47lmq3UM8qwD+RwUjZCtlD/zp1/nGM2rXLT2eYQbmf16e6tCw5mA5+AozPmoyf2eIBIA==
"@kyberswap/ks-sdk-core@1.1.3", "@kyberswap/ks-sdk-core@^1.0.5":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@kyberswap/ks-sdk-core/-/ks-sdk-core-1.1.3.tgz#952dabacff1a831463b0dd95f8cdbe13bfc41c4f"
integrity sha512-TzTkhBVqlIXUi3s20MiTakdEcpyvMd/3JG0B3Xo/AWMFqc8WSaMRn3/mr4cMX5UXeo1LNy0nLIRD06bjQGyHjw==
dependencies:
"@ethersproject/address" "^5.0.2"
big.js "^5.2.2"
Expand Down
Loading